diff --git a/tools/ui/node_modules/highlight.js/styles/base16/mexico-light.css b/tools/ui/node_modules/highlight.js/styles/base16/mexico-light.css new file mode 100644 index 0000000000000000000000000000000000000000..85602311cc08806de45fbfc43e4bb3676ada0c50 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/mexico-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Mexico Light + Author: Sheldon Johnson + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme mexico-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #f8f8f8 Default Background +base01 #e8e8e8 Lighter Background (Used for status bars, line number and folding marks) +base02 #d8d8d8 Selection Background +base03 #b8b8b8 Comments, Invisibles, Line Highlighting +base04 #585858 Dark Foreground (Used for status bars) +base05 #383838 Default Foreground, Caret, Delimiters, Operators +base06 #282828 Light Foreground (Not often used) +base07 #181818 Light Background (Not often used) +base08 #ab4642 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #dc9656 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f79a0e Classes, Markup Bold, Search Text Background +base0B #538947 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #4b8093 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #7cafc2 Functions, Methods, Attribute IDs, Headings +base0E #96609e Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #a16946 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #383838; + background: #f8f8f8 +} +.hljs::selection, +.hljs ::selection { + background-color: #d8d8d8; + color: #383838 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #b8b8b8 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #b8b8b8 +} +/* base04 - #585858 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #585858 +} +/* base05 - #383838 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #383838 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #ab4642 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #dc9656 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f79a0e +} +.hljs-strong { + font-weight: bold; + color: #f79a0e +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #538947 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #4b8093 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #7cafc2 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #96609e +} +.hljs-emphasis { + color: #96609e; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #a16946 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/mexico-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/mexico-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..13747e5891f8d777779c95911bca4350aee827f8 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/mexico-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Mexico Light + Author: Sheldon Johnson + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383838;background:#f8f8f8}.hljs ::selection,.hljs::selection{background-color:#d8d8d8;color:#383838}.hljs-comment{color:#b8b8b8}.hljs-tag{color:#585858}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#383838}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ab4642}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#dc9656}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f79a0e}.hljs-strong{font-weight:700;color:#f79a0e}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#538947}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#4b8093}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#7cafc2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#96609e}.hljs-emphasis{color:#96609e;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a16946}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/mocha.css b/tools/ui/node_modules/highlight.js/styles/base16/mocha.css new file mode 100644 index 0000000000000000000000000000000000000000..908f3bbeb579c2c0018e5441ea40697abe710751 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/mocha.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Mocha + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme mocha + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #3B3228 Default Background +base01 #534636 Lighter Background (Used for status bars, line number and folding marks) +base02 #645240 Selection Background +base03 #7e705a Comments, Invisibles, Line Highlighting +base04 #b8afad Dark Foreground (Used for status bars) +base05 #d0c8c6 Default Foreground, Caret, Delimiters, Operators +base06 #e9e1dd Light Foreground (Not often used) +base07 #f5eeeb Light Background (Not often used) +base08 #cb6077 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d28b71 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f4bc87 Classes, Markup Bold, Search Text Background +base0B #beb55b Strings, Inherited Class, Markup Code, Diff Inserted +base0C #7bbda4 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #8ab3b5 Functions, Methods, Attribute IDs, Headings +base0E #a89bb9 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #bb9584 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #d0c8c6; + background: #3B3228 +} +.hljs::selection, +.hljs ::selection { + background-color: #645240; + color: #d0c8c6 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #7e705a - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #7e705a +} +/* base04 - #b8afad - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b8afad +} +/* base05 - #d0c8c6 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #d0c8c6 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #cb6077 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d28b71 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f4bc87 +} +.hljs-strong { + font-weight: bold; + color: #f4bc87 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #beb55b +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #7bbda4 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #8ab3b5 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #a89bb9 +} +.hljs-emphasis { + color: #a89bb9; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #bb9584 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/mocha.min.css b/tools/ui/node_modules/highlight.js/styles/base16/mocha.min.css new file mode 100644 index 0000000000000000000000000000000000000000..bc1f3bf2ded4bd6471d10b4a3d8a298cd8fa9165 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/mocha.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Mocha + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#d0c8c6;background:#3b3228}.hljs ::selection,.hljs::selection{background-color:#645240;color:#d0c8c6}.hljs-comment{color:#7e705a}.hljs-tag{color:#b8afad}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#d0c8c6}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#cb6077}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d28b71}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f4bc87}.hljs-strong{font-weight:700;color:#f4bc87}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#beb55b}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#7bbda4}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#8ab3b5}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#a89bb9}.hljs-emphasis{color:#a89bb9;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#bb9584}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/monokai.css b/tools/ui/node_modules/highlight.js/styles/base16/monokai.css new file mode 100644 index 0000000000000000000000000000000000000000..097ce34e2d81b3d6fdcc49963f4ef7932e9558f3 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/monokai.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Monokai + Author: Wimer Hazenberg (http://www.monokai.nl) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme monokai + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #272822 Default Background +base01 #383830 Lighter Background (Used for status bars, line number and folding marks) +base02 #49483e Selection Background +base03 #75715e Comments, Invisibles, Line Highlighting +base04 #a59f85 Dark Foreground (Used for status bars) +base05 #f8f8f2 Default Foreground, Caret, Delimiters, Operators +base06 #f5f4f1 Light Foreground (Not often used) +base07 #f9f8f5 Light Background (Not often used) +base08 #f92672 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #fd971f Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f4bf75 Classes, Markup Bold, Search Text Background +base0B #a6e22e Strings, Inherited Class, Markup Code, Diff Inserted +base0C #a1efe4 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #66d9ef Functions, Methods, Attribute IDs, Headings +base0E #ae81ff Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #cc6633 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #f8f8f2; + background: #272822 +} +.hljs::selection, +.hljs ::selection { + background-color: #49483e; + color: #f8f8f2 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #75715e - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #75715e +} +/* base04 - #a59f85 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a59f85 +} +/* base05 - #f8f8f2 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #f8f8f2 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #f92672 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #fd971f +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f4bf75 +} +.hljs-strong { + font-weight: bold; + color: #f4bf75 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #a6e22e +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #a1efe4 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #66d9ef +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #ae81ff +} +.hljs-emphasis { + color: #ae81ff; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #cc6633 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/monokai.min.css b/tools/ui/node_modules/highlight.js/styles/base16/monokai.min.css new file mode 100644 index 0000000000000000000000000000000000000000..8aacf006aa16275247228f620f7cf6ae1bc49714 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/monokai.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Monokai + Author: Wimer Hazenberg (http://www.monokai.nl) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#f8f8f2;background:#272822}.hljs ::selection,.hljs::selection{background-color:#49483e;color:#f8f8f2}.hljs-comment{color:#75715e}.hljs-tag{color:#a59f85}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#f8f8f2}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f92672}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fd971f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f4bf75}.hljs-strong{font-weight:700;color:#f4bf75}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#a6e22e}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#a1efe4}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#66d9ef}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ae81ff}.hljs-emphasis{color:#ae81ff;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c63}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/nebula.css b/tools/ui/node_modules/highlight.js/styles/base16/nebula.css new file mode 100644 index 0000000000000000000000000000000000000000..eb04d2b8cbc162ccfe986a32da6562b296e9ed8b --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/nebula.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Nebula + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme nebula + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #22273b Default Background +base01 #414f60 Lighter Background (Used for status bars, line number and folding marks) +base02 #5a8380 Selection Background +base03 #6e6f72 Comments, Invisibles, Line Highlighting +base04 #87888b Dark Foreground (Used for status bars) +base05 #a4a6a9 Default Foreground, Caret, Delimiters, Operators +base06 #c7c9cd Light Foreground (Not often used) +base07 #8dbdaa Light Background (Not often used) +base08 #777abc Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #94929e Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #4f9062 Classes, Markup Bold, Search Text Background +base0B #6562a8 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #226f68 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #4d6bb6 Functions, Methods, Attribute IDs, Headings +base0E #716cae Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #8c70a7 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #a4a6a9; + background: #22273b +} +.hljs::selection, +.hljs ::selection { + background-color: #5a8380; + color: #a4a6a9 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #6e6f72 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #6e6f72 +} +/* base04 - #87888b - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #87888b +} +/* base05 - #a4a6a9 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #a4a6a9 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #777abc +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #94929e +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #4f9062 +} +.hljs-strong { + font-weight: bold; + color: #4f9062 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #6562a8 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #226f68 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #4d6bb6 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #716cae +} +.hljs-emphasis { + color: #716cae; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #8c70a7 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/nebula.min.css b/tools/ui/node_modules/highlight.js/styles/base16/nebula.min.css new file mode 100644 index 0000000000000000000000000000000000000000..17de036990d9ac5ae60f6cdc7c10d850d9eaf308 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/nebula.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Nebula + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#a4a6a9;background:#22273b}.hljs ::selection,.hljs::selection{background-color:#5a8380;color:#a4a6a9}.hljs-comment{color:#6e6f72}.hljs-tag{color:#87888b}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#a4a6a9}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#777abc}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#94929e}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#4f9062}.hljs-strong{font-weight:700;color:#4f9062}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#6562a8}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#226f68}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4d6bb6}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#716cae}.hljs-emphasis{color:#716cae;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#8c70a7}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/nord.css b/tools/ui/node_modules/highlight.js/styles/base16/nord.css new file mode 100644 index 0000000000000000000000000000000000000000..6227706fe95ca9acacb2fcae3bb9292a89c70f6a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/nord.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Nord + Author: arcticicestudio + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme nord + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #2E3440 Default Background +base01 #3B4252 Lighter Background (Used for status bars, line number and folding marks) +base02 #434C5E Selection Background +base03 #4C566A Comments, Invisibles, Line Highlighting +base04 #D8DEE9 Dark Foreground (Used for status bars) +base05 #E5E9F0 Default Foreground, Caret, Delimiters, Operators +base06 #ECEFF4 Light Foreground (Not often used) +base07 #8FBCBB Light Background (Not often used) +base08 #BF616A Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #D08770 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #EBCB8B Classes, Markup Bold, Search Text Background +base0B #A3BE8C Strings, Inherited Class, Markup Code, Diff Inserted +base0C #88C0D0 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #81A1C1 Functions, Methods, Attribute IDs, Headings +base0E #B48EAD Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #5E81AC Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #E5E9F0; + background: #2E3440 +} +.hljs::selection, +.hljs ::selection { + background-color: #434C5E; + color: #E5E9F0 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #4C566A - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #4C566A +} +/* base04 - #D8DEE9 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #D8DEE9 +} +/* base05 - #E5E9F0 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #E5E9F0 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #BF616A +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #D08770 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #EBCB8B +} +.hljs-strong { + font-weight: bold; + color: #EBCB8B +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #A3BE8C +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #88C0D0 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #81A1C1 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #B48EAD +} +.hljs-emphasis { + color: #B48EAD; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #5E81AC +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/nord.min.css b/tools/ui/node_modules/highlight.js/styles/base16/nord.min.css new file mode 100644 index 0000000000000000000000000000000000000000..508ae8557dba48f069a40336604376f717045179 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/nord.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Nord + Author: arcticicestudio + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e5e9f0;background:#2e3440}.hljs ::selection,.hljs::selection{background-color:#434c5e;color:#e5e9f0}.hljs-comment{color:#4c566a}.hljs-tag{color:#d8dee9}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#e5e9f0}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#bf616a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d08770}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ebcb8b}.hljs-strong{font-weight:700;color:#ebcb8b}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#a3be8c}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#88c0d0}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#81a1c1}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b48ead}.hljs-emphasis{color:#b48ead;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#5e81ac}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/nova.css b/tools/ui/node_modules/highlight.js/styles/base16/nova.css new file mode 100644 index 0000000000000000000000000000000000000000..3343e9faf993e0fa1aace9aa672532b0a29c3bfc --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/nova.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Nova + Author: George Essig (https://github.com/gessig), Trevor D. Miller (https://trevordmiller.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme nova + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #3C4C55 Default Background +base01 #556873 Lighter Background (Used for status bars, line number and folding marks) +base02 #6A7D89 Selection Background +base03 #899BA6 Comments, Invisibles, Line Highlighting +base04 #899BA6 Dark Foreground (Used for status bars) +base05 #C5D4DD Default Foreground, Caret, Delimiters, Operators +base06 #899BA6 Light Foreground (Not often used) +base07 #556873 Light Background (Not often used) +base08 #83AFE5 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #7FC1CA Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #A8CE93 Classes, Markup Bold, Search Text Background +base0B #7FC1CA Strings, Inherited Class, Markup Code, Diff Inserted +base0C #F2C38F Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #83AFE5 Functions, Methods, Attribute IDs, Headings +base0E #9A93E1 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #F2C38F Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #C5D4DD; + background: #3C4C55 +} +.hljs::selection, +.hljs ::selection { + background-color: #6A7D89; + color: #C5D4DD +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #899BA6 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #899BA6 +} +/* base04 - #899BA6 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #899BA6 +} +/* base05 - #C5D4DD - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #C5D4DD +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #83AFE5 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #7FC1CA +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #A8CE93 +} +.hljs-strong { + font-weight: bold; + color: #A8CE93 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #7FC1CA +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #F2C38F +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #83AFE5 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #9A93E1 +} +.hljs-emphasis { + color: #9A93E1; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #F2C38F +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/nova.min.css b/tools/ui/node_modules/highlight.js/styles/base16/nova.min.css new file mode 100644 index 0000000000000000000000000000000000000000..5b9a4082e6740d62a44e8099cec197a072118617 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/nova.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Nova + Author: George Essig (https://github.com/gessig), Trevor D. Miller (https://trevordmiller.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c5d4dd;background:#3c4c55}.hljs ::selection,.hljs::selection{background-color:#6a7d89;color:#c5d4dd}.hljs-comment,.hljs-tag{color:#899ba6}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#c5d4dd}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#83afe5}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#7fc1ca}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#a8ce93}.hljs-strong{font-weight:700;color:#a8ce93}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#7fc1ca}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#f2c38f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#83afe5}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#9a93e1}.hljs-emphasis{color:#9a93e1;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#f2c38f}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ocean.css b/tools/ui/node_modules/highlight.js/styles/base16/ocean.css new file mode 100644 index 0000000000000000000000000000000000000000..5ed9f6c2f20556ccf8a4edf2f6ac6d2ebe8f2a39 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ocean.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Ocean + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme ocean + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #2b303b Default Background +base01 #343d46 Lighter Background (Used for status bars, line number and folding marks) +base02 #4f5b66 Selection Background +base03 #65737e Comments, Invisibles, Line Highlighting +base04 #a7adba Dark Foreground (Used for status bars) +base05 #c0c5ce Default Foreground, Caret, Delimiters, Operators +base06 #dfe1e8 Light Foreground (Not often used) +base07 #eff1f5 Light Background (Not often used) +base08 #bf616a Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d08770 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ebcb8b Classes, Markup Bold, Search Text Background +base0B #a3be8c Strings, Inherited Class, Markup Code, Diff Inserted +base0C #96b5b4 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #8fa1b3 Functions, Methods, Attribute IDs, Headings +base0E #b48ead Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #ab7967 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #c0c5ce; + background: #2b303b +} +.hljs::selection, +.hljs ::selection { + background-color: #4f5b66; + color: #c0c5ce +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #65737e - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #65737e +} +/* base04 - #a7adba - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a7adba +} +/* base05 - #c0c5ce - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #c0c5ce +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #bf616a +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d08770 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ebcb8b +} +.hljs-strong { + font-weight: bold; + color: #ebcb8b +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #a3be8c +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #96b5b4 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #8fa1b3 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #b48ead +} +.hljs-emphasis { + color: #b48ead; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #ab7967 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ocean.min.css b/tools/ui/node_modules/highlight.js/styles/base16/ocean.min.css new file mode 100644 index 0000000000000000000000000000000000000000..9127e53c1d900e409e9e21d1578816589b6ae769 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ocean.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Ocean + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c0c5ce;background:#2b303b}.hljs ::selection,.hljs::selection{background-color:#4f5b66;color:#c0c5ce}.hljs-comment{color:#65737e}.hljs-tag{color:#a7adba}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#c0c5ce}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#bf616a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d08770}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ebcb8b}.hljs-strong{font-weight:700;color:#ebcb8b}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#a3be8c}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#96b5b4}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#8fa1b3}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b48ead}.hljs-emphasis{color:#b48ead;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#ab7967}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/oceanicnext.css b/tools/ui/node_modules/highlight.js/styles/base16/oceanicnext.css new file mode 100644 index 0000000000000000000000000000000000000000..a2f821454de7dc33d8b2a1b3bbbbac5fdfc2776b --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/oceanicnext.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: OceanicNext + Author: https://github.com/voronianski/oceanic-next-color-scheme + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme oceanicnext + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #1B2B34 Default Background +base01 #343D46 Lighter Background (Used for status bars, line number and folding marks) +base02 #4F5B66 Selection Background +base03 #65737E Comments, Invisibles, Line Highlighting +base04 #A7ADBA Dark Foreground (Used for status bars) +base05 #C0C5CE Default Foreground, Caret, Delimiters, Operators +base06 #CDD3DE Light Foreground (Not often used) +base07 #D8DEE9 Light Background (Not often used) +base08 #EC5f67 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #F99157 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #FAC863 Classes, Markup Bold, Search Text Background +base0B #99C794 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #5FB3B3 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #6699CC Functions, Methods, Attribute IDs, Headings +base0E #C594C5 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #AB7967 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #C0C5CE; + background: #1B2B34 +} +.hljs::selection, +.hljs ::selection { + background-color: #4F5B66; + color: #C0C5CE +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #65737E - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #65737E +} +/* base04 - #A7ADBA - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #A7ADBA +} +/* base05 - #C0C5CE - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #C0C5CE +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #EC5f67 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #F99157 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #FAC863 +} +.hljs-strong { + font-weight: bold; + color: #FAC863 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #99C794 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #5FB3B3 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #6699CC +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #C594C5 +} +.hljs-emphasis { + color: #C594C5; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #AB7967 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/oceanicnext.min.css b/tools/ui/node_modules/highlight.js/styles/base16/oceanicnext.min.css new file mode 100644 index 0000000000000000000000000000000000000000..627c14b33100296c78bc65967c383f2d33e0c0fe --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/oceanicnext.min.css @@ -0,0 +1,7 @@ +/*! + Theme: OceanicNext + Author: https://github.com/voronianski/oceanic-next-color-scheme + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c0c5ce;background:#1b2b34}.hljs ::selection,.hljs::selection{background-color:#4f5b66;color:#c0c5ce}.hljs-comment{color:#65737e}.hljs-tag{color:#a7adba}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#c0c5ce}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ec5f67}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fac863}.hljs-strong{font-weight:700;color:#fac863}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#99c794}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#5fb3b3}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c594c5}.hljs-emphasis{color:#c594c5;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#ab7967}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/one-light.css b/tools/ui/node_modules/highlight.js/styles/base16/one-light.css new file mode 100644 index 0000000000000000000000000000000000000000..a7241d0dd0c98438a87455f0faff92eefd9bc967 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/one-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: One Light + Author: Daniel Pfeifer (http://github.com/purpleKarrot) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme one-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #fafafa Default Background +base01 #f0f0f1 Lighter Background (Used for status bars, line number and folding marks) +base02 #e5e5e6 Selection Background +base03 #a0a1a7 Comments, Invisibles, Line Highlighting +base04 #696c77 Dark Foreground (Used for status bars) +base05 #383a42 Default Foreground, Caret, Delimiters, Operators +base06 #202227 Light Foreground (Not often used) +base07 #090a0b Light Background (Not often used) +base08 #ca1243 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d75f00 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #c18401 Classes, Markup Bold, Search Text Background +base0B #50a14f Strings, Inherited Class, Markup Code, Diff Inserted +base0C #0184bc Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #4078f2 Functions, Methods, Attribute IDs, Headings +base0E #a626a4 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #986801 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #383a42; + background: #fafafa +} +.hljs::selection, +.hljs ::selection { + background-color: #e5e5e6; + color: #383a42 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #a0a1a7 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #a0a1a7 +} +/* base04 - #696c77 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #696c77 +} +/* base05 - #383a42 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #383a42 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #ca1243 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d75f00 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #c18401 +} +.hljs-strong { + font-weight: bold; + color: #c18401 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #50a14f +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #0184bc +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #4078f2 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #a626a4 +} +.hljs-emphasis { + color: #a626a4; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #986801 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/one-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/one-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..63f57cb94409abb403b7626b2d855b83da79a7de --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/one-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: One Light + Author: Daniel Pfeifer (http://github.com/purpleKarrot) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383a42;background:#fafafa}.hljs ::selection,.hljs::selection{background-color:#e5e5e6;color:#383a42}.hljs-comment{color:#a0a1a7}.hljs-tag{color:#696c77}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#383a42}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ca1243}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d75f00}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#c18401}.hljs-strong{font-weight:700;color:#c18401}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#50a14f}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#0184bc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4078f2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#a626a4}.hljs-emphasis{color:#a626a4;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#986801}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/onedark.css b/tools/ui/node_modules/highlight.js/styles/base16/onedark.css new file mode 100644 index 0000000000000000000000000000000000000000..58a8a165989c01a1534483fb4210208ed3631c51 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/onedark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: OneDark + Author: Lalit Magant (http://github.com/tilal6991) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme onedark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #282c34 Default Background +base01 #353b45 Lighter Background (Used for status bars, line number and folding marks) +base02 #3e4451 Selection Background +base03 #545862 Comments, Invisibles, Line Highlighting +base04 #565c64 Dark Foreground (Used for status bars) +base05 #abb2bf Default Foreground, Caret, Delimiters, Operators +base06 #b6bdca Light Foreground (Not often used) +base07 #c8ccd4 Light Background (Not often used) +base08 #e06c75 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d19a66 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #e5c07b Classes, Markup Bold, Search Text Background +base0B #98c379 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #56b6c2 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #61afef Functions, Methods, Attribute IDs, Headings +base0E #c678dd Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #be5046 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #abb2bf; + background: #282c34 +} +.hljs::selection, +.hljs ::selection { + background-color: #3e4451; + color: #abb2bf +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #545862 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #545862 +} +/* base04 - #565c64 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #565c64 +} +/* base05 - #abb2bf - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #abb2bf +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #e06c75 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d19a66 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #e5c07b +} +.hljs-strong { + font-weight: bold; + color: #e5c07b +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #98c379 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #56b6c2 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #61afef +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #c678dd +} +.hljs-emphasis { + color: #c678dd; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #be5046 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/onedark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/onedark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..1b8c6b7bc26c2ab8d3cd538306f3df8fbcc717bd --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/onedark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: OneDark + Author: Lalit Magant (http://github.com/tilal6991) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#abb2bf;background:#282c34}.hljs ::selection,.hljs::selection{background-color:#3e4451;color:#abb2bf}.hljs-comment{color:#545862}.hljs-tag{color:#565c64}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#abb2bf}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#e06c75}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d19a66}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#e5c07b}.hljs-strong{font-weight:700;color:#e5c07b}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#98c379}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#56b6c2}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#61afef}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c678dd}.hljs-emphasis{color:#c678dd;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#be5046}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/outrun-dark.css b/tools/ui/node_modules/highlight.js/styles/base16/outrun-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..ab941efd69c4caefd482c64169e616efaf951627 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/outrun-dark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Outrun Dark + Author: Hugo Delahousse (http://github.com/hugodelahousse/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme outrun-dark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #00002A Default Background +base01 #20204A Lighter Background (Used for status bars, line number and folding marks) +base02 #30305A Selection Background +base03 #50507A Comments, Invisibles, Line Highlighting +base04 #B0B0DA Dark Foreground (Used for status bars) +base05 #D0D0FA Default Foreground, Caret, Delimiters, Operators +base06 #E0E0FF Light Foreground (Not often used) +base07 #F5F5FF Light Background (Not often used) +base08 #FF4242 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #FC8D28 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #F3E877 Classes, Markup Bold, Search Text Background +base0B #59F176 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #0EF0F0 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #66B0FF Functions, Methods, Attribute IDs, Headings +base0E #F10596 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #F003EF Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #D0D0FA; + background: #00002A +} +.hljs::selection, +.hljs ::selection { + background-color: #30305A; + color: #D0D0FA +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #50507A - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #50507A +} +/* base04 - #B0B0DA - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #B0B0DA +} +/* base05 - #D0D0FA - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #D0D0FA +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #FF4242 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #FC8D28 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #F3E877 +} +.hljs-strong { + font-weight: bold; + color: #F3E877 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #59F176 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #0EF0F0 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #66B0FF +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #F10596 +} +.hljs-emphasis { + color: #F10596; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #F003EF +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/outrun-dark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/outrun-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..22995a10fd65b8f435dd787d64a349f03f831c00 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/outrun-dark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Outrun Dark + Author: Hugo Delahousse (http://github.com/hugodelahousse/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#d0d0fa;background:#00002a}.hljs ::selection,.hljs::selection{background-color:#30305a;color:#d0d0fa}.hljs-comment{color:#50507a}.hljs-tag{color:#b0b0da}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#d0d0fa}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ff4242}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fc8d28}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f3e877}.hljs-strong{font-weight:700;color:#f3e877}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#59f176}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#0ef0f0}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#66b0ff}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#f10596}.hljs-emphasis{color:#f10596;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#f003ef}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/papercolor-dark.css b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..3b84413355d73f9b71cb4c31c25e244683a98b3d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-dark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: PaperColor Dark + Author: Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme papercolor-dark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #1c1c1c Default Background +base01 #af005f Lighter Background (Used for status bars, line number and folding marks) +base02 #5faf00 Selection Background +base03 #d7af5f Comments, Invisibles, Line Highlighting +base04 #5fafd7 Dark Foreground (Used for status bars) +base05 #808080 Default Foreground, Caret, Delimiters, Operators +base06 #d7875f Light Foreground (Not often used) +base07 #d0d0d0 Light Background (Not often used) +base08 #585858 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #5faf5f Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #afd700 Classes, Markup Bold, Search Text Background +base0B #af87d7 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #ffaf00 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #ff5faf Functions, Methods, Attribute IDs, Headings +base0E #00afaf Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #5f8787 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #808080; + background: #1c1c1c +} +.hljs::selection, +.hljs ::selection { + background-color: #5faf00; + color: #808080 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #d7af5f - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #d7af5f +} +/* base04 - #5fafd7 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #5fafd7 +} +/* base05 - #808080 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #808080 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #585858 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #5faf5f +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #afd700 +} +.hljs-strong { + font-weight: bold; + color: #afd700 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #af87d7 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #ffaf00 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #ff5faf +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #00afaf +} +.hljs-emphasis { + color: #00afaf; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #5f8787 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/papercolor-dark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c35d7c7e676da788301fee71bc60583207c91051 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-dark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: PaperColor Dark + Author: Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:grey;background:#1c1c1c}.hljs ::selection,.hljs::selection{background-color:#5faf00;color:grey}.hljs-comment{color:#d7af5f}.hljs-tag{color:#5fafd7}.hljs-operator,.hljs-punctuation,.hljs-subst{color:grey}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#585858}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#5faf5f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#afd700}.hljs-strong{font-weight:700;color:#afd700}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#af87d7}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#ffaf00}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#ff5faf}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#00afaf}.hljs-emphasis{color:#00afaf;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#5f8787}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/papercolor-light.css b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-light.css new file mode 100644 index 0000000000000000000000000000000000000000..6fe0125e97e42cf740d087f6c682bb71335012fd --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: PaperColor Light + Author: Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme papercolor-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #eeeeee Default Background +base01 #af0000 Lighter Background (Used for status bars, line number and folding marks) +base02 #008700 Selection Background +base03 #5f8700 Comments, Invisibles, Line Highlighting +base04 #0087af Dark Foreground (Used for status bars) +base05 #444444 Default Foreground, Caret, Delimiters, Operators +base06 #005f87 Light Foreground (Not often used) +base07 #878787 Light Background (Not often used) +base08 #bcbcbc Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d70000 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #d70087 Classes, Markup Bold, Search Text Background +base0B #8700af Strings, Inherited Class, Markup Code, Diff Inserted +base0C #d75f00 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #d75f00 Functions, Methods, Attribute IDs, Headings +base0E #005faf Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #005f87 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #444444; + background: #eeeeee +} +.hljs::selection, +.hljs ::selection { + background-color: #008700; + color: #444444 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #5f8700 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #5f8700 +} +/* base04 - #0087af - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #0087af +} +/* base05 - #444444 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #444444 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #bcbcbc +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d70000 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #d70087 +} +.hljs-strong { + font-weight: bold; + color: #d70087 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #8700af +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #d75f00 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #d75f00 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #005faf +} +.hljs-emphasis { + color: #005faf; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #005f87 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/papercolor-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e23b616cec3bf278f3539b959621265d6af8d65f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/papercolor-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: PaperColor Light + Author: Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#444;background:#eee}.hljs ::selection,.hljs::selection{background-color:#008700;color:#444}.hljs-comment{color:#5f8700}.hljs-tag{color:#0087af}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#444}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#bcbcbc}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d70000}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#d70087}.hljs-strong{font-weight:700;color:#d70087}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#8700af}.hljs-attribute,.hljs-built_in,.hljs-doctag,.hljs-function .hljs-title,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#d75f00}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#005faf}.hljs-emphasis{color:#005faf;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#005f87}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/paraiso.css b/tools/ui/node_modules/highlight.js/styles/base16/paraiso.css new file mode 100644 index 0000000000000000000000000000000000000000..962104eb1d8b6c868427c75c5ab60b94517078cb --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/paraiso.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Paraiso + Author: Jan T. Sott + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme paraiso + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #2f1e2e Default Background +base01 #41323f Lighter Background (Used for status bars, line number and folding marks) +base02 #4f424c Selection Background +base03 #776e71 Comments, Invisibles, Line Highlighting +base04 #8d8687 Dark Foreground (Used for status bars) +base05 #a39e9b Default Foreground, Caret, Delimiters, Operators +base06 #b9b6b0 Light Foreground (Not often used) +base07 #e7e9db Light Background (Not often used) +base08 #ef6155 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #f99b15 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #fec418 Classes, Markup Bold, Search Text Background +base0B #48b685 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #5bc4bf Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #06b6ef Functions, Methods, Attribute IDs, Headings +base0E #815ba4 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #e96ba8 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #a39e9b; + background: #2f1e2e +} +.hljs::selection, +.hljs ::selection { + background-color: #4f424c; + color: #a39e9b +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #776e71 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #776e71 +} +/* base04 - #8d8687 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #8d8687 +} +/* base05 - #a39e9b - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #a39e9b +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #ef6155 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #f99b15 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #fec418 +} +.hljs-strong { + font-weight: bold; + color: #fec418 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #48b685 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #5bc4bf +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #06b6ef +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #815ba4 +} +.hljs-emphasis { + color: #815ba4; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #e96ba8 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/paraiso.min.css b/tools/ui/node_modules/highlight.js/styles/base16/paraiso.min.css new file mode 100644 index 0000000000000000000000000000000000000000..135fcd266912836f3adc931cf54460d709fb3954 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/paraiso.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Paraiso + Author: Jan T. Sott + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#a39e9b;background:#2f1e2e}.hljs ::selection,.hljs::selection{background-color:#4f424c;color:#a39e9b}.hljs-comment{color:#776e71}.hljs-tag{color:#8d8687}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#a39e9b}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ef6155}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99b15}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fec418}.hljs-strong{font-weight:700;color:#fec418}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#48b685}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#5bc4bf}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#06b6ef}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#815ba4}.hljs-emphasis{color:#815ba4;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#e96ba8}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/pasque.css b/tools/ui/node_modules/highlight.js/styles/base16/pasque.css new file mode 100644 index 0000000000000000000000000000000000000000..92f5c188e1c2e982cf27bc7b0f54ad7bf6285e60 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/pasque.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Pasque + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme pasque + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #271C3A Default Background +base01 #100323 Lighter Background (Used for status bars, line number and folding marks) +base02 #3E2D5C Selection Background +base03 #5D5766 Comments, Invisibles, Line Highlighting +base04 #BEBCBF Dark Foreground (Used for status bars) +base05 #DEDCDF Default Foreground, Caret, Delimiters, Operators +base06 #EDEAEF Light Foreground (Not often used) +base07 #BBAADD Light Background (Not often used) +base08 #A92258 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #918889 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #804ead Classes, Markup Bold, Search Text Background +base0B #C6914B Strings, Inherited Class, Markup Code, Diff Inserted +base0C #7263AA Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #8E7DC6 Functions, Methods, Attribute IDs, Headings +base0E #953B9D Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #59325C Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #DEDCDF; + background: #271C3A +} +.hljs::selection, +.hljs ::selection { + background-color: #3E2D5C; + color: #DEDCDF +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #5D5766 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #5D5766 +} +/* base04 - #BEBCBF - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #BEBCBF +} +/* base05 - #DEDCDF - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #DEDCDF +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #A92258 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #918889 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #804ead +} +.hljs-strong { + font-weight: bold; + color: #804ead +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #C6914B +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #7263AA +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #8E7DC6 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #953B9D +} +.hljs-emphasis { + color: #953B9D; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #59325C +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/pasque.min.css b/tools/ui/node_modules/highlight.js/styles/base16/pasque.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e4c26729fbceb7e18547a1698731d083922c4929 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/pasque.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Pasque + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#dedcdf;background:#271c3a}.hljs ::selection,.hljs::selection{background-color:#3e2d5c;color:#dedcdf}.hljs-comment{color:#5d5766}.hljs-tag{color:#bebcbf}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#dedcdf}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#a92258}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#918889}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#804ead}.hljs-strong{font-weight:700;color:#804ead}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#c6914b}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#7263aa}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#8e7dc6}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#953b9d}.hljs-emphasis{color:#953b9d;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#59325c}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/phd.css b/tools/ui/node_modules/highlight.js/styles/base16/phd.css new file mode 100644 index 0000000000000000000000000000000000000000..4bcdde936ddfeb823ea949485144ebbef1bcfc38 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/phd.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: PhD + Author: Hennig Hasemann (http://leetless.de/vim.html) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme phd + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #061229 Default Background +base01 #2a3448 Lighter Background (Used for status bars, line number and folding marks) +base02 #4d5666 Selection Background +base03 #717885 Comments, Invisibles, Line Highlighting +base04 #9a99a3 Dark Foreground (Used for status bars) +base05 #b8bbc2 Default Foreground, Caret, Delimiters, Operators +base06 #dbdde0 Light Foreground (Not often used) +base07 #ffffff Light Background (Not often used) +base08 #d07346 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #f0a000 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #fbd461 Classes, Markup Bold, Search Text Background +base0B #99bf52 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #72b9bf Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #5299bf Functions, Methods, Attribute IDs, Headings +base0E #9989cc Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #b08060 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #b8bbc2; + background: #061229 +} +.hljs::selection, +.hljs ::selection { + background-color: #4d5666; + color: #b8bbc2 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #717885 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #717885 +} +/* base04 - #9a99a3 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #9a99a3 +} +/* base05 - #b8bbc2 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #b8bbc2 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #d07346 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #f0a000 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #fbd461 +} +.hljs-strong { + font-weight: bold; + color: #fbd461 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #99bf52 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #72b9bf +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #5299bf +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #9989cc +} +.hljs-emphasis { + color: #9989cc; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #b08060 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/phd.min.css b/tools/ui/node_modules/highlight.js/styles/base16/phd.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b5f9feaa6f1becb86e56936a03ad9904889cd156 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/phd.min.css @@ -0,0 +1,7 @@ +/*! + Theme: PhD + Author: Hennig Hasemann (http://leetless.de/vim.html) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#b8bbc2;background:#061229}.hljs ::selection,.hljs::selection{background-color:#4d5666;color:#b8bbc2}.hljs-comment{color:#717885}.hljs-tag{color:#9a99a3}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#b8bbc2}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#d07346}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f0a000}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fbd461}.hljs-strong{font-weight:700;color:#fbd461}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#99bf52}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#72b9bf}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#5299bf}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#9989cc}.hljs-emphasis{color:#9989cc;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#b08060}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/pico.css b/tools/ui/node_modules/highlight.js/styles/base16/pico.css new file mode 100644 index 0000000000000000000000000000000000000000..42aec9d77a2020c88ec72919e0e56845f74e3a67 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/pico.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Pico + Author: PICO-8 (http://www.lexaloffle.com/pico-8.php) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme pico + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #000000 Default Background +base01 #1d2b53 Lighter Background (Used for status bars, line number and folding marks) +base02 #7e2553 Selection Background +base03 #008751 Comments, Invisibles, Line Highlighting +base04 #ab5236 Dark Foreground (Used for status bars) +base05 #5f574f Default Foreground, Caret, Delimiters, Operators +base06 #c2c3c7 Light Foreground (Not often used) +base07 #fff1e8 Light Background (Not often used) +base08 #ff004d Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ffa300 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #fff024 Classes, Markup Bold, Search Text Background +base0B #00e756 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #29adff Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #83769c Functions, Methods, Attribute IDs, Headings +base0E #ff77a8 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #ffccaa Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #5f574f; + background: #000000 +} +.hljs::selection, +.hljs ::selection { + background-color: #7e2553; + color: #5f574f +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #008751 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #008751 +} +/* base04 - #ab5236 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #ab5236 +} +/* base05 - #5f574f - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #5f574f +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #ff004d +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ffa300 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #fff024 +} +.hljs-strong { + font-weight: bold; + color: #fff024 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #00e756 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #29adff +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #83769c +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #ff77a8 +} +.hljs-emphasis { + color: #ff77a8; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #ffccaa +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/pico.min.css b/tools/ui/node_modules/highlight.js/styles/base16/pico.min.css new file mode 100644 index 0000000000000000000000000000000000000000..37659987ae9bb47f64c04c7f8f47273a0b7cc712 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/pico.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Pico + Author: PICO-8 (http://www.lexaloffle.com/pico-8.php) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#5f574f;background:#000}.hljs ::selection,.hljs::selection{background-color:#7e2553;color:#5f574f}.hljs-comment{color:#008751}.hljs-tag{color:#ab5236}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#5f574f}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ff004d}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ffa300}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fff024}.hljs-strong{font-weight:700;color:#fff024}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#00e756}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#29adff}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#83769c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ff77a8}.hljs-emphasis{color:#ff77a8;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#fca}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/pop.css b/tools/ui/node_modules/highlight.js/styles/base16/pop.css new file mode 100644 index 0000000000000000000000000000000000000000..d8b2cb7dd29d50b3009fdbe9854d9c8b2948b691 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/pop.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Pop + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme pop + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #000000 Default Background +base01 #202020 Lighter Background (Used for status bars, line number and folding marks) +base02 #303030 Selection Background +base03 #505050 Comments, Invisibles, Line Highlighting +base04 #b0b0b0 Dark Foreground (Used for status bars) +base05 #d0d0d0 Default Foreground, Caret, Delimiters, Operators +base06 #e0e0e0 Light Foreground (Not often used) +base07 #ffffff Light Background (Not often used) +base08 #eb008a Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #f29333 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f8ca12 Classes, Markup Bold, Search Text Background +base0B #37b349 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #00aabb Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #0e5a94 Functions, Methods, Attribute IDs, Headings +base0E #b31e8d Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #7a2d00 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #d0d0d0; + background: #000000 +} +.hljs::selection, +.hljs ::selection { + background-color: #303030; + color: #d0d0d0 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #505050 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #505050 +} +/* base04 - #b0b0b0 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b0b0b0 +} +/* base05 - #d0d0d0 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #d0d0d0 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #eb008a +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #f29333 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f8ca12 +} +.hljs-strong { + font-weight: bold; + color: #f8ca12 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #37b349 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #00aabb +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #0e5a94 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #b31e8d +} +.hljs-emphasis { + color: #b31e8d; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #7a2d00 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/pop.min.css b/tools/ui/node_modules/highlight.js/styles/base16/pop.min.css new file mode 100644 index 0000000000000000000000000000000000000000..22b488ac78858128c3fa73bcf2f8ff8bf622a04b --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/pop.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Pop + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#d0d0d0;background:#000}.hljs ::selection,.hljs::selection{background-color:#303030;color:#d0d0d0}.hljs-comment{color:#505050}.hljs-tag{color:#b0b0b0}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#d0d0d0}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#eb008a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f29333}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f8ca12}.hljs-strong{font-weight:700;color:#f8ca12}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#37b349}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#0ab}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#0e5a94}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b31e8d}.hljs-emphasis{color:#b31e8d;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#7a2d00}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/porple.css b/tools/ui/node_modules/highlight.js/styles/base16/porple.css new file mode 100644 index 0000000000000000000000000000000000000000..59d319c5d84d1fed108060cde0caa0a2daa7054a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/porple.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Porple + Author: Niek den Breeje (https://github.com/AuditeMarlow) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme porple + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #292c36 Default Background +base01 #333344 Lighter Background (Used for status bars, line number and folding marks) +base02 #474160 Selection Background +base03 #65568a Comments, Invisibles, Line Highlighting +base04 #b8b8b8 Dark Foreground (Used for status bars) +base05 #d8d8d8 Default Foreground, Caret, Delimiters, Operators +base06 #e8e8e8 Light Foreground (Not often used) +base07 #f8f8f8 Light Background (Not often used) +base08 #f84547 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d28e5d Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #efa16b Classes, Markup Bold, Search Text Background +base0B #95c76f Strings, Inherited Class, Markup Code, Diff Inserted +base0C #64878f Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #8485ce Functions, Methods, Attribute IDs, Headings +base0E #b74989 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #986841 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #d8d8d8; + background: #292c36 +} +.hljs::selection, +.hljs ::selection { + background-color: #474160; + color: #d8d8d8 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #65568a - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #65568a +} +/* base04 - #b8b8b8 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b8b8b8 +} +/* base05 - #d8d8d8 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #d8d8d8 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #f84547 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d28e5d +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #efa16b +} +.hljs-strong { + font-weight: bold; + color: #efa16b +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #95c76f +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #64878f +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #8485ce +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #b74989 +} +.hljs-emphasis { + color: #b74989; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #986841 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/porple.min.css b/tools/ui/node_modules/highlight.js/styles/base16/porple.min.css new file mode 100644 index 0000000000000000000000000000000000000000..77aac4c909e48f57b59d43f03d4197f72c8b23ef --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/porple.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Porple + Author: Niek den Breeje (https://github.com/AuditeMarlow) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#d8d8d8;background:#292c36}.hljs ::selection,.hljs::selection{background-color:#474160;color:#d8d8d8}.hljs-comment{color:#65568a}.hljs-tag{color:#b8b8b8}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#d8d8d8}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f84547}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d28e5d}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#efa16b}.hljs-strong{font-weight:700;color:#efa16b}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#95c76f}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#64878f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#8485ce}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b74989}.hljs-emphasis{color:#b74989;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#986841}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/qualia.css b/tools/ui/node_modules/highlight.js/styles/base16/qualia.css new file mode 100644 index 0000000000000000000000000000000000000000..f518a3e1bd0a7e71fc4108cd546af53585671858 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/qualia.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Qualia + Author: isaacwhanson + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme qualia + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #101010 Default Background +base01 #454545 Lighter Background (Used for status bars, line number and folding marks) +base02 #454545 Selection Background +base03 #454545 Comments, Invisibles, Line Highlighting +base04 #808080 Dark Foreground (Used for status bars) +base05 #C0C0C0 Default Foreground, Caret, Delimiters, Operators +base06 #C0C0C0 Light Foreground (Not often used) +base07 #454545 Light Background (Not often used) +base08 #EFA6A2 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #A3B8EF Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #E6A3DC Classes, Markup Bold, Search Text Background +base0B #80C990 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #C8C874 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #50CACD Functions, Methods, Attribute IDs, Headings +base0E #E0AF85 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #808080 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #C0C0C0; + background: #101010 +} +.hljs::selection, +.hljs ::selection { + background-color: #454545; + color: #C0C0C0 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #454545 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #454545 +} +/* base04 - #808080 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #808080 +} +/* base05 - #C0C0C0 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #C0C0C0 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #EFA6A2 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #A3B8EF +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #E6A3DC +} +.hljs-strong { + font-weight: bold; + color: #E6A3DC +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #80C990 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #C8C874 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #50CACD +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #E0AF85 +} +.hljs-emphasis { + color: #E0AF85; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #808080 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/qualia.min.css b/tools/ui/node_modules/highlight.js/styles/base16/qualia.min.css new file mode 100644 index 0000000000000000000000000000000000000000..6b333bac12bdfa53bcee602d481c6702f728c659 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/qualia.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Qualia + Author: isaacwhanson + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:silver;background:#101010}.hljs ::selection,.hljs::selection{background-color:#454545;color:silver}.hljs-comment{color:#454545}.hljs-tag{color:grey}.hljs-operator,.hljs-punctuation,.hljs-subst{color:silver}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#efa6a2}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#a3b8ef}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#e6a3dc}.hljs-strong{font-weight:700;color:#e6a3dc}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#80c990}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#c8c874}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#50cacd}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#e0af85}.hljs-emphasis{color:#e0af85;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:grey}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/railscasts.css b/tools/ui/node_modules/highlight.js/styles/base16/railscasts.css new file mode 100644 index 0000000000000000000000000000000000000000..00c7c61f9f83d98567d56a89b34e743344f94fea --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/railscasts.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Railscasts + Author: Ryan Bates (http://railscasts.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme railscasts + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #2b2b2b Default Background +base01 #272935 Lighter Background (Used for status bars, line number and folding marks) +base02 #3a4055 Selection Background +base03 #5a647e Comments, Invisibles, Line Highlighting +base04 #d4cfc9 Dark Foreground (Used for status bars) +base05 #e6e1dc Default Foreground, Caret, Delimiters, Operators +base06 #f4f1ed Light Foreground (Not often used) +base07 #f9f7f3 Light Background (Not often used) +base08 #da4939 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #cc7833 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ffc66d Classes, Markup Bold, Search Text Background +base0B #a5c261 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #519f50 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #6d9cbe Functions, Methods, Attribute IDs, Headings +base0E #b6b3eb Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #bc9458 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #e6e1dc; + background: #2b2b2b +} +.hljs::selection, +.hljs ::selection { + background-color: #3a4055; + color: #e6e1dc +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #5a647e - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #5a647e +} +/* base04 - #d4cfc9 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #d4cfc9 +} +/* base05 - #e6e1dc - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #e6e1dc +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #da4939 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #cc7833 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ffc66d +} +.hljs-strong { + font-weight: bold; + color: #ffc66d +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #a5c261 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #519f50 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #6d9cbe +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #b6b3eb +} +.hljs-emphasis { + color: #b6b3eb; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #bc9458 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/railscasts.min.css b/tools/ui/node_modules/highlight.js/styles/base16/railscasts.min.css new file mode 100644 index 0000000000000000000000000000000000000000..835bacec46cf4fc4ca090ca00aa13160da3f79d9 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/railscasts.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Railscasts + Author: Ryan Bates (http://railscasts.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e6e1dc;background:#2b2b2b}.hljs ::selection,.hljs::selection{background-color:#3a4055;color:#e6e1dc}.hljs-comment{color:#5a647e}.hljs-tag{color:#d4cfc9}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#e6e1dc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#da4939}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#cc7833}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ffc66d}.hljs-strong{font-weight:700;color:#ffc66d}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#a5c261}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#519f50}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#6d9cbe}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b6b3eb}.hljs-emphasis{color:#b6b3eb;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#bc9458}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/rebecca.css b/tools/ui/node_modules/highlight.js/styles/base16/rebecca.css new file mode 100644 index 0000000000000000000000000000000000000000..c9ac8d3b0e7efc815b267d94d9376c2d12a5f28c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/rebecca.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Rebecca + Author: Victor Borja (http://github.com/vic) based on Rebecca Theme (http://github.com/vic/rebecca-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme rebecca + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #292a44 Default Background +base01 #663399 Lighter Background (Used for status bars, line number and folding marks) +base02 #383a62 Selection Background +base03 #666699 Comments, Invisibles, Line Highlighting +base04 #a0a0c5 Dark Foreground (Used for status bars) +base05 #f1eff8 Default Foreground, Caret, Delimiters, Operators +base06 #ccccff Light Foreground (Not often used) +base07 #53495d Light Background (Not often used) +base08 #a0a0c5 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #efe4a1 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ae81ff Classes, Markup Bold, Search Text Background +base0B #6dfedf Strings, Inherited Class, Markup Code, Diff Inserted +base0C #8eaee0 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #2de0a7 Functions, Methods, Attribute IDs, Headings +base0E #7aa5ff Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #ff79c6 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #f1eff8; + background: #292a44 +} +.hljs::selection, +.hljs ::selection { + background-color: #383a62; + color: #f1eff8 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #666699 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #666699 +} +/* base04 - #a0a0c5 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a0a0c5 +} +/* base05 - #f1eff8 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #f1eff8 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #a0a0c5 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #efe4a1 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ae81ff +} +.hljs-strong { + font-weight: bold; + color: #ae81ff +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #6dfedf +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #8eaee0 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #2de0a7 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #7aa5ff +} +.hljs-emphasis { + color: #7aa5ff; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #ff79c6 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/rebecca.min.css b/tools/ui/node_modules/highlight.js/styles/base16/rebecca.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c7c3d77675108302d288c6dd7cc3dd92970f7ff5 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/rebecca.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Rebecca + Author: Victor Borja (http://github.com/vic) based on Rebecca Theme (http://github.com/vic/rebecca-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#f1eff8;background:#292a44}.hljs ::selection,.hljs::selection{background-color:#383a62;color:#f1eff8}.hljs-comment{color:#669}.hljs-tag{color:#a0a0c5}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#f1eff8}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#a0a0c5}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#efe4a1}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ae81ff}.hljs-strong{font-weight:700;color:#ae81ff}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#6dfedf}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#8eaee0}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#2de0a7}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#7aa5ff}.hljs-emphasis{color:#7aa5ff;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#ff79c6}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-dawn.css b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-dawn.css new file mode 100644 index 0000000000000000000000000000000000000000..7509d0bc4aa0852aa1f14a3e318db941293843b4 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-dawn.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Rosé Pine Dawn + Author: Emilia Dunfelt + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme ros-pine-dawn + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #faf4ed Default Background +base01 #fffaf3 Lighter Background (Used for status bars, line number and folding marks) +base02 #f2e9de Selection Background +base03 #9893a5 Comments, Invisibles, Line Highlighting +base04 #6e6a86 Dark Foreground (Used for status bars) +base05 #575279 Default Foreground, Caret, Delimiters, Operators +base06 #555169 Light Foreground (Not often used) +base07 #26233a Light Background (Not often used) +base08 #1f1d2e Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #b4637a Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ea9d34 Classes, Markup Bold, Search Text Background +base0B #d7827e Strings, Inherited Class, Markup Code, Diff Inserted +base0C #286983 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #56949f Functions, Methods, Attribute IDs, Headings +base0E #907aa9 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #c5c3ce Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #575279; + background: #faf4ed +} +.hljs::selection, +.hljs ::selection { + background-color: #f2e9de; + color: #575279 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #9893a5 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #9893a5 +} +/* base04 - #6e6a86 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #6e6a86 +} +/* base05 - #575279 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #575279 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #1f1d2e +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #b4637a +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ea9d34 +} +.hljs-strong { + font-weight: bold; + color: #ea9d34 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #d7827e +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #286983 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #56949f +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #907aa9 +} +.hljs-emphasis { + color: #907aa9; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #c5c3ce +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-dawn.min.css b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-dawn.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a877d23119bb72bad6d79ce6653a387fc19c8681 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-dawn.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Rosé Pine Dawn + Author: Emilia Dunfelt + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#575279;background:#faf4ed}.hljs ::selection,.hljs::selection{background-color:#f2e9de;color:#575279}.hljs-comment{color:#9893a5}.hljs-tag{color:#6e6a86}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#575279}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#1f1d2e}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#b4637a}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ea9d34}.hljs-strong{font-weight:700;color:#ea9d34}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#d7827e}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#286983}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#56949f}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#907aa9}.hljs-emphasis{color:#907aa9;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c5c3ce}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-moon.css b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-moon.css new file mode 100644 index 0000000000000000000000000000000000000000..57e81ac065b3beaee626d3694299f802894211c4 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-moon.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Rosé Pine Moon + Author: Emilia Dunfelt + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme ros-pine-moon + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #232136 Default Background +base01 #2a273f Lighter Background (Used for status bars, line number and folding marks) +base02 #393552 Selection Background +base03 #59546d Comments, Invisibles, Line Highlighting +base04 #817c9c Dark Foreground (Used for status bars) +base05 #e0def4 Default Foreground, Caret, Delimiters, Operators +base06 #f5f5f7 Light Foreground (Not often used) +base07 #d9d7e1 Light Background (Not often used) +base08 #ecebf0 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #eb6f92 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f6c177 Classes, Markup Bold, Search Text Background +base0B #ea9a97 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #3e8fb0 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #9ccfd8 Functions, Methods, Attribute IDs, Headings +base0E #c4a7e7 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #b9b9bc Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #e0def4; + background: #232136 +} +.hljs::selection, +.hljs ::selection { + background-color: #393552; + color: #e0def4 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #59546d - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #59546d +} +/* base04 - #817c9c - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #817c9c +} +/* base05 - #e0def4 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #e0def4 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #ecebf0 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #eb6f92 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f6c177 +} +.hljs-strong { + font-weight: bold; + color: #f6c177 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #ea9a97 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #3e8fb0 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #9ccfd8 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #c4a7e7 +} +.hljs-emphasis { + color: #c4a7e7; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #b9b9bc +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-moon.min.css b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-moon.min.css new file mode 100644 index 0000000000000000000000000000000000000000..eab4a50af86bad40b84a15e3f9cfca30d831d4cd --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine-moon.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Rosé Pine Moon + Author: Emilia Dunfelt + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e0def4;background:#232136}.hljs ::selection,.hljs::selection{background-color:#393552;color:#e0def4}.hljs-comment{color:#59546d}.hljs-tag{color:#817c9c}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#e0def4}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ecebf0}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#eb6f92}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f6c177}.hljs-strong{font-weight:700;color:#f6c177}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#ea9a97}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3e8fb0}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#9ccfd8}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c4a7e7}.hljs-emphasis{color:#c4a7e7;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#b9b9bc}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ros-pine.css b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine.css new file mode 100644 index 0000000000000000000000000000000000000000..da0e2308e32291898dfc1f71b615cc8f8d2c7683 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Rosé Pine + Author: Emilia Dunfelt + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme ros-pine + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #191724 Default Background +base01 #1f1d2e Lighter Background (Used for status bars, line number and folding marks) +base02 #26233a Selection Background +base03 #555169 Comments, Invisibles, Line Highlighting +base04 #6e6a86 Dark Foreground (Used for status bars) +base05 #e0def4 Default Foreground, Caret, Delimiters, Operators +base06 #f0f0f3 Light Foreground (Not often used) +base07 #c5c3ce Light Background (Not often used) +base08 #e2e1e7 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #eb6f92 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f6c177 Classes, Markup Bold, Search Text Background +base0B #ebbcba Strings, Inherited Class, Markup Code, Diff Inserted +base0C #31748f Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #9ccfd8 Functions, Methods, Attribute IDs, Headings +base0E #c4a7e7 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #e5e5e5 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #e0def4; + background: #191724 +} +.hljs::selection, +.hljs ::selection { + background-color: #26233a; + color: #e0def4 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #555169 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #555169 +} +/* base04 - #6e6a86 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #6e6a86 +} +/* base05 - #e0def4 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #e0def4 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #e2e1e7 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #eb6f92 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f6c177 +} +.hljs-strong { + font-weight: bold; + color: #f6c177 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #ebbcba +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #31748f +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #9ccfd8 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #c4a7e7 +} +.hljs-emphasis { + color: #c4a7e7; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #e5e5e5 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/ros-pine.min.css b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine.min.css new file mode 100644 index 0000000000000000000000000000000000000000..ddc4e69a188f36561d6e0e347e37732855e15000 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/ros-pine.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Rosé Pine + Author: Emilia Dunfelt + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e0def4;background:#191724}.hljs ::selection,.hljs::selection{background-color:#26233a;color:#e0def4}.hljs-comment{color:#555169}.hljs-tag{color:#6e6a86}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#e0def4}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#e2e1e7}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#eb6f92}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f6c177}.hljs-strong{font-weight:700;color:#f6c177}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#ebbcba}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#31748f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#9ccfd8}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c4a7e7}.hljs-emphasis{color:#c4a7e7;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#e5e5e5}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/sagelight.css b/tools/ui/node_modules/highlight.js/styles/base16/sagelight.css new file mode 100644 index 0000000000000000000000000000000000000000..0baedb9b63db64f1c415c0aac98b5a19aa4b17d2 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/sagelight.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Sagelight + Author: Carter Veldhuizen + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme sagelight + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #f8f8f8 Default Background +base01 #e8e8e8 Lighter Background (Used for status bars, line number and folding marks) +base02 #d8d8d8 Selection Background +base03 #b8b8b8 Comments, Invisibles, Line Highlighting +base04 #585858 Dark Foreground (Used for status bars) +base05 #383838 Default Foreground, Caret, Delimiters, Operators +base06 #282828 Light Foreground (Not often used) +base07 #181818 Light Background (Not often used) +base08 #fa8480 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ffaa61 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ffdc61 Classes, Markup Bold, Search Text Background +base0B #a0d2c8 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #a2d6f5 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #a0a7d2 Functions, Methods, Attribute IDs, Headings +base0E #c8a0d2 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #d2b2a0 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #383838; + background: #f8f8f8 +} +.hljs::selection, +.hljs ::selection { + background-color: #d8d8d8; + color: #383838 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #b8b8b8 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #b8b8b8 +} +/* base04 - #585858 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #585858 +} +/* base05 - #383838 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #383838 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #fa8480 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ffaa61 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ffdc61 +} +.hljs-strong { + font-weight: bold; + color: #ffdc61 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #a0d2c8 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #a2d6f5 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #a0a7d2 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #c8a0d2 +} +.hljs-emphasis { + color: #c8a0d2; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #d2b2a0 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/sagelight.min.css b/tools/ui/node_modules/highlight.js/styles/base16/sagelight.min.css new file mode 100644 index 0000000000000000000000000000000000000000..f0dc92740475c7283be8998fa0b0dd937dc0078b --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/sagelight.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Sagelight + Author: Carter Veldhuizen + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383838;background:#f8f8f8}.hljs ::selection,.hljs::selection{background-color:#d8d8d8;color:#383838}.hljs-comment{color:#b8b8b8}.hljs-tag{color:#585858}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#383838}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#fa8480}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ffaa61}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ffdc61}.hljs-strong{font-weight:700;color:#ffdc61}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#a0d2c8}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#a2d6f5}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#a0a7d2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c8a0d2}.hljs-emphasis{color:#c8a0d2;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#d2b2a0}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/sandcastle.css b/tools/ui/node_modules/highlight.js/styles/base16/sandcastle.css new file mode 100644 index 0000000000000000000000000000000000000000..eba306dcfc95246937259b212b9b0e19a76f451b --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/sandcastle.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Sandcastle + Author: George Essig (https://github.com/gessig) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme sandcastle + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #282c34 Default Background +base01 #2c323b Lighter Background (Used for status bars, line number and folding marks) +base02 #3e4451 Selection Background +base03 #665c54 Comments, Invisibles, Line Highlighting +base04 #928374 Dark Foreground (Used for status bars) +base05 #a89984 Default Foreground, Caret, Delimiters, Operators +base06 #d5c4a1 Light Foreground (Not often used) +base07 #fdf4c1 Light Background (Not often used) +base08 #83a598 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #a07e3b Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #a07e3b Classes, Markup Bold, Search Text Background +base0B #528b8b Strings, Inherited Class, Markup Code, Diff Inserted +base0C #83a598 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #83a598 Functions, Methods, Attribute IDs, Headings +base0E #d75f5f Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #a87322 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #a89984; + background: #282c34 +} +.hljs::selection, +.hljs ::selection { + background-color: #3e4451; + color: #a89984 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #665c54 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #665c54 +} +/* base04 - #928374 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #928374 +} +/* base05 - #a89984 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #a89984 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #83a598 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #a07e3b +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #a07e3b +} +.hljs-strong { + font-weight: bold; + color: #a07e3b +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #528b8b +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #83a598 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #83a598 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #d75f5f +} +.hljs-emphasis { + color: #d75f5f; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #a87322 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/sandcastle.min.css b/tools/ui/node_modules/highlight.js/styles/base16/sandcastle.min.css new file mode 100644 index 0000000000000000000000000000000000000000..601dc21de4c63f9f1ac5907a5fead2b7e495d611 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/sandcastle.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Sandcastle + Author: George Essig (https://github.com/gessig) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#a89984;background:#282c34}.hljs ::selection,.hljs::selection{background-color:#3e4451;color:#a89984}.hljs-comment{color:#665c54}.hljs-tag{color:#928374}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#a89984}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#83a598}.hljs-attr,.hljs-class .hljs-title,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-title,.hljs-title.class_,.hljs-variable.constant_{color:#a07e3b}.hljs-strong{font-weight:700;color:#a07e3b}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#528b8b}.hljs-attribute,.hljs-built_in,.hljs-doctag,.hljs-function .hljs-title,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#83a598}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#d75f5f}.hljs-emphasis{color:#d75f5f;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a87322}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/seti-ui.css b/tools/ui/node_modules/highlight.js/styles/base16/seti-ui.css new file mode 100644 index 0000000000000000000000000000000000000000..ed897cef5c40aa42c6a014bf3fd215e741160222 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/seti-ui.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Seti UI + Author: + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme seti-ui + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #151718 Default Background +base01 #282a2b Lighter Background (Used for status bars, line number and folding marks) +base02 #3B758C Selection Background +base03 #41535B Comments, Invisibles, Line Highlighting +base04 #43a5d5 Dark Foreground (Used for status bars) +base05 #d6d6d6 Default Foreground, Caret, Delimiters, Operators +base06 #eeeeee Light Foreground (Not often used) +base07 #ffffff Light Background (Not often used) +base08 #Cd3f45 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #db7b55 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #e6cd69 Classes, Markup Bold, Search Text Background +base0B #9fca56 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #55dbbe Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #55b5db Functions, Methods, Attribute IDs, Headings +base0E #a074c4 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #8a553f Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #d6d6d6; + background: #151718 +} +.hljs::selection, +.hljs ::selection { + background-color: #3B758C; + color: #d6d6d6 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #41535B - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #41535B +} +/* base04 - #43a5d5 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #43a5d5 +} +/* base05 - #d6d6d6 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #d6d6d6 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #Cd3f45 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #db7b55 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #e6cd69 +} +.hljs-strong { + font-weight: bold; + color: #e6cd69 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #9fca56 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #55dbbe +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #55b5db +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #a074c4 +} +.hljs-emphasis { + color: #a074c4; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #8a553f +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/seti-ui.min.css b/tools/ui/node_modules/highlight.js/styles/base16/seti-ui.min.css new file mode 100644 index 0000000000000000000000000000000000000000..fa3347e19405caefa0cd959db681f367fcbec93c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/seti-ui.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Seti UI + Author: + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#d6d6d6;background:#151718}.hljs ::selection,.hljs::selection{background-color:#3b758c;color:#d6d6d6}.hljs-comment{color:#41535b}.hljs-tag{color:#43a5d5}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#d6d6d6}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#cd3f45}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#db7b55}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#e6cd69}.hljs-strong{font-weight:700;color:#e6cd69}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9fca56}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#55dbbe}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#55b5db}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#a074c4}.hljs-emphasis{color:#a074c4;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#8a553f}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/shapeshifter.css b/tools/ui/node_modules/highlight.js/styles/base16/shapeshifter.css new file mode 100644 index 0000000000000000000000000000000000000000..ab56c01130926791fe6b93f2c90b6a7753bbff9a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/shapeshifter.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Shapeshifter + Author: Tyler Benziger (http://tybenz.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme shapeshifter + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #f9f9f9 Default Background +base01 #e0e0e0 Lighter Background (Used for status bars, line number and folding marks) +base02 #ababab Selection Background +base03 #555555 Comments, Invisibles, Line Highlighting +base04 #343434 Dark Foreground (Used for status bars) +base05 #102015 Default Foreground, Caret, Delimiters, Operators +base06 #040404 Light Foreground (Not often used) +base07 #000000 Light Background (Not often used) +base08 #e92f2f Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #e09448 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #dddd13 Classes, Markup Bold, Search Text Background +base0B #0ed839 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #23edda Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #3b48e3 Functions, Methods, Attribute IDs, Headings +base0E #f996e2 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #69542d Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #102015; + background: #f9f9f9 +} +.hljs::selection, +.hljs ::selection { + background-color: #ababab; + color: #102015 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #555555 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #555555 +} +/* base04 - #343434 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #343434 +} +/* base05 - #102015 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #102015 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #e92f2f +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #e09448 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #dddd13 +} +.hljs-strong { + font-weight: bold; + color: #dddd13 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #0ed839 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #23edda +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #3b48e3 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #f996e2 +} +.hljs-emphasis { + color: #f996e2; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #69542d +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/shapeshifter.min.css b/tools/ui/node_modules/highlight.js/styles/base16/shapeshifter.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a3e83b55381cc92ad93becc57531f11a00571824 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/shapeshifter.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Shapeshifter + Author: Tyler Benziger (http://tybenz.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#102015;background:#f9f9f9}.hljs ::selection,.hljs::selection{background-color:#ababab;color:#102015}.hljs-comment{color:#555}.hljs-tag{color:#343434}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#102015}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#e92f2f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#e09448}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#dddd13}.hljs-strong{font-weight:700;color:#dddd13}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#0ed839}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#23edda}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#3b48e3}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#f996e2}.hljs-emphasis{color:#f996e2;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#69542d}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/silk-dark.css b/tools/ui/node_modules/highlight.js/styles/base16/silk-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..a008a7b8a29ef2b2ff402706a6e523660cb4c6be --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/silk-dark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Silk Dark + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme silk-dark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #0e3c46 Default Background +base01 #1D494E Lighter Background (Used for status bars, line number and folding marks) +base02 #2A5054 Selection Background +base03 #587073 Comments, Invisibles, Line Highlighting +base04 #9DC8CD Dark Foreground (Used for status bars) +base05 #C7DBDD Default Foreground, Caret, Delimiters, Operators +base06 #CBF2F7 Light Foreground (Not often used) +base07 #D2FAFF Light Background (Not often used) +base08 #fb6953 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #fcab74 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #fce380 Classes, Markup Bold, Search Text Background +base0B #73d8ad Strings, Inherited Class, Markup Code, Diff Inserted +base0C #3fb2b9 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #46bddd Functions, Methods, Attribute IDs, Headings +base0E #756b8a Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #9b647b Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #C7DBDD; + background: #0e3c46 +} +.hljs::selection, +.hljs ::selection { + background-color: #2A5054; + color: #C7DBDD +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #587073 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #587073 +} +/* base04 - #9DC8CD - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #9DC8CD +} +/* base05 - #C7DBDD - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #C7DBDD +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #fb6953 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #fcab74 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #fce380 +} +.hljs-strong { + font-weight: bold; + color: #fce380 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #73d8ad +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #3fb2b9 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #46bddd +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #756b8a +} +.hljs-emphasis { + color: #756b8a; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #9b647b +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/silk-dark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/silk-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..1315a0bb76e5c7ae0cf96bb829e99d008e37673c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/silk-dark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Silk Dark + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c7dbdd;background:#0e3c46}.hljs ::selection,.hljs::selection{background-color:#2a5054;color:#c7dbdd}.hljs-comment{color:#587073}.hljs-tag{color:#9dc8cd}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#c7dbdd}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#fb6953}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fcab74}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fce380}.hljs-strong{font-weight:700;color:#fce380}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#73d8ad}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3fb2b9}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#46bddd}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#756b8a}.hljs-emphasis{color:#756b8a;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#9b647b}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/silk-light.css b/tools/ui/node_modules/highlight.js/styles/base16/silk-light.css new file mode 100644 index 0000000000000000000000000000000000000000..0b081ca3599c6a258b644bccdf61c74cac588518 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/silk-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Silk Light + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme silk-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #E9F1EF Default Background +base01 #CCD4D3 Lighter Background (Used for status bars, line number and folding marks) +base02 #90B7B6 Selection Background +base03 #5C787B Comments, Invisibles, Line Highlighting +base04 #4B5B5F Dark Foreground (Used for status bars) +base05 #385156 Default Foreground, Caret, Delimiters, Operators +base06 #0e3c46 Light Foreground (Not often used) +base07 #D2FAFF Light Background (Not often used) +base08 #CF432E Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #D27F46 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #CFAD25 Classes, Markup Bold, Search Text Background +base0B #6CA38C Strings, Inherited Class, Markup Code, Diff Inserted +base0C #329CA2 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #39AAC9 Functions, Methods, Attribute IDs, Headings +base0E #6E6582 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #865369 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #385156; + background: #E9F1EF +} +.hljs::selection, +.hljs ::selection { + background-color: #90B7B6; + color: #385156 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #5C787B - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #5C787B +} +/* base04 - #4B5B5F - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #4B5B5F +} +/* base05 - #385156 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #385156 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #CF432E +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #D27F46 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #CFAD25 +} +.hljs-strong { + font-weight: bold; + color: #CFAD25 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #6CA38C +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #329CA2 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #39AAC9 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #6E6582 +} +.hljs-emphasis { + color: #6E6582; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #865369 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/silk-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/silk-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..54b0058cd219a4ebc50f1689b349b165ccee7c31 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/silk-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Silk Light + Author: Gabriel Fontes (https://github.com/Misterio77) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#385156;background:#e9f1ef}.hljs ::selection,.hljs::selection{background-color:#90b7b6;color:#385156}.hljs-comment{color:#5c787b}.hljs-tag{color:#4b5b5f}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#385156}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#cf432e}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d27f46}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#cfad25}.hljs-strong{font-weight:700;color:#cfad25}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#6ca38c}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#329ca2}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#39aac9}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#6e6582}.hljs-emphasis{color:#6e6582;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#865369}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/snazzy.css b/tools/ui/node_modules/highlight.js/styles/base16/snazzy.css new file mode 100644 index 0000000000000000000000000000000000000000..335abd9ec55fabcbc07d7e7cb4d405e68860ca08 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/snazzy.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Snazzy + Author: Chawye Hsu (https://github.com/chawyehsu) based on Hyper Snazzy Theme (https://github.com/sindresorhus/hyper-snazzy) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme snazzy + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #282a36 Default Background +base01 #34353e Lighter Background (Used for status bars, line number and folding marks) +base02 #43454f Selection Background +base03 #78787e Comments, Invisibles, Line Highlighting +base04 #a5a5a9 Dark Foreground (Used for status bars) +base05 #e2e4e5 Default Foreground, Caret, Delimiters, Operators +base06 #eff0eb Light Foreground (Not often used) +base07 #f1f1f0 Light Background (Not often used) +base08 #ff5c57 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ff9f43 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f3f99d Classes, Markup Bold, Search Text Background +base0B #5af78e Strings, Inherited Class, Markup Code, Diff Inserted +base0C #9aedfe Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #57c7ff Functions, Methods, Attribute IDs, Headings +base0E #ff6ac1 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #b2643c Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #e2e4e5; + background: #282a36 +} +.hljs::selection, +.hljs ::selection { + background-color: #43454f; + color: #e2e4e5 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #78787e - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #78787e +} +/* base04 - #a5a5a9 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a5a5a9 +} +/* base05 - #e2e4e5 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #e2e4e5 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #ff5c57 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ff9f43 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f3f99d +} +.hljs-strong { + font-weight: bold; + color: #f3f99d +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #5af78e +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #9aedfe +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #57c7ff +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #ff6ac1 +} +.hljs-emphasis { + color: #ff6ac1; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #b2643c +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/snazzy.min.css b/tools/ui/node_modules/highlight.js/styles/base16/snazzy.min.css new file mode 100644 index 0000000000000000000000000000000000000000..22417523a8cc15527c13dc983c8d41cb31505931 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/snazzy.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Snazzy + Author: Chawye Hsu (https://github.com/chawyehsu) based on Hyper Snazzy Theme (https://github.com/sindresorhus/hyper-snazzy) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e2e4e5;background:#282a36}.hljs ::selection,.hljs::selection{background-color:#43454f;color:#e2e4e5}.hljs-comment{color:#78787e}.hljs-tag{color:#a5a5a9}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#e2e4e5}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ff5c57}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ff9f43}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f3f99d}.hljs-strong{font-weight:700;color:#f3f99d}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#5af78e}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#9aedfe}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#57c7ff}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ff6ac1}.hljs-emphasis{color:#ff6ac1;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#b2643c}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solar-flare-light.css b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare-light.css new file mode 100644 index 0000000000000000000000000000000000000000..d8124db6746dea8e310b247efcfc95e2c12c8948 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Solar Flare Light + Author: Chuck Harmston (https://chuck.harmston.ch) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme solar-flare-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #F5F7FA Default Background +base01 #E8E9ED Lighter Background (Used for status bars, line number and folding marks) +base02 #A6AFB8 Selection Background +base03 #85939E Comments, Invisibles, Line Highlighting +base04 #667581 Dark Foreground (Used for status bars) +base05 #586875 Default Foreground, Caret, Delimiters, Operators +base06 #222E38 Light Foreground (Not often used) +base07 #18262F Light Background (Not often used) +base08 #EF5253 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #E66B2B Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #E4B51C Classes, Markup Bold, Search Text Background +base0B #7CC844 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #52CBB0 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #33B5E1 Functions, Methods, Attribute IDs, Headings +base0E #A363D5 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #D73C9A Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #586875; + background: #F5F7FA +} +.hljs::selection, +.hljs ::selection { + background-color: #A6AFB8; + color: #586875 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #85939E - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #85939E +} +/* base04 - #667581 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #667581 +} +/* base05 - #586875 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #586875 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #EF5253 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #E66B2B +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #E4B51C +} +.hljs-strong { + font-weight: bold; + color: #E4B51C +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #7CC844 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #52CBB0 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #33B5E1 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #A363D5 +} +.hljs-emphasis { + color: #A363D5; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #D73C9A +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solar-flare-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..4b6a98ff9ca7ae1e45c51b5f90735960ae536e85 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Solar Flare Light + Author: Chuck Harmston (https://chuck.harmston.ch) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#586875;background:#f5f7fa}.hljs ::selection,.hljs::selection{background-color:#a6afb8;color:#586875}.hljs-comment{color:#85939e}.hljs-tag{color:#667581}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#586875}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ef5253}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#e66b2b}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#e4b51c}.hljs-strong{font-weight:700;color:#e4b51c}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#7cc844}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#52cbb0}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#33b5e1}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#a363d5}.hljs-emphasis{color:#a363d5;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#d73c9a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solar-flare.css b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare.css new file mode 100644 index 0000000000000000000000000000000000000000..0763f0c4e663854fbeb2f7ac2c300c53179e6bb8 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Solar Flare + Author: Chuck Harmston (https://chuck.harmston.ch) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme solar-flare + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #18262F Default Background +base01 #222E38 Lighter Background (Used for status bars, line number and folding marks) +base02 #586875 Selection Background +base03 #667581 Comments, Invisibles, Line Highlighting +base04 #85939E Dark Foreground (Used for status bars) +base05 #A6AFB8 Default Foreground, Caret, Delimiters, Operators +base06 #E8E9ED Light Foreground (Not often used) +base07 #F5F7FA Light Background (Not often used) +base08 #EF5253 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #E66B2B Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #E4B51C Classes, Markup Bold, Search Text Background +base0B #7CC844 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #52CBB0 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #33B5E1 Functions, Methods, Attribute IDs, Headings +base0E #A363D5 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #D73C9A Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #A6AFB8; + background: #18262F +} +.hljs::selection, +.hljs ::selection { + background-color: #586875; + color: #A6AFB8 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #667581 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #667581 +} +/* base04 - #85939E - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #85939E +} +/* base05 - #A6AFB8 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #A6AFB8 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #EF5253 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #E66B2B +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #E4B51C +} +.hljs-strong { + font-weight: bold; + color: #E4B51C +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #7CC844 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #52CBB0 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #33B5E1 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #A363D5 +} +.hljs-emphasis { + color: #A363D5; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #D73C9A +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solar-flare.min.css b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare.min.css new file mode 100644 index 0000000000000000000000000000000000000000..115fb97963b65ae92695ff4b77258918bf5d9612 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solar-flare.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Solar Flare + Author: Chuck Harmston (https://chuck.harmston.ch) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#a6afb8;background:#18262f}.hljs ::selection,.hljs::selection{background-color:#586875;color:#a6afb8}.hljs-comment{color:#667581}.hljs-tag{color:#85939e}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#a6afb8}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ef5253}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#e66b2b}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#e4b51c}.hljs-strong{font-weight:700;color:#e4b51c}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#7cc844}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#52cbb0}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#33b5e1}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#a363d5}.hljs-emphasis{color:#a363d5;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#d73c9a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solarized-dark.css b/tools/ui/node_modules/highlight.js/styles/base16/solarized-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..6437cf5c245edb552fdd2ccf0239858b7f1558ed --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solarized-dark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Solarized Dark + Author: Ethan Schoonover (modified by aramisgithub) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme solarized-dark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #002b36 Default Background +base01 #073642 Lighter Background (Used for status bars, line number and folding marks) +base02 #586e75 Selection Background +base03 #657b83 Comments, Invisibles, Line Highlighting +base04 #839496 Dark Foreground (Used for status bars) +base05 #93a1a1 Default Foreground, Caret, Delimiters, Operators +base06 #eee8d5 Light Foreground (Not often used) +base07 #fdf6e3 Light Background (Not often used) +base08 #dc322f Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #cb4b16 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #b58900 Classes, Markup Bold, Search Text Background +base0B #859900 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #2aa198 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #268bd2 Functions, Methods, Attribute IDs, Headings +base0E #6c71c4 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #d33682 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #93a1a1; + background: #002b36 +} +.hljs::selection, +.hljs ::selection { + background-color: #586e75; + color: #93a1a1 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #657b83 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #657b83 +} +/* base04 - #839496 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #839496 +} +/* base05 - #93a1a1 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #93a1a1 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #dc322f +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #cb4b16 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #b58900 +} +.hljs-strong { + font-weight: bold; + color: #b58900 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #859900 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #2aa198 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #268bd2 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #6c71c4 +} +.hljs-emphasis { + color: #6c71c4; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #d33682 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solarized-dark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/solarized-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e2b153562e02cd3978541bea50e39664829a3291 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solarized-dark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Solarized Dark + Author: Ethan Schoonover (modified by aramisgithub) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#93a1a1;background:#002b36}.hljs ::selection,.hljs::selection{background-color:#586e75;color:#93a1a1}.hljs-comment{color:#657b83}.hljs-tag{color:#839496}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#93a1a1}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#dc322f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#cb4b16}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#b58900}.hljs-strong{font-weight:700;color:#b58900}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#859900}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#2aa198}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#268bd2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#6c71c4}.hljs-emphasis{color:#6c71c4;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#d33682}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solarized-light.css b/tools/ui/node_modules/highlight.js/styles/base16/solarized-light.css new file mode 100644 index 0000000000000000000000000000000000000000..4c71ce091b9d3994bb319eddf001cb84816341db --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solarized-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Solarized Light + Author: Ethan Schoonover (modified by aramisgithub) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme solarized-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #fdf6e3 Default Background +base01 #eee8d5 Lighter Background (Used for status bars, line number and folding marks) +base02 #93a1a1 Selection Background +base03 #839496 Comments, Invisibles, Line Highlighting +base04 #657b83 Dark Foreground (Used for status bars) +base05 #586e75 Default Foreground, Caret, Delimiters, Operators +base06 #073642 Light Foreground (Not often used) +base07 #002b36 Light Background (Not often used) +base08 #dc322f Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #cb4b16 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #b58900 Classes, Markup Bold, Search Text Background +base0B #859900 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #2aa198 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #268bd2 Functions, Methods, Attribute IDs, Headings +base0E #6c71c4 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #d33682 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #586e75; + background: #fdf6e3 +} +.hljs::selection, +.hljs ::selection { + background-color: #93a1a1; + color: #586e75 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #839496 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #839496 +} +/* base04 - #657b83 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #657b83 +} +/* base05 - #586e75 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #586e75 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #dc322f +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #cb4b16 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #b58900 +} +.hljs-strong { + font-weight: bold; + color: #b58900 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #859900 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #2aa198 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #268bd2 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #6c71c4 +} +.hljs-emphasis { + color: #6c71c4; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #d33682 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/solarized-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/solarized-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..67a590b3bf978af663c1a9ef113b1f3a3ebeb94f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/solarized-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Solarized Light + Author: Ethan Schoonover (modified by aramisgithub) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#586e75;background:#fdf6e3}.hljs ::selection,.hljs::selection{background-color:#93a1a1;color:#586e75}.hljs-comment{color:#839496}.hljs-tag{color:#657b83}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#586e75}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#dc322f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#cb4b16}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#b58900}.hljs-strong{font-weight:700;color:#b58900}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#859900}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#2aa198}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#268bd2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#6c71c4}.hljs-emphasis{color:#6c71c4;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#d33682}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/spacemacs.css b/tools/ui/node_modules/highlight.js/styles/base16/spacemacs.css new file mode 100644 index 0000000000000000000000000000000000000000..19a2403c95ba263e345f1424be90b59eec95ef9a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/spacemacs.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Spacemacs + Author: Nasser Alshammari (https://github.com/nashamri/spacemacs-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme spacemacs + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #1f2022 Default Background +base01 #282828 Lighter Background (Used for status bars, line number and folding marks) +base02 #444155 Selection Background +base03 #585858 Comments, Invisibles, Line Highlighting +base04 #b8b8b8 Dark Foreground (Used for status bars) +base05 #a3a3a3 Default Foreground, Caret, Delimiters, Operators +base06 #e8e8e8 Light Foreground (Not often used) +base07 #f8f8f8 Light Background (Not often used) +base08 #f2241f Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ffa500 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #b1951d Classes, Markup Bold, Search Text Background +base0B #67b11d Strings, Inherited Class, Markup Code, Diff Inserted +base0C #2d9574 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #4f97d7 Functions, Methods, Attribute IDs, Headings +base0E #a31db1 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #b03060 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #a3a3a3; + background: #1f2022 +} +.hljs::selection, +.hljs ::selection { + background-color: #444155; + color: #a3a3a3 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #585858 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #585858 +} +/* base04 - #b8b8b8 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b8b8b8 +} +/* base05 - #a3a3a3 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #a3a3a3 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #f2241f +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ffa500 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #b1951d +} +.hljs-strong { + font-weight: bold; + color: #b1951d +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #67b11d +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #2d9574 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #4f97d7 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #a31db1 +} +.hljs-emphasis { + color: #a31db1; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #b03060 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/spacemacs.min.css b/tools/ui/node_modules/highlight.js/styles/base16/spacemacs.min.css new file mode 100644 index 0000000000000000000000000000000000000000..ba8f7d950a68792ac61c6d35dc5b48d549e1d766 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/spacemacs.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Spacemacs + Author: Nasser Alshammari (https://github.com/nashamri/spacemacs-theme) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#a3a3a3;background:#1f2022}.hljs ::selection,.hljs::selection{background-color:#444155;color:#a3a3a3}.hljs-comment{color:#585858}.hljs-tag{color:#b8b8b8}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#a3a3a3}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2241f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:orange}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#b1951d}.hljs-strong{font-weight:700;color:#b1951d}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#67b11d}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#2d9574}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4f97d7}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#a31db1}.hljs-emphasis{color:#a31db1;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#b03060}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/summercamp.css b/tools/ui/node_modules/highlight.js/styles/base16/summercamp.css new file mode 100644 index 0000000000000000000000000000000000000000..f462fd71cec73be09221058389af4c890517b669 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/summercamp.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: summercamp + Author: zoe firi (zoefiri.github.io) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme summercamp + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #1c1810 Default Background +base01 #2a261c Lighter Background (Used for status bars, line number and folding marks) +base02 #3a3527 Selection Background +base03 #504b38 Comments, Invisibles, Line Highlighting +base04 #5f5b45 Dark Foreground (Used for status bars) +base05 #736e55 Default Foreground, Caret, Delimiters, Operators +base06 #bab696 Light Foreground (Not often used) +base07 #f8f5de Light Background (Not often used) +base08 #e35142 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #fba11b Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f2ff27 Classes, Markup Bold, Search Text Background +base0B #5ceb5a Strings, Inherited Class, Markup Code, Diff Inserted +base0C #5aebbc Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #489bf0 Functions, Methods, Attribute IDs, Headings +base0E #FF8080 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #F69BE7 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #736e55; + background: #1c1810 +} +.hljs::selection, +.hljs ::selection { + background-color: #3a3527; + color: #736e55 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #504b38 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #504b38 +} +/* base04 - #5f5b45 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #5f5b45 +} +/* base05 - #736e55 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #736e55 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #e35142 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #fba11b +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f2ff27 +} +.hljs-strong { + font-weight: bold; + color: #f2ff27 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #5ceb5a +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #5aebbc +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #489bf0 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #FF8080 +} +.hljs-emphasis { + color: #FF8080; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #F69BE7 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/summercamp.min.css b/tools/ui/node_modules/highlight.js/styles/base16/summercamp.min.css new file mode 100644 index 0000000000000000000000000000000000000000..931b035cf07b867ad2de167e11ba15343092cda5 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/summercamp.min.css @@ -0,0 +1,7 @@ +/*! + Theme: summercamp + Author: zoe firi (zoefiri.github.io) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#736e55;background:#1c1810}.hljs ::selection,.hljs::selection{background-color:#3a3527;color:#736e55}.hljs-comment{color:#504b38}.hljs-tag{color:#5f5b45}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#736e55}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#e35142}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fba11b}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f2ff27}.hljs-strong{font-weight:700;color:#f2ff27}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#5ceb5a}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#5aebbc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#489bf0}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ff8080}.hljs-emphasis{color:#ff8080;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#f69be7}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-dark.css b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..57e9cdd51d5e5413052791425963a69814ff2d23 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-dark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Summerfruit Dark + Author: Christopher Corley (http://christop.club/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme summerfruit-dark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #151515 Default Background +base01 #202020 Lighter Background (Used for status bars, line number and folding marks) +base02 #303030 Selection Background +base03 #505050 Comments, Invisibles, Line Highlighting +base04 #B0B0B0 Dark Foreground (Used for status bars) +base05 #D0D0D0 Default Foreground, Caret, Delimiters, Operators +base06 #E0E0E0 Light Foreground (Not often used) +base07 #FFFFFF Light Background (Not often used) +base08 #FF0086 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #FD8900 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ABA800 Classes, Markup Bold, Search Text Background +base0B #00C918 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #1FAAAA Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #3777E6 Functions, Methods, Attribute IDs, Headings +base0E #AD00A1 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #CC6633 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #D0D0D0; + background: #151515 +} +.hljs::selection, +.hljs ::selection { + background-color: #303030; + color: #D0D0D0 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #505050 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #505050 +} +/* base04 - #B0B0B0 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #B0B0B0 +} +/* base05 - #D0D0D0 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #D0D0D0 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #FF0086 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #FD8900 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ABA800 +} +.hljs-strong { + font-weight: bold; + color: #ABA800 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #00C918 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #1FAAAA +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #3777E6 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #AD00A1 +} +.hljs-emphasis { + color: #AD00A1; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #CC6633 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-dark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..8ba6c886cd6c8646a8424a2812fac9c26001cc8c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-dark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Summerfruit Dark + Author: Christopher Corley (http://christop.club/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#d0d0d0;background:#151515}.hljs ::selection,.hljs::selection{background-color:#303030;color:#d0d0d0}.hljs-comment{color:#505050}.hljs-tag{color:#b0b0b0}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#d0d0d0}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ff0086}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fd8900}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#aba800}.hljs-strong{font-weight:700;color:#aba800}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#00c918}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#1faaaa}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#3777e6}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ad00a1}.hljs-emphasis{color:#ad00a1;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c63}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-light.css b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-light.css new file mode 100644 index 0000000000000000000000000000000000000000..224f6e32e00fb80442f7549cae981ff26418cae1 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Summerfruit Light + Author: Christopher Corley (http://christop.club/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme summerfruit-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #FFFFFF Default Background +base01 #E0E0E0 Lighter Background (Used for status bars, line number and folding marks) +base02 #D0D0D0 Selection Background +base03 #B0B0B0 Comments, Invisibles, Line Highlighting +base04 #000000 Dark Foreground (Used for status bars) +base05 #101010 Default Foreground, Caret, Delimiters, Operators +base06 #151515 Light Foreground (Not often used) +base07 #202020 Light Background (Not often used) +base08 #FF0086 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #FD8900 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ABA800 Classes, Markup Bold, Search Text Background +base0B #00C918 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #1FAAAA Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #3777E6 Functions, Methods, Attribute IDs, Headings +base0E #AD00A1 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #CC6633 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #101010; + background: #FFFFFF +} +.hljs::selection, +.hljs ::selection { + background-color: #D0D0D0; + color: #101010 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #B0B0B0 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #B0B0B0 +} +/* base04 - #000000 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #000000 +} +/* base05 - #101010 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #101010 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #FF0086 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #FD8900 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ABA800 +} +.hljs-strong { + font-weight: bold; + color: #ABA800 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #00C918 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #1FAAAA +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #3777E6 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #AD00A1 +} +.hljs-emphasis { + color: #AD00A1; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #CC6633 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..958eda399d80513d100b24f105a60e1668a31e44 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/summerfruit-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Summerfruit Light + Author: Christopher Corley (http://christop.club/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#101010;background:#fff}.hljs ::selection,.hljs::selection{background-color:#d0d0d0;color:#101010}.hljs-comment{color:#b0b0b0}.hljs-tag{color:#000}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#101010}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#ff0086}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fd8900}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#aba800}.hljs-strong{font-weight:700;color:#aba800}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#00c918}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#1faaaa}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#3777e6}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ad00a1}.hljs-emphasis{color:#ad00a1;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c63}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-dark.css b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..a13e3e2efcb2ba66b32b7fe54402e42483ef9463 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-dark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Synth Midnight Terminal Dark + Author: Michaël Ball (http://github.com/michael-ball/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme synth-midnight-terminal-dark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #050608 Default Background +base01 #1a1b1c Lighter Background (Used for status bars, line number and folding marks) +base02 #28292a Selection Background +base03 #474849 Comments, Invisibles, Line Highlighting +base04 #a3a5a6 Dark Foreground (Used for status bars) +base05 #c1c3c4 Default Foreground, Caret, Delimiters, Operators +base06 #cfd1d2 Light Foreground (Not often used) +base07 #dddfe0 Light Background (Not often used) +base08 #b53b50 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ea770d Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #c9d364 Classes, Markup Bold, Search Text Background +base0B #06ea61 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #42fff9 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #03aeff Functions, Methods, Attribute IDs, Headings +base0E #ea5ce2 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #cd6320 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #c1c3c4; + background: #050608 +} +.hljs::selection, +.hljs ::selection { + background-color: #28292a; + color: #c1c3c4 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #474849 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #474849 +} +/* base04 - #a3a5a6 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a3a5a6 +} +/* base05 - #c1c3c4 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #c1c3c4 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #b53b50 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ea770d +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #c9d364 +} +.hljs-strong { + font-weight: bold; + color: #c9d364 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #06ea61 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #42fff9 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #03aeff +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #ea5ce2 +} +.hljs-emphasis { + color: #ea5ce2; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #cd6320 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-dark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..faa5d4dbe5387b3551a0249d3919873e02b382ca --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-dark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Synth Midnight Terminal Dark + Author: Michaël Ball (http://github.com/michael-ball/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c1c3c4;background:#050608}.hljs ::selection,.hljs::selection{background-color:#28292a;color:#c1c3c4}.hljs-comment{color:#474849}.hljs-tag{color:#a3a5a6}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#c1c3c4}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#b53b50}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ea770d}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#c9d364}.hljs-strong{font-weight:700;color:#c9d364}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#06ea61}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#42fff9}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#03aeff}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ea5ce2}.hljs-emphasis{color:#ea5ce2;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#cd6320}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-light.css b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-light.css new file mode 100644 index 0000000000000000000000000000000000000000..de3d8e18d053d1ca1daec0cce0e4a3f7f42677b0 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Synth Midnight Terminal Light + Author: Michaël Ball (http://github.com/michael-ball/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme synth-midnight-terminal-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #dddfe0 Default Background +base01 #cfd1d2 Lighter Background (Used for status bars, line number and folding marks) +base02 #c1c3c4 Selection Background +base03 #a3a5a6 Comments, Invisibles, Line Highlighting +base04 #474849 Dark Foreground (Used for status bars) +base05 #28292a Default Foreground, Caret, Delimiters, Operators +base06 #1a1b1c Light Foreground (Not often used) +base07 #050608 Light Background (Not often used) +base08 #b53b50 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ea770d Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #c9d364 Classes, Markup Bold, Search Text Background +base0B #06ea61 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #42fff9 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #03aeff Functions, Methods, Attribute IDs, Headings +base0E #ea5ce2 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #cd6320 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #28292a; + background: #dddfe0 +} +.hljs::selection, +.hljs ::selection { + background-color: #c1c3c4; + color: #28292a +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #a3a5a6 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #a3a5a6 +} +/* base04 - #474849 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #474849 +} +/* base05 - #28292a - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #28292a +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #b53b50 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ea770d +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #c9d364 +} +.hljs-strong { + font-weight: bold; + color: #c9d364 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #06ea61 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #42fff9 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #03aeff +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #ea5ce2 +} +.hljs-emphasis { + color: #ea5ce2; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #cd6320 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..579a65fee787033c3d7e752ae1aa34ab1a5243e7 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/synth-midnight-terminal-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Synth Midnight Terminal Light + Author: Michaël Ball (http://github.com/michael-ball/) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#28292a;background:#dddfe0}.hljs ::selection,.hljs::selection{background-color:#c1c3c4;color:#28292a}.hljs-comment{color:#a3a5a6}.hljs-tag{color:#474849}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#28292a}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#b53b50}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ea770d}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#c9d364}.hljs-strong{font-weight:700;color:#c9d364}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#06ea61}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#42fff9}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#03aeff}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ea5ce2}.hljs-emphasis{color:#ea5ce2;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#cd6320}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tango.css b/tools/ui/node_modules/highlight.js/styles/base16/tango.css new file mode 100644 index 0000000000000000000000000000000000000000..3a91f4e713079348528b2b136b0b7959a88d825d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tango.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Tango + Author: @Schnouki, based on the Tango Desktop Project + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme tango + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #2e3436 Default Background +base01 #8ae234 Lighter Background (Used for status bars, line number and folding marks) +base02 #fce94f Selection Background +base03 #555753 Comments, Invisibles, Line Highlighting +base04 #729fcf Dark Foreground (Used for status bars) +base05 #d3d7cf Default Foreground, Caret, Delimiters, Operators +base06 #ad7fa8 Light Foreground (Not often used) +base07 #eeeeec Light Background (Not often used) +base08 #cc0000 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ef2929 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #c4a000 Classes, Markup Bold, Search Text Background +base0B #4e9a06 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #06989a Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #3465a4 Functions, Methods, Attribute IDs, Headings +base0E #75507b Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #34e2e2 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #d3d7cf; + background: #2e3436 +} +.hljs::selection, +.hljs ::selection { + background-color: #fce94f; + color: #d3d7cf +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #555753 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #555753 +} +/* base04 - #729fcf - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #729fcf +} +/* base05 - #d3d7cf - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #d3d7cf +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #cc0000 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ef2929 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #c4a000 +} +.hljs-strong { + font-weight: bold; + color: #c4a000 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #4e9a06 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #06989a +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #3465a4 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #75507b +} +.hljs-emphasis { + color: #75507b; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #34e2e2 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tango.min.css b/tools/ui/node_modules/highlight.js/styles/base16/tango.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d37318ac129102360b2595070afd4d295df3c0df --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tango.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Tango + Author: @Schnouki, based on the Tango Desktop Project + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#d3d7cf;background:#2e3436}.hljs ::selection,.hljs::selection{background-color:#fce94f;color:#d3d7cf}.hljs-comment{color:#555753}.hljs-tag{color:#729fcf}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#d3d7cf}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c00}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ef2929}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#c4a000}.hljs-strong{font-weight:700;color:#c4a000}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#4e9a06}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#06989a}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#3465a4}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#75507b}.hljs-emphasis{color:#75507b;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#34e2e2}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tender.css b/tools/ui/node_modules/highlight.js/styles/base16/tender.css new file mode 100644 index 0000000000000000000000000000000000000000..5c9ec777d1d3a5b51895ac313cb596bc2a70ea1c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tender.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: tender + Author: Jacobo Tabernero (https://github/com/jacoborus/tender.vim) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme tender + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #282828 Default Background +base01 #383838 Lighter Background (Used for status bars, line number and folding marks) +base02 #484848 Selection Background +base03 #4c4c4c Comments, Invisibles, Line Highlighting +base04 #b8b8b8 Dark Foreground (Used for status bars) +base05 #eeeeee Default Foreground, Caret, Delimiters, Operators +base06 #e8e8e8 Light Foreground (Not often used) +base07 #feffff Light Background (Not often used) +base08 #f43753 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #dc9656 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ffc24b Classes, Markup Bold, Search Text Background +base0B #c9d05c Strings, Inherited Class, Markup Code, Diff Inserted +base0C #73cef4 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #b3deef Functions, Methods, Attribute IDs, Headings +base0E #d3b987 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #a16946 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #eeeeee; + background: #282828 +} +.hljs::selection, +.hljs ::selection { + background-color: #484848; + color: #eeeeee +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #4c4c4c - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #4c4c4c +} +/* base04 - #b8b8b8 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b8b8b8 +} +/* base05 - #eeeeee - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #eeeeee +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #f43753 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #dc9656 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ffc24b +} +.hljs-strong { + font-weight: bold; + color: #ffc24b +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #c9d05c +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #73cef4 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #b3deef +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #d3b987 +} +.hljs-emphasis { + color: #d3b987; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #a16946 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tender.min.css b/tools/ui/node_modules/highlight.js/styles/base16/tender.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c72c7dfdf2356f061a55401ddaafacf855aa912b --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tender.min.css @@ -0,0 +1,7 @@ +/*! + Theme: tender + Author: Jacobo Tabernero (https://github/com/jacoborus/tender.vim) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#eee;background:#282828}.hljs ::selection,.hljs::selection{background-color:#484848;color:#eee}.hljs-comment{color:#4c4c4c}.hljs-tag{color:#b8b8b8}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#eee}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f43753}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#dc9656}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ffc24b}.hljs-strong{font-weight:700;color:#ffc24b}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#c9d05c}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#73cef4}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#b3deef}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#d3b987}.hljs-emphasis{color:#d3b987;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a16946}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tomorrow-night.css b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow-night.css new file mode 100644 index 0000000000000000000000000000000000000000..2c3750e19a1d4ae41caed2e82506ca50bd704804 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow-night.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Tomorrow Night + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme tomorrow-night + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #2d2d2d Default Background +base01 #393939 Lighter Background (Used for status bars, line number and folding marks) +base02 #515151 Selection Background +base03 #999999 Comments, Invisibles, Line Highlighting +base04 #b4b7b4 Dark Foreground (Used for status bars) +base05 #cccccc Default Foreground, Caret, Delimiters, Operators +base06 #e0e0e0 Light Foreground (Not often used) +base07 #ffffff Light Background (Not often used) +base08 #f2777a Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #f99157 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ffcc66 Classes, Markup Bold, Search Text Background +base0B #99cc99 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #66cccc Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #6699cc Functions, Methods, Attribute IDs, Headings +base0E #cc99cc Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #a3685a Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #cccccc; + background: #2d2d2d +} +.hljs::selection, +.hljs ::selection { + background-color: #515151; + color: #cccccc +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #999999 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #999999 +} +/* base04 - #b4b7b4 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b4b7b4 +} +/* base05 - #cccccc - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #cccccc +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #f2777a +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #f99157 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ffcc66 +} +.hljs-strong { + font-weight: bold; + color: #ffcc66 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #99cc99 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #66cccc +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #6699cc +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #cc99cc +} +.hljs-emphasis { + color: #cc99cc; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #a3685a +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tomorrow-night.min.css b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow-night.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a0b3f625aaa288cbe5ad2b153ea6417028ceee6f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow-night.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Tomorrow Night + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tomorrow.css b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow.css new file mode 100644 index 0000000000000000000000000000000000000000..bda285dac9ef312e8187fb29ab1dbd9d90f4e2d4 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Tomorrow + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme tomorrow + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #ffffff Default Background +base01 #e0e0e0 Lighter Background (Used for status bars, line number and folding marks) +base02 #d6d6d6 Selection Background +base03 #8e908c Comments, Invisibles, Line Highlighting +base04 #969896 Dark Foreground (Used for status bars) +base05 #4d4d4c Default Foreground, Caret, Delimiters, Operators +base06 #282a2e Light Foreground (Not often used) +base07 #1d1f21 Light Background (Not often used) +base08 #c82829 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #f5871f Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #eab700 Classes, Markup Bold, Search Text Background +base0B #718c00 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #3e999f Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #4271ae Functions, Methods, Attribute IDs, Headings +base0E #8959a8 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #a3685a Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #4d4d4c; + background: #ffffff +} +.hljs::selection, +.hljs ::selection { + background-color: #d6d6d6; + color: #4d4d4c +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #8e908c - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #8e908c +} +/* base04 - #969896 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #969896 +} +/* base05 - #4d4d4c - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #4d4d4c +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #c82829 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #f5871f +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #eab700 +} +.hljs-strong { + font-weight: bold; + color: #eab700 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #718c00 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #3e999f +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #4271ae +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #8959a8 +} +.hljs-emphasis { + color: #8959a8; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #a3685a +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/tomorrow.min.css b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow.min.css new file mode 100644 index 0000000000000000000000000000000000000000..5785f6efcc42ce90af949cd7b11747fc48cfcf09 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/tomorrow.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Tomorrow + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#4d4d4c;background:#fff}.hljs ::selection,.hljs::selection{background-color:#d6d6d6;color:#4d4d4c}.hljs-comment{color:#8e908c}.hljs-tag{color:#969896}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#4d4d4c}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c82829}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f5871f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#eab700}.hljs-strong{font-weight:700;color:#eab700}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#718c00}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3e999f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4271ae}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#8959a8}.hljs-emphasis{color:#8959a8;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/twilight.css b/tools/ui/node_modules/highlight.js/styles/base16/twilight.css new file mode 100644 index 0000000000000000000000000000000000000000..0bde680a711785ae17a7169ecb4e7cace6a136ea --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/twilight.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Twilight + Author: David Hart (https://github.com/hartbit) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme twilight + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #1e1e1e Default Background +base01 #323537 Lighter Background (Used for status bars, line number and folding marks) +base02 #464b50 Selection Background +base03 #5f5a60 Comments, Invisibles, Line Highlighting +base04 #838184 Dark Foreground (Used for status bars) +base05 #a7a7a7 Default Foreground, Caret, Delimiters, Operators +base06 #c3c3c3 Light Foreground (Not often used) +base07 #ffffff Light Background (Not often used) +base08 #cf6a4c Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #cda869 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f9ee98 Classes, Markup Bold, Search Text Background +base0B #8f9d6a Strings, Inherited Class, Markup Code, Diff Inserted +base0C #afc4db Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #7587a6 Functions, Methods, Attribute IDs, Headings +base0E #9b859d Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #9b703f Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #a7a7a7; + background: #1e1e1e +} +.hljs::selection, +.hljs ::selection { + background-color: #464b50; + color: #a7a7a7 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #5f5a60 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #5f5a60 +} +/* base04 - #838184 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #838184 +} +/* base05 - #a7a7a7 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #a7a7a7 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #cf6a4c +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #cda869 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f9ee98 +} +.hljs-strong { + font-weight: bold; + color: #f9ee98 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #8f9d6a +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #afc4db +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #7587a6 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #9b859d +} +.hljs-emphasis { + color: #9b859d; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #9b703f +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/twilight.min.css b/tools/ui/node_modules/highlight.js/styles/base16/twilight.min.css new file mode 100644 index 0000000000000000000000000000000000000000..0a8f5f9f77f44d537e6c6dbf1c2e30c3a32d5a5f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/twilight.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Twilight + Author: David Hart (https://github.com/hartbit) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#a7a7a7;background:#1e1e1e}.hljs ::selection,.hljs::selection{background-color:#464b50;color:#a7a7a7}.hljs-comment{color:#5f5a60}.hljs-tag{color:#838184}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#a7a7a7}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#cf6a4c}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#cda869}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f9ee98}.hljs-strong{font-weight:700;color:#f9ee98}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#8f9d6a}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#afc4db}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#7587a6}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#9b859d}.hljs-emphasis{color:#9b859d;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#9b703f}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/unikitty-dark.css b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..02bb32de3f72909dbb442cc12806b5db1ddb3da3 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-dark.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Unikitty Dark + Author: Josh W Lewis (@joshwlewis) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme unikitty-dark + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #2e2a31 Default Background +base01 #4a464d Lighter Background (Used for status bars, line number and folding marks) +base02 #666369 Selection Background +base03 #838085 Comments, Invisibles, Line Highlighting +base04 #9f9da2 Dark Foreground (Used for status bars) +base05 #bcbabe Default Foreground, Caret, Delimiters, Operators +base06 #d8d7da Light Foreground (Not often used) +base07 #f5f4f7 Light Background (Not often used) +base08 #d8137f Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d65407 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #dc8a0e Classes, Markup Bold, Search Text Background +base0B #17ad98 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #149bda Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #796af5 Functions, Methods, Attribute IDs, Headings +base0E #bb60ea Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #c720ca Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #bcbabe; + background: #2e2a31 +} +.hljs::selection, +.hljs ::selection { + background-color: #666369; + color: #bcbabe +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #838085 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #838085 +} +/* base04 - #9f9da2 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #9f9da2 +} +/* base05 - #bcbabe - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #bcbabe +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #d8137f +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d65407 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #dc8a0e +} +.hljs-strong { + font-weight: bold; + color: #dc8a0e +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #17ad98 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #149bda +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #796af5 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #bb60ea +} +.hljs-emphasis { + color: #bb60ea; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #c720ca +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/unikitty-dark.min.css b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..752d90ad66672fb496455eb52b793ba46959f703 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-dark.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Unikitty Dark + Author: Josh W Lewis (@joshwlewis) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#bcbabe;background:#2e2a31}.hljs ::selection,.hljs::selection{background-color:#666369;color:#bcbabe}.hljs-comment{color:#838085}.hljs-tag{color:#9f9da2}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#bcbabe}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#d8137f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d65407}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#dc8a0e}.hljs-strong{font-weight:700;color:#dc8a0e}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#17ad98}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#149bda}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#796af5}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#bb60ea}.hljs-emphasis{color:#bb60ea;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c720ca}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/unikitty-light.css b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-light.css new file mode 100644 index 0000000000000000000000000000000000000000..a1ba697530927be15959da0f8971e2775ccb219b --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Unikitty Light + Author: Josh W Lewis (@joshwlewis) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme unikitty-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #ffffff Default Background +base01 #e1e1e2 Lighter Background (Used for status bars, line number and folding marks) +base02 #c4c3c5 Selection Background +base03 #a7a5a8 Comments, Invisibles, Line Highlighting +base04 #89878b Dark Foreground (Used for status bars) +base05 #6c696e Default Foreground, Caret, Delimiters, Operators +base06 #4f4b51 Light Foreground (Not often used) +base07 #322d34 Light Background (Not often used) +base08 #d8137f Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #d65407 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #dc8a0e Classes, Markup Bold, Search Text Background +base0B #17ad98 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #149bda Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #775dff Functions, Methods, Attribute IDs, Headings +base0E #aa17e6 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #e013d0 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #6c696e; + background: #ffffff +} +.hljs::selection, +.hljs ::selection { + background-color: #c4c3c5; + color: #6c696e +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #a7a5a8 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #a7a5a8 +} +/* base04 - #89878b - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #89878b +} +/* base05 - #6c696e - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #6c696e +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #d8137f +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #d65407 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #dc8a0e +} +.hljs-strong { + font-weight: bold; + color: #dc8a0e +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #17ad98 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #149bda +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #775dff +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #aa17e6 +} +.hljs-emphasis { + color: #aa17e6; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #e013d0 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/unikitty-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..fe74653d48f9ba546cb9ef2d6c920163b36001f3 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/unikitty-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Unikitty Light + Author: Josh W Lewis (@joshwlewis) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#6c696e;background:#fff}.hljs ::selection,.hljs::selection{background-color:#c4c3c5;color:#6c696e}.hljs-comment{color:#a7a5a8}.hljs-tag{color:#89878b}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#6c696e}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#d8137f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#d65407}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#dc8a0e}.hljs-strong{font-weight:700;color:#dc8a0e}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#17ad98}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#149bda}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#775dff}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#aa17e6}.hljs-emphasis{color:#aa17e6;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#e013d0}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/vulcan.css b/tools/ui/node_modules/highlight.js/styles/base16/vulcan.css new file mode 100644 index 0000000000000000000000000000000000000000..dc2ac1a15878c352aad2dd94e037c8ef0edc6ec6 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/vulcan.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: vulcan + Author: Andrey Varfolomeev + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme vulcan + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #041523 Default Background +base01 #122339 Lighter Background (Used for status bars, line number and folding marks) +base02 #003552 Selection Background +base03 #7a5759 Comments, Invisibles, Line Highlighting +base04 #6b6977 Dark Foreground (Used for status bars) +base05 #5b778c Default Foreground, Caret, Delimiters, Operators +base06 #333238 Light Foreground (Not often used) +base07 #214d68 Light Background (Not often used) +base08 #818591 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #9198a3 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #adb4b9 Classes, Markup Bold, Search Text Background +base0B #977d7c Strings, Inherited Class, Markup Code, Diff Inserted +base0C #977d7c Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #977d7c Functions, Methods, Attribute IDs, Headings +base0E #9198a3 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #977d7c Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #5b778c; + background: #041523 +} +.hljs::selection, +.hljs ::selection { + background-color: #003552; + color: #5b778c +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #7a5759 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #7a5759 +} +/* base04 - #6b6977 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #6b6977 +} +/* base05 - #5b778c - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #5b778c +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #818591 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #9198a3 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #adb4b9 +} +.hljs-strong { + font-weight: bold; + color: #adb4b9 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #977d7c +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #977d7c +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #977d7c +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #9198a3 +} +.hljs-emphasis { + color: #9198a3; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #977d7c +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/vulcan.min.css b/tools/ui/node_modules/highlight.js/styles/base16/vulcan.min.css new file mode 100644 index 0000000000000000000000000000000000000000..3c88968ebffb5806fae3b20dddda2ac45e91fdea --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/vulcan.min.css @@ -0,0 +1,7 @@ +/*! + Theme: vulcan + Author: Andrey Varfolomeev + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#5b778c;background:#041523}.hljs ::selection,.hljs::selection{background-color:#003552;color:#5b778c}.hljs-comment{color:#7a5759}.hljs-tag{color:#6b6977}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#5b778c}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#818591}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#9198a3}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#adb4b9}.hljs-strong{font-weight:700;color:#adb4b9}.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-code,.hljs-doctag,.hljs-function .hljs-title,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp,.hljs-section,.hljs-string,.hljs-title.class_.inherited__,.hljs-title.function_,.ruby .hljs-property{color:#977d7c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#9198a3}.hljs-emphasis{color:#9198a3;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#977d7c}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-10-light.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-10-light.css new file mode 100644 index 0000000000000000000000000000000000000000..022e40a0ec4d72d3e240ecde0a27fb174dae2b3e --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-10-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows 10 Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-10-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #f2f2f2 Default Background +base01 #e5e5e5 Lighter Background (Used for status bars, line number and folding marks) +base02 #d9d9d9 Selection Background +base03 #cccccc Comments, Invisibles, Line Highlighting +base04 #ababab Dark Foreground (Used for status bars) +base05 #767676 Default Foreground, Caret, Delimiters, Operators +base06 #414141 Light Foreground (Not often used) +base07 #0c0c0c Light Background (Not often used) +base08 #c50f1f Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #f9f1a5 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #c19c00 Classes, Markup Bold, Search Text Background +base0B #13a10e Strings, Inherited Class, Markup Code, Diff Inserted +base0C #3a96dd Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #0037da Functions, Methods, Attribute IDs, Headings +base0E #881798 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #16c60c Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #767676; + background: #f2f2f2 +} +.hljs::selection, +.hljs ::selection { + background-color: #d9d9d9; + color: #767676 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #cccccc - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #cccccc +} +/* base04 - #ababab - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #ababab +} +/* base05 - #767676 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #767676 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #c50f1f +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #f9f1a5 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #c19c00 +} +.hljs-strong { + font-weight: bold; + color: #c19c00 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #13a10e +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #3a96dd +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #0037da +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #881798 +} +.hljs-emphasis { + color: #881798; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #16c60c +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-10-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-10-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b27b99f530296ca35d009af3491894a7fcbcced9 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-10-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows 10 Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#767676;background:#f2f2f2}.hljs ::selection,.hljs::selection{background-color:#d9d9d9;color:#767676}.hljs-comment{color:#ccc}.hljs-tag{color:#ababab}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#767676}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c50f1f}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f9f1a5}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#c19c00}.hljs-strong{font-weight:700;color:#c19c00}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#13a10e}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3a96dd}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#0037da}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#881798}.hljs-emphasis{color:#881798;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#16c60c}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-10.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-10.css new file mode 100644 index 0000000000000000000000000000000000000000..f0f0e2dcd2a8dab4a9a8a3c66eb6154776ef23bd --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-10.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows 10 + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-10 + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #0c0c0c Default Background +base01 #2f2f2f Lighter Background (Used for status bars, line number and folding marks) +base02 #535353 Selection Background +base03 #767676 Comments, Invisibles, Line Highlighting +base04 #b9b9b9 Dark Foreground (Used for status bars) +base05 #cccccc Default Foreground, Caret, Delimiters, Operators +base06 #dfdfdf Light Foreground (Not often used) +base07 #f2f2f2 Light Background (Not often used) +base08 #e74856 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #c19c00 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #f9f1a5 Classes, Markup Bold, Search Text Background +base0B #16c60c Strings, Inherited Class, Markup Code, Diff Inserted +base0C #61d6d6 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #3b78ff Functions, Methods, Attribute IDs, Headings +base0E #b4009e Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #13a10e Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #cccccc; + background: #0c0c0c +} +.hljs::selection, +.hljs ::selection { + background-color: #535353; + color: #cccccc +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #767676 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #767676 +} +/* base04 - #b9b9b9 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b9b9b9 +} +/* base05 - #cccccc - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #cccccc +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #e74856 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #c19c00 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #f9f1a5 +} +.hljs-strong { + font-weight: bold; + color: #f9f1a5 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #16c60c +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #61d6d6 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #3b78ff +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #b4009e +} +.hljs-emphasis { + color: #b4009e; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #13a10e +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-10.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-10.min.css new file mode 100644 index 0000000000000000000000000000000000000000..296b84c5da4abcf4c3528c06eb1e7ff7a74eb78c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-10.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows 10 + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#0c0c0c}.hljs ::selection,.hljs::selection{background-color:#535353;color:#ccc}.hljs-comment{color:#767676}.hljs-tag{color:#b9b9b9}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#e74856}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#c19c00}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f9f1a5}.hljs-strong{font-weight:700;color:#f9f1a5}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#16c60c}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#61d6d6}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#3b78ff}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b4009e}.hljs-emphasis{color:#b4009e;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#13a10e}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-95-light.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-95-light.css new file mode 100644 index 0000000000000000000000000000000000000000..bbf034dc42943fb30666f0a36b44061cbdc8679e --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-95-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows 95 Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-95-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #fcfcfc Default Background +base01 #e0e0e0 Lighter Background (Used for status bars, line number and folding marks) +base02 #c4c4c4 Selection Background +base03 #a8a8a8 Comments, Invisibles, Line Highlighting +base04 #7e7e7e Dark Foreground (Used for status bars) +base05 #545454 Default Foreground, Caret, Delimiters, Operators +base06 #2a2a2a Light Foreground (Not often used) +base07 #000000 Light Background (Not often used) +base08 #a80000 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #fcfc54 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #a85400 Classes, Markup Bold, Search Text Background +base0B #00a800 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #00a8a8 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #0000a8 Functions, Methods, Attribute IDs, Headings +base0E #a800a8 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #54fc54 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #545454; + background: #fcfcfc +} +.hljs::selection, +.hljs ::selection { + background-color: #c4c4c4; + color: #545454 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #a8a8a8 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #a8a8a8 +} +/* base04 - #7e7e7e - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #7e7e7e +} +/* base05 - #545454 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #545454 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #a80000 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #fcfc54 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #a85400 +} +.hljs-strong { + font-weight: bold; + color: #a85400 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #00a800 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #00a8a8 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #0000a8 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #a800a8 +} +.hljs-emphasis { + color: #a800a8; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #54fc54 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-95-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-95-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c30dd2443098fc21c2850f3969d2fde5fa07f94d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-95-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows 95 Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#545454;background:#fcfcfc}.hljs ::selection,.hljs::selection{background-color:#c4c4c4;color:#545454}.hljs-comment{color:#a8a8a8}.hljs-tag{color:#7e7e7e}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#545454}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#a80000}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fcfc54}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#a85400}.hljs-strong{font-weight:700;color:#a85400}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#00a800}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#00a8a8}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#0000a8}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#a800a8}.hljs-emphasis{color:#a800a8;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#54fc54}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-95.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-95.css new file mode 100644 index 0000000000000000000000000000000000000000..002d6f940ddcb95ae72f1a2924bfc7de9b4fdbeb --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-95.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows 95 + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-95 + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #000000 Default Background +base01 #1C1C1C Lighter Background (Used for status bars, line number and folding marks) +base02 #383838 Selection Background +base03 #545454 Comments, Invisibles, Line Highlighting +base04 #7e7e7e Dark Foreground (Used for status bars) +base05 #a8a8a8 Default Foreground, Caret, Delimiters, Operators +base06 #d2d2d2 Light Foreground (Not often used) +base07 #fcfcfc Light Background (Not often used) +base08 #fc5454 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #a85400 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #fcfc54 Classes, Markup Bold, Search Text Background +base0B #54fc54 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #54fcfc Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #5454fc Functions, Methods, Attribute IDs, Headings +base0E #fc54fc Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #00a800 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #a8a8a8; + background: #000000 +} +.hljs::selection, +.hljs ::selection { + background-color: #383838; + color: #a8a8a8 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #545454 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #545454 +} +/* base04 - #7e7e7e - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #7e7e7e +} +/* base05 - #a8a8a8 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #a8a8a8 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #fc5454 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #a85400 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #fcfc54 +} +.hljs-strong { + font-weight: bold; + color: #fcfc54 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #54fc54 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #54fcfc +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #5454fc +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #fc54fc +} +.hljs-emphasis { + color: #fc54fc; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #00a800 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-95.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-95.min.css new file mode 100644 index 0000000000000000000000000000000000000000..962d307da1fdf37c55b6a6a5e8194be14fd913b4 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-95.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows 95 + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#a8a8a8;background:#000}.hljs ::selection,.hljs::selection{background-color:#383838;color:#a8a8a8}.hljs-comment{color:#545454}.hljs-tag{color:#7e7e7e}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#a8a8a8}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#fc5454}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#a85400}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fcfc54}.hljs-strong{font-weight:700;color:#fcfc54}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#54fc54}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#54fcfc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#5454fc}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#fc54fc}.hljs-emphasis{color:#fc54fc;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#00a800}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast-light.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast-light.css new file mode 100644 index 0000000000000000000000000000000000000000..5589678381e65ffa2760563985af9a11eac3a047 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows High Contrast Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-high-contrast-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #fcfcfc Default Background +base01 #e8e8e8 Lighter Background (Used for status bars, line number and folding marks) +base02 #d4d4d4 Selection Background +base03 #c0c0c0 Comments, Invisibles, Line Highlighting +base04 #7e7e7e Dark Foreground (Used for status bars) +base05 #545454 Default Foreground, Caret, Delimiters, Operators +base06 #2a2a2a Light Foreground (Not often used) +base07 #000000 Light Background (Not often used) +base08 #800000 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #fcfc54 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #808000 Classes, Markup Bold, Search Text Background +base0B #008000 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #008080 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #000080 Functions, Methods, Attribute IDs, Headings +base0E #800080 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #54fc54 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #545454; + background: #fcfcfc +} +.hljs::selection, +.hljs ::selection { + background-color: #d4d4d4; + color: #545454 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #c0c0c0 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #c0c0c0 +} +/* base04 - #7e7e7e - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #7e7e7e +} +/* base05 - #545454 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #545454 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #800000 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #fcfc54 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #808000 +} +.hljs-strong { + font-weight: bold; + color: #808000 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #008000 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #008080 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #000080 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #800080 +} +.hljs-emphasis { + color: #800080; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #54fc54 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..fb24f756239deaf581b273d925d11c5a5762c829 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows High Contrast Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#545454;background:#fcfcfc}.hljs ::selection,.hljs::selection{background-color:#d4d4d4;color:#545454}.hljs-comment{color:silver}.hljs-tag{color:#7e7e7e}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#545454}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:maroon}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fcfc54}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:olive}.hljs-strong{font-weight:700;color:olive}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:green}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:teal}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:navy}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:purple}.hljs-emphasis{color:purple;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#54fc54}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast.css new file mode 100644 index 0000000000000000000000000000000000000000..1ad278de84cd7616bc9054fbe0c487e8ccf647fa --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows High Contrast + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-high-contrast + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #000000 Default Background +base01 #1C1C1C Lighter Background (Used for status bars, line number and folding marks) +base02 #383838 Selection Background +base03 #545454 Comments, Invisibles, Line Highlighting +base04 #a2a2a2 Dark Foreground (Used for status bars) +base05 #c0c0c0 Default Foreground, Caret, Delimiters, Operators +base06 #dedede Light Foreground (Not often used) +base07 #fcfcfc Light Background (Not often used) +base08 #fc5454 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #808000 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #fcfc54 Classes, Markup Bold, Search Text Background +base0B #54fc54 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #54fcfc Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #5454fc Functions, Methods, Attribute IDs, Headings +base0E #fc54fc Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #008000 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #c0c0c0; + background: #000000 +} +.hljs::selection, +.hljs ::selection { + background-color: #383838; + color: #c0c0c0 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #545454 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #545454 +} +/* base04 - #a2a2a2 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a2a2a2 +} +/* base05 - #c0c0c0 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #c0c0c0 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #fc5454 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #808000 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #fcfc54 +} +.hljs-strong { + font-weight: bold; + color: #fcfc54 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #54fc54 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #54fcfc +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #5454fc +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #fc54fc +} +.hljs-emphasis { + color: #fc54fc; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #008000 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast.min.css new file mode 100644 index 0000000000000000000000000000000000000000..363f5901f858234ec5f80e4d8a6eafdd1ff5c8f2 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-high-contrast.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows High Contrast + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:silver;background:#000}.hljs ::selection,.hljs::selection{background-color:#383838;color:silver}.hljs-comment{color:#545454}.hljs-tag{color:#a2a2a2}.hljs-operator,.hljs-punctuation,.hljs-subst{color:silver}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#fc5454}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:olive}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fcfc54}.hljs-strong{font-weight:700;color:#fcfc54}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#54fc54}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#54fcfc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#5454fc}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#fc54fc}.hljs-emphasis{color:#fc54fc;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:green}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-nt-light.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt-light.css new file mode 100644 index 0000000000000000000000000000000000000000..a029d7d28495fff217706ab386f155321c5e9d27 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt-light.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows NT Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-nt-light + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #ffffff Default Background +base01 #eaeaea Lighter Background (Used for status bars, line number and folding marks) +base02 #d5d5d5 Selection Background +base03 #c0c0c0 Comments, Invisibles, Line Highlighting +base04 #a0a0a0 Dark Foreground (Used for status bars) +base05 #808080 Default Foreground, Caret, Delimiters, Operators +base06 #404040 Light Foreground (Not often used) +base07 #000000 Light Background (Not often used) +base08 #800000 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ffff00 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #808000 Classes, Markup Bold, Search Text Background +base0B #008000 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #008080 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #000080 Functions, Methods, Attribute IDs, Headings +base0E #800080 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #00ff00 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #808080; + background: #ffffff +} +.hljs::selection, +.hljs ::selection { + background-color: #d5d5d5; + color: #808080 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #c0c0c0 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #c0c0c0 +} +/* base04 - #a0a0a0 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a0a0a0 +} +/* base05 - #808080 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #808080 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #800000 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ffff00 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #808000 +} +.hljs-strong { + font-weight: bold; + color: #808000 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #008000 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #008080 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #000080 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #800080 +} +.hljs-emphasis { + color: #800080; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #00ff00 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-nt-light.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..4332edfb30fdad2fcde740ab92fb4aee6d1fb98f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt-light.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows NT Light + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:grey;background:#fff}.hljs ::selection,.hljs::selection{background-color:#d5d5d5;color:grey}.hljs-comment{color:silver}.hljs-tag{color:#a0a0a0}.hljs-operator,.hljs-punctuation,.hljs-subst{color:grey}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:maroon}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ff0}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:olive}.hljs-strong{font-weight:700;color:olive}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:green}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:teal}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:navy}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:purple}.hljs-emphasis{color:purple;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#0f0}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-nt.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt.css new file mode 100644 index 0000000000000000000000000000000000000000..4a2608bc1bf221631529f035ad8ff0d326af5a0d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Windows NT + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme windows-nt + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #000000 Default Background +base01 #2a2a2a Lighter Background (Used for status bars, line number and folding marks) +base02 #555555 Selection Background +base03 #808080 Comments, Invisibles, Line Highlighting +base04 #a1a1a1 Dark Foreground (Used for status bars) +base05 #c0c0c0 Default Foreground, Caret, Delimiters, Operators +base06 #e0e0e0 Light Foreground (Not often used) +base07 #ffffff Light Background (Not often used) +base08 #ff0000 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #808000 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #ffff00 Classes, Markup Bold, Search Text Background +base0B #00ff00 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #00ffff Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #0000ff Functions, Methods, Attribute IDs, Headings +base0E #ff00ff Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #008000 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #c0c0c0; + background: #000000 +} +.hljs::selection, +.hljs ::selection { + background-color: #555555; + color: #c0c0c0 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #808080 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #808080 +} +/* base04 - #a1a1a1 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #a1a1a1 +} +/* base05 - #c0c0c0 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #c0c0c0 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #ff0000 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #808000 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #ffff00 +} +.hljs-strong { + font-weight: bold; + color: #ffff00 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #00ff00 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #00ffff +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #0000ff +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #ff00ff +} +.hljs-emphasis { + color: #ff00ff; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #008000 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/windows-nt.min.css b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b37fdf59a8e1ad54ef9882e9a27ba7bc2da2cb1c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/windows-nt.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Windows NT + Author: Fergus Collins (https://github.com/C-Fergus) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:silver;background:#000}.hljs ::selection,.hljs::selection{background-color:#555;color:silver}.hljs-comment{color:grey}.hljs-tag{color:#a1a1a1}.hljs-operator,.hljs-punctuation,.hljs-subst{color:silver}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:red}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:olive}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#ff0}.hljs-strong{font-weight:700;color:#ff0}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#0f0}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#0ff}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#00f}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#f0f}.hljs-emphasis{color:#f0f;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:green}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/woodland.css b/tools/ui/node_modules/highlight.js/styles/base16/woodland.css new file mode 100644 index 0000000000000000000000000000000000000000..128ad4e8a664351ad7801e9c91246166b142c923 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/woodland.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Woodland + Author: Jay Cornwall (https://jcornwall.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme woodland + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #231e18 Default Background +base01 #302b25 Lighter Background (Used for status bars, line number and folding marks) +base02 #48413a Selection Background +base03 #9d8b70 Comments, Invisibles, Line Highlighting +base04 #b4a490 Dark Foreground (Used for status bars) +base05 #cabcb1 Default Foreground, Caret, Delimiters, Operators +base06 #d7c8bc Light Foreground (Not often used) +base07 #e4d4c8 Light Background (Not often used) +base08 #d35c5c Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #ca7f32 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #e0ac16 Classes, Markup Bold, Search Text Background +base0B #b7ba53 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #6eb958 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #88a4d3 Functions, Methods, Attribute IDs, Headings +base0E #bb90e2 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #b49368 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #cabcb1; + background: #231e18 +} +.hljs::selection, +.hljs ::selection { + background-color: #48413a; + color: #cabcb1 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #9d8b70 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #9d8b70 +} +/* base04 - #b4a490 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #b4a490 +} +/* base05 - #cabcb1 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #cabcb1 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #d35c5c +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #ca7f32 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #e0ac16 +} +.hljs-strong { + font-weight: bold; + color: #e0ac16 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #b7ba53 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #6eb958 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #88a4d3 +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #bb90e2 +} +.hljs-emphasis { + color: #bb90e2; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #b49368 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/woodland.min.css b/tools/ui/node_modules/highlight.js/styles/base16/woodland.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a83a68b563cbd6c9de87fabb523a43633b136888 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/woodland.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Woodland + Author: Jay Cornwall (https://jcornwall.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#cabcb1;background:#231e18}.hljs ::selection,.hljs::selection{background-color:#48413a;color:#cabcb1}.hljs-comment{color:#9d8b70}.hljs-tag{color:#b4a490}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#cabcb1}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#d35c5c}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#ca7f32}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#e0ac16}.hljs-strong{font-weight:700;color:#e0ac16}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#b7ba53}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6eb958}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#88a4d3}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#bb90e2}.hljs-emphasis{color:#bb90e2;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#b49368}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/xcode-dusk.css b/tools/ui/node_modules/highlight.js/styles/base16/xcode-dusk.css new file mode 100644 index 0000000000000000000000000000000000000000..e765a9839138fe8f9b7d6f6e7bc1e2ae40f0e7cf --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/xcode-dusk.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: XCode Dusk + Author: Elsa Gonsiorowski (https://github.com/gonsie) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme xcode-dusk + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #282B35 Default Background +base01 #3D4048 Lighter Background (Used for status bars, line number and folding marks) +base02 #53555D Selection Background +base03 #686A71 Comments, Invisibles, Line Highlighting +base04 #7E8086 Dark Foreground (Used for status bars) +base05 #939599 Default Foreground, Caret, Delimiters, Operators +base06 #A9AAAE Light Foreground (Not often used) +base07 #BEBFC2 Light Background (Not often used) +base08 #B21889 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #786DC5 Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #438288 Classes, Markup Bold, Search Text Background +base0B #DF0002 Strings, Inherited Class, Markup Code, Diff Inserted +base0C #00A0BE Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #790EAD Functions, Methods, Attribute IDs, Headings +base0E #B21889 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #C77C48 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #939599; + background: #282B35 +} +.hljs::selection, +.hljs ::selection { + background-color: #53555D; + color: #939599 +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #686A71 - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #686A71 +} +/* base04 - #7E8086 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #7E8086 +} +/* base05 - #939599 - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #939599 +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #B21889 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #786DC5 +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #438288 +} +.hljs-strong { + font-weight: bold; + color: #438288 +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #DF0002 +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #00A0BE +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #790EAD +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #B21889 +} +.hljs-emphasis { + color: #B21889; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #C77C48 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/xcode-dusk.min.css b/tools/ui/node_modules/highlight.js/styles/base16/xcode-dusk.min.css new file mode 100644 index 0000000000000000000000000000000000000000..7cf105a38f4ceeb1547da24c765198562ad11135 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/xcode-dusk.min.css @@ -0,0 +1,7 @@ +/*! + Theme: XCode Dusk + Author: Elsa Gonsiorowski (https://github.com/gonsie) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#939599;background:#282b35}.hljs ::selection,.hljs::selection{background-color:#53555d;color:#939599}.hljs-comment{color:#686a71}.hljs-tag{color:#7e8086}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#939599}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#b21889}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#786dc5}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#438288}.hljs-strong{font-weight:700;color:#438288}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#df0002}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#00a0be}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#790ead}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#b21889}.hljs-emphasis{color:#b21889;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c77c48}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/zenburn.css b/tools/ui/node_modules/highlight.js/styles/base16/zenburn.css new file mode 100644 index 0000000000000000000000000000000000000000..cc69301842d91548e1e63c9591cdea0060cb1836 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/zenburn.css @@ -0,0 +1,163 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Zenburn + Author: elnawe + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/ +/* + WARNING: DO NOT EDIT THIS FILE DIRECTLY. + + This theme file was auto-generated from the Base16 scheme zenburn + by the Highlight.js Base16 template builder. + + - https://github.com/highlightjs/base16-highlightjs +*/ +/* +base00 #383838 Default Background +base01 #404040 Lighter Background (Used for status bars, line number and folding marks) +base02 #606060 Selection Background +base03 #6f6f6f Comments, Invisibles, Line Highlighting +base04 #808080 Dark Foreground (Used for status bars) +base05 #dcdccc Default Foreground, Caret, Delimiters, Operators +base06 #c0c0c0 Light Foreground (Not often used) +base07 #ffffff Light Background (Not often used) +base08 #dca3a3 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted +base09 #dfaf8f Integers, Boolean, Constants, XML Attributes, Markup Link Url +base0A #e0cf9f Classes, Markup Bold, Search Text Background +base0B #5f7f5f Strings, Inherited Class, Markup Code, Diff Inserted +base0C #93e0e3 Support, Regular Expressions, Escape Characters, Markup Quotes +base0D #7cb8bb Functions, Methods, Attribute IDs, Headings +base0E #dc8cc3 Keywords, Storage, Selector, Markup Italic, Diff Changed +base0F #000000 Deprecated, Opening/Closing Embedded Language Tags, e.g. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +.hljs { + color: #dcdccc; + background: #383838 +} +.hljs::selection, +.hljs ::selection { + background-color: #606060; + color: #dcdccc +} +/* purposely do not highlight these things */ +.hljs-formula, +.hljs-params, +.hljs-property { + +} +/* base03 - #6f6f6f - Comments, Invisibles, Line Highlighting */ +.hljs-comment { + color: #6f6f6f +} +/* base04 - #808080 - Dark Foreground (Used for status bars) */ +.hljs-tag { + color: #808080 +} +/* base05 - #dcdccc - Default Foreground, Caret, Delimiters, Operators */ +.hljs-subst, +.hljs-punctuation, +.hljs-operator { + color: #dcdccc +} +.hljs-operator { + opacity: 0.7 +} +/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */ +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-tag, +.hljs-name, +.hljs-deletion { + color: #dca3a3 +} +/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */ +.hljs-symbol, +.hljs-number, +.hljs-link, +.hljs-attr, +.hljs-variable.constant_, +.hljs-literal { + color: #dfaf8f +} +/* base0A - Classes, Markup Bold, Search Text Background */ +.hljs-title, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #e0cf9f +} +.hljs-strong { + font-weight: bold; + color: #e0cf9f +} +/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */ +.hljs-code, +.hljs-addition, +.hljs-title.class_.inherited__, +.hljs-string { + color: #5f7f5f +} +/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */ +/* guessing */ +.hljs-built_in, +.hljs-doctag, +.hljs-quote, +.hljs-keyword.hljs-atrule, +.hljs-regexp { + color: #93e0e3 +} +/* base0D - Functions, Methods, Attribute IDs, Headings */ +.hljs-function .hljs-title, +.hljs-attribute, +.ruby .hljs-property, +.hljs-title.function_, +.hljs-section { + color: #7cb8bb +} +/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */ +/* .hljs-selector-id, */ +/* .hljs-selector-class, */ +/* .hljs-selector-attr, */ +/* .hljs-selector-pseudo, */ +.hljs-type, +.hljs-template-tag, +.diff .hljs-meta, +.hljs-keyword { + color: #dc8cc3 +} +.hljs-emphasis { + color: #dc8cc3; + font-style: italic +} +/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */ +/* + prevent top level .keyword and .string scopes + from leaking into meta by accident +*/ +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-meta .hljs-string { + color: #000000 +} +/* for v10 compatible themes */ +.hljs-meta .hljs-keyword, +.hljs-meta-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/base16/zenburn.min.css b/tools/ui/node_modules/highlight.js/styles/base16/zenburn.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a075f5f7e6907a2ecbb51c42d0a977ce648f82ea --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/base16/zenburn.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Zenburn + Author: elnawe + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#dcdccc;background:#383838}.hljs ::selection,.hljs::selection{background-color:#606060;color:#dcdccc}.hljs-comment{color:#6f6f6f}.hljs-tag{color:grey}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#dcdccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#dca3a3}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#dfaf8f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#e0cf9f}.hljs-strong{font-weight:700;color:#e0cf9f}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#5f7f5f}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#93e0e3}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#7cb8bb}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#dc8cc3}.hljs-emphasis{color:#dc8cc3;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#000}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/brown-paper.css b/tools/ui/node_modules/highlight.js/styles/brown-paper.css new file mode 100644 index 0000000000000000000000000000000000000000..e6f245f82d378b2a66cf041e9b2ef34ceff2110e --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/brown-paper.css @@ -0,0 +1,63 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Brown Paper style from goldblog.com.ua (c) Zaripov Yura + +*/ +.hljs { + color: #363c69; + background: #b7a68e url(./brown-papersq.png) +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal { + color: #005599; + font-weight: bold +} +.hljs-subst { + /* default */ + +} +.hljs-string, +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-attribute, +.hljs-symbol, +.hljs-bullet, +.hljs-built_in, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable, +.hljs-link, +.hljs-name { + color: #2c009f +} +.hljs-comment, +.hljs-quote, +.hljs-meta, +.hljs-deletion { + color: #802022 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-doctag, +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-name, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/brown-paper.min.css b/tools/ui/node_modules/highlight.js/styles/brown-paper.min.css new file mode 100644 index 0000000000000000000000000000000000000000..6231e8af4f73a3d19e475b99fe7caef0eb432c94 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/brown-paper.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#363c69;background:url(./brown-papersq.png) #b7a68e}.hljs-keyword,.hljs-literal,.hljs-selector-tag{color:#059}.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-link,.hljs-name,.hljs-section,.hljs-string,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#2c009f}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#802022}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title,.hljs-type{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/brown-papersq.png b/tools/ui/node_modules/highlight.js/styles/brown-papersq.png new file mode 100644 index 0000000000000000000000000000000000000000..a1be897fc46ac0f2dcfa6c04488190011653a822 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/brown-papersq.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68003b5dbe5c47c0309a193f57aeefad0186559e176a60b76a0636470ece9f5b +size 18198 diff --git a/tools/ui/node_modules/highlight.js/styles/codepen-embed.css b/tools/ui/node_modules/highlight.js/styles/codepen-embed.css new file mode 100644 index 0000000000000000000000000000000000000000..01e2fd5b526ea97fbfec521f0bf6fd4bd67f25e2 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/codepen-embed.css @@ -0,0 +1,57 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + codepen.io Embed Theme + Author: Justin Perry + Original theme - https://github.com/chriskempson/tomorrow-theme +*/ +.hljs { + background: #222; + color: #fff +} +.hljs-comment, +.hljs-quote { + color: #777 +} +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-regexp, +.hljs-meta, +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-deletion { + color: #ab875d +} +.hljs-section, +.hljs-title, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-type, +.hljs-attribute { + color: #9b869b +} +.hljs-string, +.hljs-keyword, +.hljs-selector-tag, +.hljs-addition { + color: #8f9c6c +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/codepen-embed.min.css b/tools/ui/node_modules/highlight.js/styles/codepen-embed.min.css new file mode 100644 index 0000000000000000000000000000000000000000..0d7dff6dbee61a54ac28ef6c06bed7d5395345c8 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/codepen-embed.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#222;color:#fff}.hljs-comment,.hljs-quote{color:#777}.hljs-built_in,.hljs-bullet,.hljs-deletion,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-regexp,.hljs-symbol,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ab875d}.hljs-attribute,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-title,.hljs-type{color:#9b869b}.hljs-addition,.hljs-keyword,.hljs-selector-tag,.hljs-string{color:#8f9c6c}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/color-brewer.css b/tools/ui/node_modules/highlight.js/styles/color-brewer.css new file mode 100644 index 0000000000000000000000000000000000000000..c0db73ccf25456c4e2a3103158901bbd14f05dbc --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/color-brewer.css @@ -0,0 +1,66 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Colorbrewer theme +Original: https://github.com/mbostock/colorbrewer-theme (c) Mike Bostock +Ported by Fabrício Tavares de Oliveira + +*/ +.hljs { + color: #000; + background: #fff +} +.hljs-subst { + /* default */ + +} +.hljs-string, +.hljs-meta, +.hljs-symbol, +.hljs-template-tag, +.hljs-template-variable, +.hljs-addition { + color: #756bb1 +} +.hljs-comment, +.hljs-quote { + color: #636363 +} +.hljs-number, +.hljs-regexp, +.hljs-literal, +.hljs-bullet, +.hljs-link { + color: #31a354 +} +.hljs-deletion, +.hljs-variable { + color: #88f +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-title, +.hljs-section, +.hljs-built_in, +.hljs-doctag, +.hljs-type, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-strong { + color: #3182bd +} +.hljs-emphasis { + font-style: italic +} +.hljs-attribute { + color: #e6550d +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/color-brewer.min.css b/tools/ui/node_modules/highlight.js/styles/color-brewer.min.css new file mode 100644 index 0000000000000000000000000000000000000000..1c677e3c63935c8bdbc6dfd35003259b07152857 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/color-brewer.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#000;background:#fff}.hljs-addition,.hljs-meta,.hljs-string,.hljs-symbol,.hljs-template-tag,.hljs-template-variable{color:#756bb1}.hljs-comment,.hljs-quote{color:#636363}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-number,.hljs-regexp{color:#31a354}.hljs-deletion,.hljs-variable{color:#88f}.hljs-built_in,.hljs-doctag,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-strong,.hljs-tag,.hljs-title,.hljs-type{color:#3182bd}.hljs-emphasis{font-style:italic}.hljs-attribute{color:#e6550d} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-cherry.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-cherry.css new file mode 100644 index 0000000000000000000000000000000000000000..273a250b8e852184dc6a90f2fd3b5f5aba5d2a4e --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-cherry.css @@ -0,0 +1,103 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Theme: Cybertopia Cherry + Author: Alexandre ZANNI (noraj) + Repository: https://github.com/noraj/cybertopia-highlightjs +*/ +:root { + --hljs-bg: #101010; + --hljs-mono-1: #abb2bf; + --hljs-mono-3: #5c6370; + --hljs-hue-1: #C50243; + --hljs-hue-2: #C50253; + --hljs-hue-3: #C50263; + --hljs-hue-4: #02c797; + --hljs-hue-5: #02C584; + --hljs-hue-6: #02C574; + --hljs-hue-6-2: #02C563; + --hljs-hue-7: #C50233 +} +.hljs { + color: var(--hljs-mono-1); + background: var(--hljs-bg) +} +.hljs-comment, +.hljs-quote, +.hljs-code { + color: var(--hljs-mono-3); + font-style: italic +} +.hljs-doctag, +.hljs-keyword, +.hljs-formula, +.hljs-meta .hljs-keyword { + color: var(--hljs-hue-3) +} +.hljs-section, +.hljs-name, +.hljs-selector-tag, +.hljs-deletion, +.hljs-subst { + color: var(--hljs-hue-5) +} +.hljs-literal { + color: var(--hljs-hue-1) +} +.hljs-string, +.hljs-regexp, +.hljs-addition, +.hljs-attribute, +.hljs-meta .hljs-string { + color: var(--hljs-hue-4) +} +.hljs-attr, +.hljs-variable, +.hljs-template-variable, +.hljs-type, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-number, +.hljs-punctuation, +.hljs-variable.language_ { + color: var(--hljs-hue-6) +} +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-title, +.hljs-title.function_, +.hljs-property, +.hljs-tag, +.hljs-char.escape_ { + color: var(--hljs-hue-2) +} +.hljs-built_in, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-class .hljs-title { + color: var(--hljs-hue-6-2) +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-link { + text-decoration: underline +} +.hljs-params, +.hljs-operator, +.hljs-template-tag { + color: var(--hljs-hue-7) +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-cherry.min.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-cherry.min.css new file mode 100644 index 0000000000000000000000000000000000000000..837da453493ef06f531a1e05dc2a38a2e9a76804 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-cherry.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}:root{--hljs-bg:#101010;--hljs-mono-1:#abb2bf;--hljs-mono-3:#5c6370;--hljs-hue-1:#C50243;--hljs-hue-2:#C50253;--hljs-hue-3:#C50263;--hljs-hue-4:#02c797;--hljs-hue-5:#02C584;--hljs-hue-6:#02C574;--hljs-hue-6-2:#02C563;--hljs-hue-7:#C50233}.hljs{color:var(--hljs-mono-1);background:var(--hljs-bg)}.hljs-code,.hljs-comment,.hljs-quote{color:var(--hljs-mono-3);font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword,.hljs-meta .hljs-keyword{color:var(--hljs-hue-3)}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:var(--hljs-hue-5)}.hljs-literal{color:var(--hljs-hue-1)}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:var(--hljs-hue-4)}.hljs-attr,.hljs-number,.hljs-punctuation,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable,.hljs-variable.language_{color:var(--hljs-hue-6)}.hljs-bullet,.hljs-char.escape_,.hljs-link,.hljs-meta,.hljs-property,.hljs-selector-id,.hljs-symbol,.hljs-tag,.hljs-title,.hljs-title.function_{color:var(--hljs-hue-2)}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__{color:var(--hljs-hue-6-2)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}.hljs-operator,.hljs-params,.hljs-template-tag{color:var(--hljs-hue-7)} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-dimmer.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-dimmer.css new file mode 100644 index 0000000000000000000000000000000000000000..314f06c163d1c490e1d24eba47bc46b6dd1ecd58 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-dimmer.css @@ -0,0 +1,103 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Theme: Cybertopia Dimmer + Author: Alexandre ZANNI (noraj) + Repository: https://github.com/noraj/cybertopia-highlightjs +*/ +:root { + --hljs-bg: #101010; + --hljs-mono-1: #abb2bf; + --hljs-mono-3: #5c6370; + --hljs-hue-1: #97C502; + --hljs-hue-2: #469EBE; + --hljs-hue-3: #A246BE; + --hljs-hue-4: #02c797; + --hljs-hue-5: #C50233; + --hljs-hue-6: #BE6446; + --hljs-hue-6-2: #c5bb02; + --hljs-hue-7: #64BE46 +} +.hljs { + color: var(--hljs-mono-1); + background: var(--hljs-bg) +} +.hljs-comment, +.hljs-quote, +.hljs-code { + color: var(--hljs-mono-3); + font-style: italic +} +.hljs-doctag, +.hljs-keyword, +.hljs-formula, +.hljs-meta .hljs-keyword { + color: var(--hljs-hue-3) +} +.hljs-section, +.hljs-name, +.hljs-selector-tag, +.hljs-deletion, +.hljs-subst { + color: var(--hljs-hue-5) +} +.hljs-literal { + color: var(--hljs-hue-1) +} +.hljs-string, +.hljs-regexp, +.hljs-addition, +.hljs-attribute, +.hljs-meta .hljs-string { + color: var(--hljs-hue-4) +} +.hljs-attr, +.hljs-variable, +.hljs-template-variable, +.hljs-type, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-number, +.hljs-punctuation, +.hljs-variable.language_ { + color: var(--hljs-hue-6) +} +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-title, +.hljs-title.function_, +.hljs-property, +.hljs-tag, +.hljs-char.escape_ { + color: var(--hljs-hue-2) +} +.hljs-built_in, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-class .hljs-title { + color: var(--hljs-hue-6-2) +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-link { + text-decoration: underline +} +.hljs-params, +.hljs-operator, +.hljs-template-tag { + color: var(--hljs-hue-7) +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-dimmer.min.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-dimmer.min.css new file mode 100644 index 0000000000000000000000000000000000000000..df0f7f2ebbc5684136fd20e05882a9e00ff035e4 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-dimmer.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}:root{--hljs-bg:#101010;--hljs-mono-1:#abb2bf;--hljs-mono-3:#5c6370;--hljs-hue-1:#97C502;--hljs-hue-2:#469EBE;--hljs-hue-3:#A246BE;--hljs-hue-4:#02c797;--hljs-hue-5:#C50233;--hljs-hue-6:#BE6446;--hljs-hue-6-2:#c5bb02;--hljs-hue-7:#64BE46}.hljs{color:var(--hljs-mono-1);background:var(--hljs-bg)}.hljs-code,.hljs-comment,.hljs-quote{color:var(--hljs-mono-3);font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword,.hljs-meta .hljs-keyword{color:var(--hljs-hue-3)}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:var(--hljs-hue-5)}.hljs-literal{color:var(--hljs-hue-1)}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:var(--hljs-hue-4)}.hljs-attr,.hljs-number,.hljs-punctuation,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable,.hljs-variable.language_{color:var(--hljs-hue-6)}.hljs-bullet,.hljs-char.escape_,.hljs-link,.hljs-meta,.hljs-property,.hljs-selector-id,.hljs-symbol,.hljs-tag,.hljs-title,.hljs-title.function_{color:var(--hljs-hue-2)}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__{color:var(--hljs-hue-6-2)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}.hljs-operator,.hljs-params,.hljs-template-tag{color:var(--hljs-hue-7)} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-icecap.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-icecap.css new file mode 100644 index 0000000000000000000000000000000000000000..1244a6c254d4774ccf44ac9f7fb0f32235058103 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-icecap.css @@ -0,0 +1,103 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Theme: Cybertopia Icecap + Author: Alexandre ZANNI (noraj) + Repository: https://github.com/noraj/cybertopia-highlightjs +*/ +:root { + --hljs-bg: #101010; + --hljs-mono-1: #abb2bf; + --hljs-mono-3: #5c6370; + --hljs-hue-1: #0274C5; + --hljs-hue-2: #025AC5; + --hljs-hue-3: #0240C5; + --hljs-hue-4: #02c797; + --hljs-hue-5: #02C5AE; + --hljs-hue-6: #02C2C5; + --hljs-hue-6-2: #02A8C5; + --hljs-hue-7: #028EC5 +} +.hljs { + color: var(--hljs-mono-1); + background: var(--hljs-bg) +} +.hljs-comment, +.hljs-quote, +.hljs-code { + color: var(--hljs-mono-3); + font-style: italic +} +.hljs-doctag, +.hljs-keyword, +.hljs-formula, +.hljs-meta .hljs-keyword { + color: var(--hljs-hue-3) +} +.hljs-section, +.hljs-name, +.hljs-selector-tag, +.hljs-deletion, +.hljs-subst { + color: var(--hljs-hue-5) +} +.hljs-literal { + color: var(--hljs-hue-1) +} +.hljs-string, +.hljs-regexp, +.hljs-addition, +.hljs-attribute, +.hljs-meta .hljs-string { + color: var(--hljs-hue-4) +} +.hljs-attr, +.hljs-variable, +.hljs-template-variable, +.hljs-type, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-number, +.hljs-punctuation, +.hljs-variable.language_ { + color: var(--hljs-hue-6) +} +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-title, +.hljs-title.function_, +.hljs-property, +.hljs-tag, +.hljs-char.escape_ { + color: var(--hljs-hue-2) +} +.hljs-built_in, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-class .hljs-title { + color: var(--hljs-hue-6-2) +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-link { + text-decoration: underline +} +.hljs-params, +.hljs-operator, +.hljs-template-tag { + color: var(--hljs-hue-7) +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-icecap.min.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-icecap.min.css new file mode 100644 index 0000000000000000000000000000000000000000..8ef72ad6d9245279e25a151881ce036314bfb9c3 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-icecap.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}:root{--hljs-bg:#101010;--hljs-mono-1:#abb2bf;--hljs-mono-3:#5c6370;--hljs-hue-1:#0274C5;--hljs-hue-2:#025AC5;--hljs-hue-3:#0240C5;--hljs-hue-4:#02c797;--hljs-hue-5:#02C5AE;--hljs-hue-6:#02C2C5;--hljs-hue-6-2:#02A8C5;--hljs-hue-7:#028EC5}.hljs{color:var(--hljs-mono-1);background:var(--hljs-bg)}.hljs-code,.hljs-comment,.hljs-quote{color:var(--hljs-mono-3);font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword,.hljs-meta .hljs-keyword{color:var(--hljs-hue-3)}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:var(--hljs-hue-5)}.hljs-literal{color:var(--hljs-hue-1)}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:var(--hljs-hue-4)}.hljs-attr,.hljs-number,.hljs-punctuation,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable,.hljs-variable.language_{color:var(--hljs-hue-6)}.hljs-bullet,.hljs-char.escape_,.hljs-link,.hljs-meta,.hljs-property,.hljs-selector-id,.hljs-symbol,.hljs-tag,.hljs-title,.hljs-title.function_{color:var(--hljs-hue-2)}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__{color:var(--hljs-hue-6-2)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}.hljs-operator,.hljs-params,.hljs-template-tag{color:var(--hljs-hue-7)} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-saturated.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-saturated.css new file mode 100644 index 0000000000000000000000000000000000000000..f5a8b4e54aa7b4cb12ab870bb3a559cad32585aa --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-saturated.css @@ -0,0 +1,103 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Theme: Cybertopia Saturated + Author: Alexandre ZANNI (noraj) + Repository: https://github.com/noraj/cybertopia-highlightjs +*/ +:root { + --hljs-bg: #101010; + --hljs-mono-1: #abb2bf; + --hljs-mono-3: #5c6370; + --hljs-hue-1: #5AF202; + --hljs-hue-2: #08B7FD; + --hljs-hue-3: #E917FD; + --hljs-hue-4: #02c797; + --hljs-hue-5: #E30202; + --hljs-hue-6: #FD9926; + --hljs-hue-6-2: #ffea00; + --hljs-hue-7: #35FD56 +} +.hljs { + color: var(--hljs-mono-1); + background: var(--hljs-bg) +} +.hljs-comment, +.hljs-quote, +.hljs-code { + color: var(--hljs-mono-3); + font-style: italic +} +.hljs-doctag, +.hljs-keyword, +.hljs-formula, +.hljs-meta .hljs-keyword { + color: var(--hljs-hue-3) +} +.hljs-section, +.hljs-name, +.hljs-selector-tag, +.hljs-deletion, +.hljs-subst { + color: var(--hljs-hue-5) +} +.hljs-literal { + color: var(--hljs-hue-1) +} +.hljs-string, +.hljs-regexp, +.hljs-addition, +.hljs-attribute, +.hljs-meta .hljs-string { + color: var(--hljs-hue-4) +} +.hljs-attr, +.hljs-variable, +.hljs-template-variable, +.hljs-type, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-number, +.hljs-punctuation, +.hljs-variable.language_ { + color: var(--hljs-hue-6) +} +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-title, +.hljs-title.function_, +.hljs-property, +.hljs-tag, +.hljs-char.escape_ { + color: var(--hljs-hue-2) +} +.hljs-built_in, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-class .hljs-title { + color: var(--hljs-hue-6-2) +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-link { + text-decoration: underline +} +.hljs-params, +.hljs-operator, +.hljs-template-tag { + color: var(--hljs-hue-7) +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/cybertopia-saturated.min.css b/tools/ui/node_modules/highlight.js/styles/cybertopia-saturated.min.css new file mode 100644 index 0000000000000000000000000000000000000000..21206033763a4bce7423d28904f5c9e22dd24aca --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/cybertopia-saturated.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}:root{--hljs-bg:#101010;--hljs-mono-1:#abb2bf;--hljs-mono-3:#5c6370;--hljs-hue-1:#5AF202;--hljs-hue-2:#08B7FD;--hljs-hue-3:#E917FD;--hljs-hue-4:#02c797;--hljs-hue-5:#E30202;--hljs-hue-6:#FD9926;--hljs-hue-6-2:#ffea00;--hljs-hue-7:#35FD56}.hljs{color:var(--hljs-mono-1);background:var(--hljs-bg)}.hljs-code,.hljs-comment,.hljs-quote{color:var(--hljs-mono-3);font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword,.hljs-meta .hljs-keyword{color:var(--hljs-hue-3)}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:var(--hljs-hue-5)}.hljs-literal{color:var(--hljs-hue-1)}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:var(--hljs-hue-4)}.hljs-attr,.hljs-number,.hljs-punctuation,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable,.hljs-variable.language_{color:var(--hljs-hue-6)}.hljs-bullet,.hljs-char.escape_,.hljs-link,.hljs-meta,.hljs-property,.hljs-selector-id,.hljs-symbol,.hljs-tag,.hljs-title,.hljs-title.function_{color:var(--hljs-hue-2)}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__{color:var(--hljs-hue-6-2)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}.hljs-operator,.hljs-params,.hljs-template-tag{color:var(--hljs-hue-7)} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/dark.css b/tools/ui/node_modules/highlight.js/styles/dark.css new file mode 100644 index 0000000000000000000000000000000000000000..bdeceb229ae0bd437c275f4675fddf748e9281b6 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/dark.css @@ -0,0 +1,62 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Dark style from softwaremaniacs.org (c) Ivan Sagalaev + +*/ +.hljs { + color: #ddd; + background: #303030 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-section, +.hljs-link { + color: white +} +.hljs-subst { + /* default */ + +} +.hljs-string, +.hljs-title, +.hljs-name, +.hljs-type, +.hljs-attribute, +.hljs-symbol, +.hljs-bullet, +.hljs-built_in, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #d88 +} +.hljs-comment, +.hljs-quote, +.hljs-deletion, +.hljs-meta { + color: #979797 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-title, +.hljs-section, +.hljs-doctag, +.hljs-type, +.hljs-name, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/dark.min.css b/tools/ui/node_modules/highlight.js/styles/dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..9ed546baf4a99d454bdb597706fdb7770b0291ea --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/dark.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ddd;background:#303030}.hljs-keyword,.hljs-link,.hljs-literal,.hljs-section,.hljs-selector-tag{color:#fff}.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-name,.hljs-string,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#d88}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#979797}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title,.hljs-type{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/default.css b/tools/ui/node_modules/highlight.js/styles/default.css new file mode 100644 index 0000000000000000000000000000000000000000..6c4d2b3152b0cf20ed47138a2ca3cf9a6ac8feba --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/default.css @@ -0,0 +1,117 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Default + Description: Original highlight.js style + Author: (c) Ivan Sagalaev + Maintainer: @highlightjs/core-team + Website: https://highlightjs.org/ + License: see project LICENSE + Touched: 2021 +*/ +/* +This is left on purpose making default.css the single file that can be lifted +as-is from the repository directly without the need for a build step + +Typically this "required" baseline CSS is added by `makestuff.js` during build. +*/ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* end baseline CSS */ +.hljs { + background: #F3F3F3; + color: #444 +} +/* Base color: saturation 0; */ +.hljs-subst { + /* default */ + +} +/* purposely ignored */ +.hljs-formula, +.hljs-attr, +.hljs-property, +.hljs-params { + +} +.hljs-comment { + color: #697070 +} +.hljs-tag, +.hljs-punctuation { + color: #444a +} +.hljs-tag .hljs-name, +.hljs-tag .hljs-attr { + color: #444 +} +.hljs-keyword, +.hljs-attribute, +.hljs-selector-tag, +.hljs-meta .hljs-keyword, +.hljs-doctag, +.hljs-name { + font-weight: bold +} +/* User color: hue: 0 */ +.hljs-type, +.hljs-string, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #880000 +} +.hljs-title, +.hljs-section { + color: #880000; + font-weight: bold +} +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-operator, +.hljs-selector-pseudo { + color: #ab5656 +} +/* Language color: hue: 90; */ +.hljs-literal { + color: #695 +} +.hljs-built_in, +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #397300 +} +/* Meta color: hue: 200 */ +.hljs-meta { + color: #1f7199 +} +.hljs-meta .hljs-string { + color: #38a +} +/* Misc effects */ +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/default.min.css b/tools/ui/node_modules/highlight.js/styles/default.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a75ea911626816107a2a126d4a990e187bc9d7ee --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/default.min.css @@ -0,0 +1,9 @@ +/*! + Theme: Default + Description: Original highlight.js style + Author: (c) Ivan Sagalaev + Maintainer: @highlightjs/core-team + Website: https://highlightjs.org/ + License: see project LICENSE + Touched: 2021 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#f3f3f3;color:#444}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/devibeans.css b/tools/ui/node_modules/highlight.js/styles/devibeans.css new file mode 100644 index 0000000000000000000000000000000000000000..a35e36313027412b225cf62c6c678efbcca4193c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/devibeans.css @@ -0,0 +1,90 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: devibeans (dark) + Author: @terminaldweller + Maintainer: @terminaldweller + + Inspired by vim's jellybeans theme (https://github.com/nanotech/jellybeans.vim) +*/ +.hljs { + background: #000000; + color: #a39e9b +} +.hljs-attr, +.hljs-template-tag { + color: #8787d7 +} +.hljs-comment, +.hljs-doctag, +.hljs-quote { + color: #339966 +} +.hljs-params { + color: #a39e9b +} +.hljs-regexp { + color: #d700ff +} +.hljs-tag, +.hljs-selector-id, +.hljs-number, +.hljs-literal { + color: #ef5350 +} +.hljs-meta, +.hljs-meta .hljs-keyword { + color: #0087ff +} +/* opt-out */ +.hljs-operator, +.hljs-punctuation { + +} +.hljs-selector-class, +.hljs-code, +.hljs-formula, +.hljs-variable, +.hljs-template-variable, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-link, +.hljs-keyword { + color: #64b5f6 +} +.hljs-built_in, +.hljs-title, +.hljs-deletion { + color: #ff8700 +} +.hljs-type, +.hljs-section, +.hljs-function, +.hljs-name, +.hljs-property, +.hljs-attribute { + color: #ffd75f +} +.hljs-meta .hljs-string, +.hljs-string, +.hljs-subst, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #558b2f +} +.hljs-selector-tag { + color: #9966ff +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/devibeans.min.css b/tools/ui/node_modules/highlight.js/styles/devibeans.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d8c4c0f5444f74cf6330511bfe3c4e151dad1cce --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/devibeans.min.css @@ -0,0 +1,7 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: devibeans (dark) + Author: @terminaldweller + Maintainer: @terminaldweller + + Inspired by vim's jellybeans theme (https://github.com/nanotech/jellybeans.vim) +*/.hljs{background:#000;color:#a39e9b}.hljs-attr,.hljs-template-tag{color:#8787d7}.hljs-comment,.hljs-doctag,.hljs-quote{color:#396}.hljs-params{color:#a39e9b}.hljs-regexp{color:#d700ff}.hljs-literal,.hljs-number,.hljs-selector-id,.hljs-tag{color:#ef5350}.hljs-meta,.hljs-meta .hljs-keyword{color:#0087ff}.hljs-code,.hljs-formula,.hljs-keyword,.hljs-link,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-variable{color:#64b5f6}.hljs-built_in,.hljs-deletion,.hljs-title{color:#ff8700}.hljs-attribute,.hljs-function,.hljs-name,.hljs-property,.hljs-section,.hljs-type{color:#ffd75f}.hljs-addition,.hljs-bullet,.hljs-meta .hljs-string,.hljs-string,.hljs-subst,.hljs-symbol{color:#558b2f}.hljs-selector-tag{color:#96f}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/docco.css b/tools/ui/node_modules/highlight.js/styles/docco.css new file mode 100644 index 0000000000000000000000000000000000000000..1be51b40470b31e7cf32f32e7109e7212c1d2628 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/docco.css @@ -0,0 +1,83 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* +Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars) +*/ +.hljs { + color: #000; + background: #f8f8ff +} +.hljs-comment, +.hljs-quote { + color: #408080; + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-subst { + color: #954121 +} +.hljs-number { + color: #40a070 +} +.hljs-string, +.hljs-doctag { + color: #219161 +} +.hljs-selector-id, +.hljs-selector-class, +.hljs-section, +.hljs-type { + color: #19469d +} +.hljs-params { + color: #00f +} +.hljs-title { + color: #458; + font-weight: bold +} +.hljs-tag, +.hljs-name, +.hljs-attribute { + color: #000080; + font-weight: normal +} +.hljs-variable, +.hljs-template-variable { + color: #008080 +} +.hljs-regexp, +.hljs-link { + color: #b68 +} +.hljs-symbol, +.hljs-bullet { + color: #990073 +} +.hljs-built_in { + color: #0086b3 +} +.hljs-meta { + color: #999; + font-weight: bold +} +.hljs-deletion { + background: #fdd +} +.hljs-addition { + background: #dfd +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/docco.min.css b/tools/ui/node_modules/highlight.js/styles/docco.min.css new file mode 100644 index 0000000000000000000000000000000000000000..382ecbb56c892be80768df127f5e3a32f0c41282 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/docco.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#000;background:#f8f8ff}.hljs-comment,.hljs-quote{color:#408080;font-style:italic}.hljs-keyword,.hljs-literal,.hljs-selector-tag,.hljs-subst{color:#954121}.hljs-number{color:#40a070}.hljs-doctag,.hljs-string{color:#219161}.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-type{color:#19469d}.hljs-params{color:#00f}.hljs-title{color:#458;font-weight:700}.hljs-attribute,.hljs-name,.hljs-tag{color:navy;font-weight:400}.hljs-template-variable,.hljs-variable{color:teal}.hljs-link,.hljs-regexp{color:#b68}.hljs-bullet,.hljs-symbol{color:#990073}.hljs-built_in{color:#0086b3}.hljs-meta{color:#999;font-weight:700}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/far.css b/tools/ui/node_modules/highlight.js/styles/far.css new file mode 100644 index 0000000000000000000000000000000000000000..ecf7cf563168847946ba85e187afa9a547b12675 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/far.css @@ -0,0 +1,67 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +FAR Style (c) MajestiC + +*/ +.hljs { + color: #0ff; + background: #000080 +} +.hljs-subst { + /* default */ + +} +.hljs-string, +.hljs-attribute, +.hljs-symbol, +.hljs-bullet, +.hljs-built_in, +.hljs-template-tag, +.hljs-template-variable, +.hljs-addition { + color: #ff0 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-section, +.hljs-type, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-variable { + color: #fff +} +.hljs-comment, +.hljs-quote, +.hljs-doctag, +.hljs-deletion { + color: #888 +} +.hljs-number, +.hljs-regexp, +.hljs-literal, +.hljs-link { + color: #0f0 +} +.hljs-meta { + color: #008080 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-title, +.hljs-section, +.hljs-name, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/far.min.css b/tools/ui/node_modules/highlight.js/styles/far.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c338ef60c262bfaa1682d77ef556faf9577d5057 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/far.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#0ff;background:navy}.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-string,.hljs-symbol,.hljs-template-tag,.hljs-template-variable{color:#ff0}.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type,.hljs-variable{color:#fff}.hljs-comment,.hljs-deletion,.hljs-doctag,.hljs-quote{color:#888}.hljs-link,.hljs-literal,.hljs-number,.hljs-regexp{color:#0f0}.hljs-meta{color:teal}.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/felipec.css b/tools/ui/node_modules/highlight.js/styles/felipec.css new file mode 100644 index 0000000000000000000000000000000000000000..2d19c39bdcc068931e0e7337a8034f6a09cbd0e4 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/felipec.css @@ -0,0 +1,94 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + * Theme: FelipeC + * Author: (c) 2021 Felipe Contreras + * Website: https://github.com/felipec/vim-felipec + * + * Autogenerated with vim-felipec's generator. +*/ +.hljs { + color: #dedde4; + background-color: #1d1c21 +} +.hljs::selection, +.hljs ::selection { + color: #1d1c21; + background-color: #ba9cef +} +.hljs-comment, +.hljs-code, +.hljs-quote { + color: #9e9da4 +} +.hljs-number, +.hljs-literal, +.hljs-deletion { + color: #f09080 +} +.hljs-punctuation, +.hljs-meta, +.hljs-operator, +.hljs-subst, +.hljs-doctag, +.hljs-template-variable, +.hljs-selector-attr { + color: #ffbb7b +} +.hljs-type { + color: #fddb7c +} +.hljs-tag, +.hljs-title, +.hljs-selector-class, +.hljs-selector-id { + color: #c4da7d +} +.hljs-string, +.hljs-regexp, +.hljs-addition { + color: #93e4a4 +} +.hljs-class, +.hljs-property { + color: #65e7d1 +} +.hljs-name, +.hljs-selector-tag { + color: #30c2d8 +} +.hljs-keyword, +.hljs-built_in { + color: #5fb8f2 +} +.hljs-section, +.hljs-bullet { + color: #90aafa +} +.hljs-selector-pseudo { + color: #ba9cef +} +.hljs-variable, +.hljs-params, +.hljs-attr, +.hljs-attribute { + color: #d991d2 +} +.hljs-symbol, +.hljs-link { + color: #ec8dab +} +.hljs-strong, +.hljs-literal, +.hljs-title { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/felipec.min.css b/tools/ui/node_modules/highlight.js/styles/felipec.min.css new file mode 100644 index 0000000000000000000000000000000000000000..7f76cd0d707b49f33a9445ef7af6b40fafcd39ab --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/felipec.min.css @@ -0,0 +1,7 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + * Theme: FelipeC + * Author: (c) 2021 Felipe Contreras + * Website: https://github.com/felipec/vim-felipec + * + * Autogenerated with vim-felipec's generator. +*/.hljs{color:#dedde4;background-color:#1d1c21}.hljs ::selection,.hljs::selection{color:#1d1c21;background-color:#ba9cef}.hljs-code,.hljs-comment,.hljs-quote{color:#9e9da4}.hljs-deletion,.hljs-literal,.hljs-number{color:#f09080}.hljs-doctag,.hljs-meta,.hljs-operator,.hljs-punctuation,.hljs-selector-attr,.hljs-subst,.hljs-template-variable{color:#ffbb7b}.hljs-type{color:#fddb7c}.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-title{color:#c4da7d}.hljs-addition,.hljs-regexp,.hljs-string{color:#93e4a4}.hljs-class,.hljs-property{color:#65e7d1}.hljs-name,.hljs-selector-tag{color:#30c2d8}.hljs-built_in,.hljs-keyword{color:#5fb8f2}.hljs-bullet,.hljs-section{color:#90aafa}.hljs-selector-pseudo{color:#ba9cef}.hljs-attr,.hljs-attribute,.hljs-params,.hljs-variable{color:#d991d2}.hljs-link,.hljs-symbol{color:#ec8dab}.hljs-literal,.hljs-strong,.hljs-title{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/foundation.css b/tools/ui/node_modules/highlight.js/styles/foundation.css new file mode 100644 index 0000000000000000000000000000000000000000..87641c7e71fbb2f8692885f40fba883b6aff2f6d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/foundation.css @@ -0,0 +1,80 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* +Description: Foundation 4 docs style for highlight.js +Author: Dan Allen +Website: http://foundation.zurb.com/docs/ +Version: 1.0 +Date: 2013-04-02 +*/ +.hljs { + background: #eee; + color: black +} +.hljs-link, +.hljs-emphasis, +.hljs-attribute, +.hljs-addition { + color: #070 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong, +.hljs-string, +.hljs-deletion { + color: #d14 +} +.hljs-strong { + font-weight: bold +} +.hljs-quote, +.hljs-comment { + color: #998; + font-style: italic +} +.hljs-section, +.hljs-title { + color: #900 +} +.hljs-class .hljs-title, +.hljs-title.class_, +.hljs-type { + color: #458 +} +.hljs-variable, +.hljs-template-variable { + color: #336699 +} +.hljs-bullet { + color: #997700 +} +.hljs-meta { + color: #3344bb +} +.hljs-code, +.hljs-number, +.hljs-literal, +.hljs-keyword, +.hljs-selector-tag { + color: #099 +} +.hljs-regexp { + background-color: #fff0ff; + color: #880088 +} +.hljs-symbol { + color: #990073 +} +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class { + color: #007700 +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/foundation.min.css b/tools/ui/node_modules/highlight.js/styles/foundation.min.css new file mode 100644 index 0000000000000000000000000000000000000000..1ddcfa66e79beb6c6db81c267ff4aef337ac5c60 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/foundation.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#eee;color:#000}.hljs-addition,.hljs-attribute,.hljs-emphasis,.hljs-link{color:#070}.hljs-emphasis{font-style:italic}.hljs-deletion,.hljs-string,.hljs-strong{color:#d14}.hljs-strong{font-weight:700}.hljs-comment,.hljs-quote{color:#998;font-style:italic}.hljs-section,.hljs-title{color:#900}.hljs-class .hljs-title,.hljs-title.class_,.hljs-type{color:#458}.hljs-template-variable,.hljs-variable{color:#369}.hljs-bullet{color:#970}.hljs-meta{color:#34b}.hljs-code,.hljs-keyword,.hljs-literal,.hljs-number,.hljs-selector-tag{color:#099}.hljs-regexp{background-color:#fff0ff;color:#808}.hljs-symbol{color:#990073}.hljs-name,.hljs-selector-class,.hljs-selector-id,.hljs-tag{color:#070} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/github-dark-dimmed.css b/tools/ui/node_modules/highlight.js/styles/github-dark-dimmed.css new file mode 100644 index 0000000000000000000000000000000000000000..f3855ca136f7a5b40d54322de035a093b135aa48 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/github-dark-dimmed.css @@ -0,0 +1,117 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: GitHub Dark Dimmed + Description: Dark dimmed theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Colors taken from GitHub's CSS +*/ +.hljs { + color: #adbac7; + background: #22272e +} +.hljs-doctag, +.hljs-keyword, +.hljs-meta .hljs-keyword, +.hljs-template-tag, +.hljs-template-variable, +.hljs-type, +.hljs-variable.language_ { + /* prettylights-syntax-keyword */ + color: #f47067 +} +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-title.function_ { + /* prettylights-syntax-entity */ + color: #dcbdfb +} +.hljs-attr, +.hljs-attribute, +.hljs-literal, +.hljs-meta, +.hljs-number, +.hljs-operator, +.hljs-variable, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-id { + /* prettylights-syntax-constant */ + color: #6cb6ff +} +.hljs-regexp, +.hljs-string, +.hljs-meta .hljs-string { + /* prettylights-syntax-string */ + color: #96d0ff +} +.hljs-built_in, +.hljs-symbol { + /* prettylights-syntax-variable */ + color: #f69d50 +} +.hljs-comment, +.hljs-code, +.hljs-formula { + /* prettylights-syntax-comment */ + color: #768390 +} +.hljs-name, +.hljs-quote, +.hljs-selector-tag, +.hljs-selector-pseudo { + /* prettylights-syntax-entity-tag */ + color: #8ddb8c +} +.hljs-subst { + /* prettylights-syntax-storage-modifier-import */ + color: #adbac7 +} +.hljs-section { + /* prettylights-syntax-markup-heading */ + color: #316dca; + font-weight: bold +} +.hljs-bullet { + /* prettylights-syntax-markup-list */ + color: #eac55f +} +.hljs-emphasis { + /* prettylights-syntax-markup-italic */ + color: #adbac7; + font-style: italic +} +.hljs-strong { + /* prettylights-syntax-markup-bold */ + color: #adbac7; + font-weight: bold +} +.hljs-addition { + /* prettylights-syntax-markup-inserted */ + color: #b4f1b4; + background-color: #1b4721 +} +.hljs-deletion { + /* prettylights-syntax-markup-deleted */ + color: #ffd8d3; + background-color: #78191b +} +.hljs-char.escape_, +.hljs-link, +.hljs-params, +.hljs-property, +.hljs-punctuation, +.hljs-tag { + /* purposely ignored */ + +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/github-dark-dimmed.min.css b/tools/ui/node_modules/highlight.js/styles/github-dark-dimmed.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e266dfc1cf7bd571057c1e59c09a3ea531d33ba1 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/github-dark-dimmed.min.css @@ -0,0 +1,9 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub Dark Dimmed + Description: Dark dimmed theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Colors taken from GitHub's CSS +*/.hljs{color:#adbac7;background:#22272e}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#f47067}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#dcbdfb}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#6cb6ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#96d0ff}.hljs-built_in,.hljs-symbol{color:#f69d50}.hljs-code,.hljs-comment,.hljs-formula{color:#768390}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#8ddb8c}.hljs-subst{color:#adbac7}.hljs-section{color:#316dca;font-weight:700}.hljs-bullet{color:#eac55f}.hljs-emphasis{color:#adbac7;font-style:italic}.hljs-strong{color:#adbac7;font-weight:700}.hljs-addition{color:#b4f1b4;background-color:#1b4721}.hljs-deletion{color:#ffd8d3;background-color:#78191b} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/github-dark.css b/tools/ui/node_modules/highlight.js/styles/github-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..8826d2f3f2be0f56c6179b9da18319008e9679a5 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/github-dark.css @@ -0,0 +1,118 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: GitHub Dark + Description: Dark theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-dark + Current colors taken from GitHub's CSS +*/ +.hljs { + color: #c9d1d9; + background: #0d1117 +} +.hljs-doctag, +.hljs-keyword, +.hljs-meta .hljs-keyword, +.hljs-template-tag, +.hljs-template-variable, +.hljs-type, +.hljs-variable.language_ { + /* prettylights-syntax-keyword */ + color: #ff7b72 +} +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-title.function_ { + /* prettylights-syntax-entity */ + color: #d2a8ff +} +.hljs-attr, +.hljs-attribute, +.hljs-literal, +.hljs-meta, +.hljs-number, +.hljs-operator, +.hljs-variable, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-id { + /* prettylights-syntax-constant */ + color: #79c0ff +} +.hljs-regexp, +.hljs-string, +.hljs-meta .hljs-string { + /* prettylights-syntax-string */ + color: #a5d6ff +} +.hljs-built_in, +.hljs-symbol { + /* prettylights-syntax-variable */ + color: #ffa657 +} +.hljs-comment, +.hljs-code, +.hljs-formula { + /* prettylights-syntax-comment */ + color: #8b949e +} +.hljs-name, +.hljs-quote, +.hljs-selector-tag, +.hljs-selector-pseudo { + /* prettylights-syntax-entity-tag */ + color: #7ee787 +} +.hljs-subst { + /* prettylights-syntax-storage-modifier-import */ + color: #c9d1d9 +} +.hljs-section { + /* prettylights-syntax-markup-heading */ + color: #1f6feb; + font-weight: bold +} +.hljs-bullet { + /* prettylights-syntax-markup-list */ + color: #f2cc60 +} +.hljs-emphasis { + /* prettylights-syntax-markup-italic */ + color: #c9d1d9; + font-style: italic +} +.hljs-strong { + /* prettylights-syntax-markup-bold */ + color: #c9d1d9; + font-weight: bold +} +.hljs-addition { + /* prettylights-syntax-markup-inserted */ + color: #aff5b4; + background-color: #033a16 +} +.hljs-deletion { + /* prettylights-syntax-markup-deleted */ + color: #ffdcd7; + background-color: #67060c +} +.hljs-char.escape_, +.hljs-link, +.hljs-params, +.hljs-property, +.hljs-punctuation, +.hljs-tag { + /* purposely ignored */ + +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/github-dark.min.css b/tools/ui/node_modules/highlight.js/styles/github-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..03b6da8bf4301dbc9853f46f9fe3362236f61a82 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/github-dark.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub Dark + Description: Dark theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-dark + Current colors taken from GitHub's CSS +*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/github.css b/tools/ui/node_modules/highlight.js/styles/github.css new file mode 100644 index 0000000000000000000000000000000000000000..1001da62cf3b5d8d9d5472b93b68b57b7bd9b640 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/github.css @@ -0,0 +1,118 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: GitHub + Description: Light theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-light + Current colors taken from GitHub's CSS +*/ +.hljs { + color: #24292e; + background: #ffffff +} +.hljs-doctag, +.hljs-keyword, +.hljs-meta .hljs-keyword, +.hljs-template-tag, +.hljs-template-variable, +.hljs-type, +.hljs-variable.language_ { + /* prettylights-syntax-keyword */ + color: #d73a49 +} +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-title.function_ { + /* prettylights-syntax-entity */ + color: #6f42c1 +} +.hljs-attr, +.hljs-attribute, +.hljs-literal, +.hljs-meta, +.hljs-number, +.hljs-operator, +.hljs-variable, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-id { + /* prettylights-syntax-constant */ + color: #005cc5 +} +.hljs-regexp, +.hljs-string, +.hljs-meta .hljs-string { + /* prettylights-syntax-string */ + color: #032f62 +} +.hljs-built_in, +.hljs-symbol { + /* prettylights-syntax-variable */ + color: #e36209 +} +.hljs-comment, +.hljs-code, +.hljs-formula { + /* prettylights-syntax-comment */ + color: #6a737d +} +.hljs-name, +.hljs-quote, +.hljs-selector-tag, +.hljs-selector-pseudo { + /* prettylights-syntax-entity-tag */ + color: #22863a +} +.hljs-subst { + /* prettylights-syntax-storage-modifier-import */ + color: #24292e +} +.hljs-section { + /* prettylights-syntax-markup-heading */ + color: #005cc5; + font-weight: bold +} +.hljs-bullet { + /* prettylights-syntax-markup-list */ + color: #735c0f +} +.hljs-emphasis { + /* prettylights-syntax-markup-italic */ + color: #24292e; + font-style: italic +} +.hljs-strong { + /* prettylights-syntax-markup-bold */ + color: #24292e; + font-weight: bold +} +.hljs-addition { + /* prettylights-syntax-markup-inserted */ + color: #22863a; + background-color: #f0fff4 +} +.hljs-deletion { + /* prettylights-syntax-markup-deleted */ + color: #b31d28; + background-color: #ffeef0 +} +.hljs-char.escape_, +.hljs-link, +.hljs-params, +.hljs-property, +.hljs-punctuation, +.hljs-tag { + /* purposely ignored */ + +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/github.min.css b/tools/ui/node_modules/highlight.js/styles/github.min.css new file mode 100644 index 0000000000000000000000000000000000000000..275239a7aa96a8cfea155167b8ce57db3ab5f469 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/github.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub + Description: Light theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-light + Current colors taken from GitHub's CSS +*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/gml.css b/tools/ui/node_modules/highlight.js/styles/gml.css new file mode 100644 index 0000000000000000000000000000000000000000..7d6437c420c687d12ac1c6fbc20d1cab3db89386 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/gml.css @@ -0,0 +1,72 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +GML Theme - Meseta + +*/ +.hljs { + background: #222222; + color: #C0C0C0 +} +.hljs-keyword { + color: #FFB871; + font-weight: bold +} +.hljs-built_in { + color: #FFB871 +} +.hljs-literal { + color: #FF8080 +} +.hljs-symbol { + color: #58E55A +} +.hljs-comment { + color: #5B995B +} +.hljs-string { + color: #FFFF00 +} +.hljs-number { + color: #FF8080 +} +.hljs-attribute, +.hljs-selector-tag, +.hljs-doctag, +.hljs-name, +.hljs-bullet, +.hljs-code, +.hljs-addition, +.hljs-regexp, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-type, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion, +.hljs-title, +.hljs-section, +.hljs-function, +.hljs-meta .hljs-keyword, +.hljs-meta, +.hljs-subst { + color: #C0C0C0 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/gml.min.css b/tools/ui/node_modules/highlight.js/styles/gml.min.css new file mode 100644 index 0000000000000000000000000000000000000000..89455fe31d3810c223a3002f1a1e447888594ad4 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/gml.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#222;color:silver}.hljs-keyword{color:#ffb871;font-weight:700}.hljs-built_in{color:#ffb871}.hljs-literal{color:#ff8080}.hljs-symbol{color:#58e55a}.hljs-comment{color:#5b995b}.hljs-string{color:#ff0}.hljs-number{color:#ff8080}.hljs-addition,.hljs-attribute,.hljs-bullet,.hljs-code,.hljs-deletion,.hljs-doctag,.hljs-function,.hljs-link,.hljs-meta,.hljs-meta .hljs-keyword,.hljs-name,.hljs-quote,.hljs-regexp,.hljs-section,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag,.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:silver}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/googlecode.css b/tools/ui/node_modules/highlight.js/styles/googlecode.css new file mode 100644 index 0000000000000000000000000000000000000000..135aaf29947cbe3d82627aa97edcfa722f440a9f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/googlecode.css @@ -0,0 +1,79 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Google Code style (c) Aahan Krish + +*/ +.hljs { + background: white; + color: black +} +.hljs-comment, +.hljs-quote { + color: #800 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-section, +.hljs-title, +.hljs-name { + color: #008 +} +.hljs-variable, +.hljs-template-variable { + color: #660 +} +.hljs-string, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-regexp { + color: #080 +} +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-meta, +.hljs-number, +.hljs-link { + color: #066 +} +.hljs-title, +.hljs-doctag, +.hljs-type, +.hljs-attr, +.hljs-built_in, +.hljs-params { + color: #606 +} +.hljs-attribute, +.hljs-subst { + color: #000 +} +.hljs-formula { + background-color: #eee; + font-style: italic +} +.hljs-selector-id, +.hljs-selector-class { + color: #9B703F +} +.hljs-addition { + background-color: #baeeba +} +.hljs-deletion { + background-color: #ffc8bd +} +.hljs-doctag, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/googlecode.min.css b/tools/ui/node_modules/highlight.js/styles/googlecode.min.css new file mode 100644 index 0000000000000000000000000000000000000000..0140b89baf5600ce4e010cc37995ffbc447a90ce --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/googlecode.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-comment,.hljs-quote{color:#800}.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-title{color:#008}.hljs-template-variable,.hljs-variable{color:#660}.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string{color:#080}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-symbol{color:#066}.hljs-attr,.hljs-built_in,.hljs-doctag,.hljs-params,.hljs-title,.hljs-type{color:#606}.hljs-attribute,.hljs-subst{color:#000}.hljs-formula{background-color:#eee;font-style:italic}.hljs-selector-class,.hljs-selector-id{color:#9b703f}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-doctag,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/gradient-dark.css b/tools/ui/node_modules/highlight.js/styles/gradient-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..d8ed02060166adfdf4144c0489d7abf593f21feb --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/gradient-dark.css @@ -0,0 +1,90 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Gradient Dark (c) Samia Ali + +*/ +.hljs { + background-color: #652487; + background-image: linear-gradient(160deg, #652487 0%, #443ac3 35%, #0174b7 68%, #04988e 100%); + color: #e7e4eb +} +.hljs-subtr { + color: #e7e4eb +} +.hljs-doctag, +.hljs-meta, +.hljs-comment, +.hljs-quote { + color: #af8dd9 +} +.hljs-selector-tag, +.hljs-selector-id, +.hljs-template-tag, +.hljs-regexp, +.hljs-attr, +.hljs-tag { + color: #AEFBFF +} +.hljs-params, +.hljs-selector-class, +.hljs-bullet { + color: #F19FFF +} +.hljs-keyword, +.hljs-section, +.hljs-meta .hljs-keyword, +.hljs-symbol, +.hljs-type { + color: #17fc95 +} +.hljs-addition, +.hljs-number, +.hljs-link { + color: #C5FE00 +} +.hljs-string { + color: #38c0ff +} +.hljs-attribute, +.hljs-addition { + color: #E7FF9F +} +.hljs-variable, +.hljs-template-variable { + color: #E447FF +} +.hljs-built_in, +.hljs-formula, +.hljs-name, +.hljs-title, +.hljs-class, +.hljs-function { + color: #FFC800 +} +.hljs-selector-pseudo, +.hljs-deletion, +.hljs-literal { + color: #FF9E44 +} +.hljs-emphasis, +.hljs-quote { + font-style: italic +} +.hljs-params, +.hljs-selector-class, +.hljs-strong, +.hljs-selector-tag, +.hljs-selector-id, +.hljs-template-tag, +.hljs-section, +.hljs-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/gradient-dark.min.css b/tools/ui/node_modules/highlight.js/styles/gradient-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..4aba92891863a9bddf86769490cf1db86db50aa6 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/gradient-dark.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background-color:#652487;background-image:linear-gradient(160deg,#652487 0,#443ac3 35%,#0174b7 68%,#04988e 100%);color:#e7e4eb}.hljs-subtr{color:#e7e4eb}.hljs-comment,.hljs-doctag,.hljs-meta,.hljs-quote{color:#af8dd9}.hljs-attr,.hljs-regexp,.hljs-selector-id,.hljs-selector-tag,.hljs-tag,.hljs-template-tag{color:#aefbff}.hljs-bullet,.hljs-params,.hljs-selector-class{color:#f19fff}.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-symbol,.hljs-type{color:#17fc95}.hljs-addition,.hljs-link,.hljs-number{color:#c5fe00}.hljs-string{color:#38c0ff}.hljs-addition,.hljs-attribute{color:#e7ff9f}.hljs-template-variable,.hljs-variable{color:#e447ff}.hljs-built_in,.hljs-class,.hljs-formula,.hljs-function,.hljs-name,.hljs-title{color:#ffc800}.hljs-deletion,.hljs-literal,.hljs-selector-pseudo{color:#ff9e44}.hljs-emphasis,.hljs-quote{font-style:italic}.hljs-keyword,.hljs-params,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-strong,.hljs-template-tag{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/gradient-light.css b/tools/ui/node_modules/highlight.js/styles/gradient-light.css new file mode 100644 index 0000000000000000000000000000000000000000..f9b5cbf2050692a5cd95a0cb25b81e822b494697 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/gradient-light.css @@ -0,0 +1,90 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Gradient Light (c) Samia Ali + +*/ +.hljs { + background-color: #f9ccff; + background-image: linear-gradient(295deg, #f9ccff 0%, #e6bbf9 11%, #9ec6f9 32%, #55e6ee 60%, #91f5d1 74%, #f9ffbf 98%); + color: #250482 +} +.hljs-subtr { + color: #01958B +} +.hljs-doctag, +.hljs-meta, +.hljs-comment, +.hljs-quote { + color: #CB7200 +} +.hljs-selector-tag, +.hljs-selector-id, +.hljs-template-tag, +.hljs-regexp, +.hljs-attr, +.hljs-tag { + color: #07BD5F +} +.hljs-params, +.hljs-selector-class, +.hljs-bullet { + color: #43449F +} +.hljs-keyword, +.hljs-section, +.hljs-meta .hljs-keyword, +.hljs-symbol, +.hljs-type { + color: #7D2801 +} +.hljs-addition, +.hljs-number, +.hljs-link { + color: #7F0096 +} +.hljs-string { + color: #2681ab +} +.hljs-attribute, +.hljs-addition { + color: #296562 +} +.hljs-variable, +.hljs-template-variable { + color: #025C8F +} +.hljs-built_in, +.hljs-formula, +.hljs-name, +.hljs-title, +.hljs-class, +.hljs-function { + color: #529117 +} +.hljs-selector-pseudo, +.hljs-deletion, +.hljs-literal { + color: #AD13FF +} +.hljs-emphasis, +.hljs-quote { + font-style: italic +} +.hljs-params, +.hljs-selector-class, +.hljs-strong, +.hljs-selector-tag, +.hljs-selector-id, +.hljs-template-tag, +.hljs-section, +.hljs-keyword { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/gradient-light.min.css b/tools/ui/node_modules/highlight.js/styles/gradient-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c5db6fd18fc4d07d3e0c2de2b50125e6fa6a9b21 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/gradient-light.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background-color:#f9ccff;background-image:linear-gradient(295deg,#f9ccff 0,#e6bbf9 11%,#9ec6f9 32%,#55e6ee 60%,#91f5d1 74%,#f9ffbf 98%);color:#250482}.hljs-subtr{color:#01958b}.hljs-comment,.hljs-doctag,.hljs-meta,.hljs-quote{color:#cb7200}.hljs-attr,.hljs-regexp,.hljs-selector-id,.hljs-selector-tag,.hljs-tag,.hljs-template-tag{color:#07bd5f}.hljs-bullet,.hljs-params,.hljs-selector-class{color:#43449f}.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-symbol,.hljs-type{color:#7d2801}.hljs-addition,.hljs-link,.hljs-number{color:#7f0096}.hljs-string{color:#2681ab}.hljs-addition,.hljs-attribute{color:#296562}.hljs-template-variable,.hljs-variable{color:#025c8f}.hljs-built_in,.hljs-class,.hljs-formula,.hljs-function,.hljs-name,.hljs-title{color:#529117}.hljs-deletion,.hljs-literal,.hljs-selector-pseudo{color:#ad13ff}.hljs-emphasis,.hljs-quote{font-style:italic}.hljs-keyword,.hljs-params,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-strong,.hljs-template-tag{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/grayscale.css b/tools/ui/node_modules/highlight.js/styles/grayscale.css new file mode 100644 index 0000000000000000000000000000000000000000..9790a8665ed8e658cb4b443d1d33e8ccd6aecf0a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/grayscale.css @@ -0,0 +1,89 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +grayscale style (c) MY Sun + +*/ +.hljs { + color: #333; + background: #fff +} +.hljs-comment, +.hljs-quote { + color: #777; + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { + color: #333; + font-weight: bold +} +.hljs-number, +.hljs-literal { + color: #777 +} +.hljs-string, +.hljs-doctag, +.hljs-formula { + color: #333; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJ0lEQVQIW2O8e/fufwYGBgZBQUEQxcCIIfDu3Tuwivfv30NUoAsAALHpFMMLqZlPAAAAAElFTkSuQmCC) repeat +} +.hljs-title, +.hljs-section, +.hljs-selector-id { + color: #000; + font-weight: bold +} +.hljs-subst { + font-weight: normal +} +.hljs-title.class_, +.hljs-class .hljs-title, +.hljs-type, +.hljs-name { + color: #333; + font-weight: bold +} +.hljs-tag { + color: #333 +} +.hljs-regexp { + color: #333; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAN37979r6yszIgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQDexSef15DBCwAAAABJRU5ErkJggg==) repeat +} +.hljs-symbol, +.hljs-bullet, +.hljs-link { + color: #000; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAO7d+/+z4gsBhJwdXVlhAvCBECKwIIwAbhKZBUwBQA6hBpm5efZsgAAAABJRU5ErkJggg==) repeat +} +.hljs-built_in { + color: #000; + text-decoration: underline +} +.hljs-meta { + color: #999; + font-weight: bold +} +.hljs-deletion { + color: #fff; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAE0lEQVQIW2MMDQ39zzhz5kwIAQAyxweWgUHd1AAAAABJRU5ErkJggg==) repeat +} +.hljs-addition { + color: #000; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALUlEQVQYV2N89+7dfwYk8P79ewZBQUFkIQZGOiu6e/cuiptQHAPl0NtNxAQBAM97Oejj3Dg7AAAAAElFTkSuQmCC) repeat +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/grayscale.min.css b/tools/ui/node_modules/highlight.js/styles/grayscale.min.css new file mode 100644 index 0000000000000000000000000000000000000000..5eefdaa931a9e0d770c3c1c2f045ca97eb1cc142 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/grayscale.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#333;background:#fff}.hljs-comment,.hljs-quote{color:#777;font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-subst{color:#333;font-weight:700}.hljs-literal,.hljs-number{color:#777}.hljs-doctag,.hljs-formula,.hljs-string{color:#333;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJ0lEQVQIW2O8e/fufwYGBgZBQUEQxcCIIfDu3Tuwivfv30NUoAsAALHpFMMLqZlPAAAAAElFTkSuQmCC)}.hljs-section,.hljs-selector-id,.hljs-title{color:#000;font-weight:700}.hljs-subst{font-weight:400}.hljs-class .hljs-title,.hljs-name,.hljs-title.class_,.hljs-type{color:#333;font-weight:700}.hljs-tag{color:#333}.hljs-regexp{color:#333;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAN37979r6yszIgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQDexSef15DBCwAAAABJRU5ErkJggg==)}.hljs-bullet,.hljs-link,.hljs-symbol{color:#000;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAO7d+/+z4gsBhJwdXVlhAvCBECKwIIwAbhKZBUwBQA6hBpm5efZsgAAAABJRU5ErkJggg==)}.hljs-built_in{color:#000;text-decoration:underline}.hljs-meta{color:#999;font-weight:700}.hljs-deletion{color:#fff;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAE0lEQVQIW2MMDQ39zzhz5kwIAQAyxweWgUHd1AAAAABJRU5ErkJggg==)}.hljs-addition{color:#000;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALUlEQVQYV2N89+7dfwYk8P79ewZBQUFkIQZGOiu6e/cuiptQHAPl0NtNxAQBAM97Oejj3Dg7AAAAAElFTkSuQmCC)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/hybrid.css b/tools/ui/node_modules/highlight.js/styles/hybrid.css new file mode 100644 index 0000000000000000000000000000000000000000..237701dc06935ebe9686c544ebf1b1fd8bf9aca5 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/hybrid.css @@ -0,0 +1,88 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid) + +*/ +.hljs { + background: #1d1f21; + color: #c5c8c6 +} +/*selection color*/ +.hljs::selection, +.hljs span::selection { + background: #373b41 +} +.hljs::-moz-selection, +.hljs span::-moz-selection { + background: #373b41 +} +/*color: fg_yellow*/ +.hljs-title, +.hljs-name { + color: #f0c674 +} +/*color: fg_comment*/ +.hljs-comment, +.hljs-meta, +.hljs-meta .hljs-keyword { + color: #707880 +} +/*color: fg_red*/ +.hljs-number, +.hljs-symbol, +.hljs-literal, +.hljs-deletion, +.hljs-link { + color: #cc6666 +} +/*color: fg_green*/ +.hljs-string, +.hljs-doctag, +.hljs-addition, +.hljs-regexp, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #b5bd68 +} +/*color: fg_purple*/ +.hljs-attribute, +.hljs-code, +.hljs-selector-id { + color: #b294bb +} +/*color: fg_blue*/ +.hljs-keyword, +.hljs-selector-tag, +.hljs-bullet, +.hljs-tag { + color: #81a2be +} +/*color: fg_aqua*/ +.hljs-subst, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #8abeb7 +} +/*color: fg_orange*/ +.hljs-type, +.hljs-built_in, +.hljs-quote, +.hljs-section, +.hljs-selector-class { + color: #de935f +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/hybrid.min.css b/tools/ui/node_modules/highlight.js/styles/hybrid.min.css new file mode 100644 index 0000000000000000000000000000000000000000..52489b6b37e177f9d2e5726c3e3fc01d9743d046 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/hybrid.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#1d1f21;color:#c5c8c6}.hljs span::selection,.hljs::selection{background:#373b41}.hljs span::-moz-selection,.hljs::-moz-selection{background:#373b41}.hljs-name,.hljs-title{color:#f0c674}.hljs-comment,.hljs-meta,.hljs-meta .hljs-keyword{color:#707880}.hljs-deletion,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol{color:#c66}.hljs-addition,.hljs-doctag,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string{color:#b5bd68}.hljs-attribute,.hljs-code,.hljs-selector-id{color:#b294bb}.hljs-bullet,.hljs-keyword,.hljs-selector-tag,.hljs-tag{color:#81a2be}.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-variable{color:#8abeb7}.hljs-built_in,.hljs-quote,.hljs-section,.hljs-selector-class,.hljs-type{color:#de935f}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/idea.css b/tools/ui/node_modules/highlight.js/styles/idea.css new file mode 100644 index 0000000000000000000000000000000000000000..03307df4a67940be423624e57e9b8b58835219c2 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/idea.css @@ -0,0 +1,86 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Intellij Idea-like styling (c) Vasily Polovnyov + +*/ +.hljs { + color: #000; + background: #fff +} +.hljs-subst, +.hljs-title { + font-weight: normal; + color: #000 +} +.hljs-comment, +.hljs-quote { + color: #808080; + font-style: italic +} +.hljs-meta { + color: #808000 +} +.hljs-tag { + background: #efefef +} +.hljs-section, +.hljs-name, +.hljs-literal, +.hljs-keyword, +.hljs-selector-tag, +.hljs-type, +.hljs-selector-id, +.hljs-selector-class { + font-weight: bold; + color: #000080 +} +.hljs-attribute, +.hljs-number, +.hljs-regexp, +.hljs-link { + font-weight: bold; + color: #0000ff +} +.hljs-number, +.hljs-regexp, +.hljs-link { + font-weight: normal +} +.hljs-string { + color: #008000; + font-weight: bold +} +.hljs-symbol, +.hljs-bullet, +.hljs-formula { + color: #000; + background: #d0eded; + font-style: italic +} +.hljs-doctag { + text-decoration: underline +} +.hljs-variable, +.hljs-template-variable { + color: #660e7a +} +.hljs-addition { + background: #baeeba +} +.hljs-deletion { + background: #ffc8bd +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/idea.min.css b/tools/ui/node_modules/highlight.js/styles/idea.min.css new file mode 100644 index 0000000000000000000000000000000000000000..7cc62ff35ed87a41638b2b33405183eca578c170 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/idea.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#000;background:#fff}.hljs-subst,.hljs-title{font-weight:400;color:#000}.hljs-comment,.hljs-quote{color:grey;font-style:italic}.hljs-meta{color:olive}.hljs-tag{background:#efefef}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type{font-weight:700;color:navy}.hljs-attribute,.hljs-link,.hljs-number,.hljs-regexp{font-weight:700;color:#00f}.hljs-link,.hljs-number,.hljs-regexp{font-weight:400}.hljs-string{color:green;font-weight:700}.hljs-bullet,.hljs-formula,.hljs-symbol{color:#000;background:#d0eded;font-style:italic}.hljs-doctag{text-decoration:underline}.hljs-template-variable,.hljs-variable{color:#660e7a}.hljs-addition{background:#baeeba}.hljs-deletion{background:#ffc8bd}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/intellij-light.css b/tools/ui/node_modules/highlight.js/styles/intellij-light.css new file mode 100644 index 0000000000000000000000000000000000000000..9140f80c579634c504db0f70d6ec19310acc300a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/intellij-light.css @@ -0,0 +1,107 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Intellij-light style (c) Pegasis + +*/ +.hljs { + color: #000; + background: #fff +} +.hljs-subst, +.hljs-title { + font-weight: normal; + color: #000 +} +.hljs-title.function_ { + color: #7A7A43 +} +.hljs-code, +.hljs-comment, +.hljs-quote { + color: #8C8C8C; + font-style: italic +} +.hljs-meta { + color: #9E880D +} +.hljs-section { + color: #871094 +} +.hljs-variable.language_, +.hljs-symbol, +.hljs-selector-class, +.hljs-selector-id, +.hljs-selector-tag, +.hljs-template-tag, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-keyword, +.hljs-meta .hljs-keyword, +.hljs-literal, +.hljs-name, +.hljs-built_in, +.hljs-type { + color: #0033B3 +} +.hljs-property, +.hljs-attr { + color: #871094 +} +.hljs-attribute { + color: #174AD4 +} +.hljs-number { + color: #1750EB +} +.hljs-regexp { + color: #264EFF +} +.hljs-link { + text-decoration: underline; + color: #006DCC +} +.hljs-meta .hljs-string, +.hljs-string { + color: #067D17 +} +.hljs-char.escape_ { + color: #0037A6 +} +.hljs-doctag { + text-decoration: underline +} +.hljs-template-variable { + color: #248F8F +} +.hljs-addition { + background: #BEE6BE +} +.hljs-deletion { + background: #D6D6D6 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-variable, +.hljs-operator, +.hljs-punctuation, +.hljs-title.class_.inherited__, +.hljs-title.class_, +.hljs-params, +.hljs-bullet, +.hljs-formula, +.hljs-tag { + /* purposely ignored */ + +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/intellij-light.min.css b/tools/ui/node_modules/highlight.js/styles/intellij-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..97fc3e2da477d6ab26c85d6d761d4af836dcb98a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/intellij-light.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#000;background:#fff}.hljs-subst,.hljs-title{font-weight:400;color:#000}.hljs-title.function_{color:#7a7a43}.hljs-code,.hljs-comment,.hljs-quote{color:#8c8c8c;font-style:italic}.hljs-meta{color:#9e880d}.hljs-section{color:#871094}.hljs-built_in,.hljs-keyword,.hljs-literal,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag,.hljs-symbol,.hljs-template-tag,.hljs-type,.hljs-variable.language_{color:#0033b3}.hljs-attr,.hljs-property{color:#871094}.hljs-attribute{color:#174ad4}.hljs-number{color:#1750eb}.hljs-regexp{color:#264eff}.hljs-link{text-decoration:underline;color:#006dcc}.hljs-meta .hljs-string,.hljs-string{color:#067d17}.hljs-char.escape_{color:#0037a6}.hljs-doctag{text-decoration:underline}.hljs-template-variable{color:#248f8f}.hljs-addition{background:#bee6be}.hljs-deletion{background:#d6d6d6}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/ir-black.css b/tools/ui/node_modules/highlight.js/styles/ir-black.css new file mode 100644 index 0000000000000000000000000000000000000000..3557853b97e6407c42010625dc536a2dd1bf2354 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/ir-black.css @@ -0,0 +1,66 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + IR_Black style (c) Vasily Mikhailitchenko +*/ +.hljs { + background: #000; + color: #f8f8f8 +} +.hljs-comment, +.hljs-quote, +.hljs-meta { + color: #7c7c7c +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-tag, +.hljs-name { + color: #96cbfe +} +.hljs-attribute, +.hljs-selector-id { + color: #ffffb6 +} +.hljs-string, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-addition { + color: #a8ff60 +} +.hljs-subst { + color: #daefa3 +} +.hljs-regexp, +.hljs-link { + color: #e9c062 +} +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-doctag { + color: #ffffb6 +} +.hljs-symbol, +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-literal { + color: #c6c5fe +} +.hljs-number, +.hljs-deletion { + color: #ff73fd +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/ir-black.min.css b/tools/ui/node_modules/highlight.js/styles/ir-black.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e78fd083b4378cbdf9193166fbe74410c6e4d5da --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/ir-black.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#000;color:#f8f8f8}.hljs-comment,.hljs-meta,.hljs-quote{color:#7c7c7c}.hljs-keyword,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#96cbfe}.hljs-attribute,.hljs-selector-id{color:#ffffb6}.hljs-addition,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string{color:#a8ff60}.hljs-subst{color:#daefa3}.hljs-link,.hljs-regexp{color:#e9c062}.hljs-doctag,.hljs-section,.hljs-title,.hljs-type{color:#ffffb6}.hljs-bullet,.hljs-literal,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#c6c5fe}.hljs-deletion,.hljs-number{color:#ff73fd}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/isbl-editor-dark.css b/tools/ui/node_modules/highlight.js/styles/isbl-editor-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..4787d0801c1277fd5adbacee04196cc5ff143723 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/isbl-editor-dark.css @@ -0,0 +1,94 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +ISBL Editor style dark color scheme (c) Dmitriy Tarasov + +*/ +.hljs { + background: #404040; + color: #f0f0f0 +} +/* Base color: saturation 0; */ +.hljs, +.hljs-subst { + color: #f0f0f0 +} +.hljs-comment { + color: #b5b5b5; + font-style: italic +} +.hljs-keyword, +.hljs-attribute, +.hljs-selector-tag, +.hljs-meta .hljs-keyword, +.hljs-doctag, +.hljs-name { + color: #f0f0f0; + font-weight: bold +} +/* User color: hue: 0 */ +.hljs-string { + color: #97bf0d +} +.hljs-type, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #f0f0f0 +} +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #e2c696 +} +/* Language color: hue: 90; */ +.hljs-built_in, +.hljs-literal { + color: #97bf0d; + font-weight: bold +} +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #397300 +} +.hljs-class { + color: #ce9d4d; + font-weight: bold +} +.hljs-title, +.hljs-section { + color: #df471e +} +.hljs-title>.hljs-built_in { + color: #81bce9; + font-weight: normal +} +/* Meta color: hue: 200 */ +.hljs-meta { + color: #1f7199 +} +.hljs-meta .hljs-string { + color: #4d99bf +} +/* Misc effects */ +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/isbl-editor-dark.min.css b/tools/ui/node_modules/highlight.js/styles/isbl-editor-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..535ef87a0a57c2b9f4abafed77791ef6f31acf64 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/isbl-editor-dark.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#404040}.hljs,.hljs-subst{color:#f0f0f0}.hljs-comment{color:#b5b5b5;font-style:italic}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{color:#f0f0f0;font-weight:700}.hljs-string{color:#97bf0d}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#f0f0f0}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#e2c696}.hljs-built_in,.hljs-literal{color:#97bf0d;font-weight:700}.hljs-addition,.hljs-bullet,.hljs-code{color:#397300}.hljs-class{color:#ce9d4d;font-weight:700}.hljs-section,.hljs-title{color:#df471e}.hljs-title>.hljs-built_in{color:#81bce9;font-weight:400}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/isbl-editor-light.css b/tools/ui/node_modules/highlight.js/styles/isbl-editor-light.css new file mode 100644 index 0000000000000000000000000000000000000000..cdbabbeb484975b7f1cc8612668412aeba26345d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/isbl-editor-light.css @@ -0,0 +1,93 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +ISBL Editor style light color schemec (c) Dmitriy Tarasov + +*/ +.hljs { + background: white; + color: black +} +/* Base color: saturation 0; */ +.hljs-subst { + color: black +} +.hljs-comment { + color: #555555; + font-style: italic +} +.hljs-keyword, +.hljs-attribute, +.hljs-selector-tag, +.hljs-meta .hljs-keyword, +.hljs-doctag, +.hljs-name { + color: #000000; + font-weight: bold +} +/* User color: hue: 0 */ +.hljs-string { + color: #000080 +} +.hljs-type, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #000000 +} +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #5e1700 +} +/* Language color: hue: 90; */ +.hljs-built_in, +.hljs-literal { + color: #000080; + font-weight: bold +} +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #397300 +} +.hljs-class { + color: #6f1C00; + font-weight: bold +} +.hljs-title, +.hljs-section { + color: #fb2c00 +} +.hljs-title>.hljs-built_in { + color: #008080; + font-weight: normal +} +/* Meta color: hue: 200 */ +.hljs-meta { + color: #1f7199 +} +.hljs-meta .hljs-string { + color: #4d99bf +} +/* Misc effects */ +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/isbl-editor-light.min.css b/tools/ui/node_modules/highlight.js/styles/isbl-editor-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..f008c740467ffea260e7693e21d794d491448cbb --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/isbl-editor-light.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-subst{color:#000}.hljs-comment{color:#555;font-style:italic}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{color:#000;font-weight:700}.hljs-string{color:navy}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#000}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#5e1700}.hljs-built_in,.hljs-literal{color:navy;font-weight:700}.hljs-addition,.hljs-bullet,.hljs-code{color:#397300}.hljs-class{color:#6f1c00;font-weight:700}.hljs-section,.hljs-title{color:#fb2c00}.hljs-title>.hljs-built_in{color:teal;font-weight:400}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/kimbie-dark.css b/tools/ui/node_modules/highlight.js/styles/kimbie-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..eddf4a04cccb73de3400f14e6ec31e428811bc72 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/kimbie-dark.css @@ -0,0 +1,69 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Name: Kimbie (dark) + Author: Jan T. Sott + License: Creative Commons Attribution-ShareAlike 4.0 Unported License + URL: https://github.com/idleberg/Kimbie-highlight.js +*/ +.hljs { + background: #221a0f; + color: #d3af86 +} +/* Kimbie Comment */ +.hljs-comment, +.hljs-quote { + color: #d6baad +} +/* Kimbie Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-meta { + color: #dc3958 +} +/* Kimbie Orange */ +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-deletion, +.hljs-link { + color: #f79a32 +} +/* Kimbie Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #889b4a +} +/* Kimbie Purple */ +.hljs-keyword, +.hljs-selector-tag, +.hljs-function { + color: #98676a +} +/* Kimbie Yellow */ +.hljs-title, +.hljs-section, +.hljs-attribute { + color: #f06431 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/kimbie-dark.min.css b/tools/ui/node_modules/highlight.js/styles/kimbie-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..cf56cea5c8e2c67d335ae0c1757ebb42a0b575f1 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/kimbie-dark.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#221a0f;color:#d3af86}.hljs-comment,.hljs-quote{color:#d6baad}.hljs-meta,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#dc3958}.hljs-built_in,.hljs-deletion,.hljs-link,.hljs-literal,.hljs-number,.hljs-params,.hljs-type{color:#f79a32}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#889b4a}.hljs-function,.hljs-keyword,.hljs-selector-tag{color:#98676a}.hljs-attribute,.hljs-section,.hljs-title{color:#f06431}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/kimbie-light.css b/tools/ui/node_modules/highlight.js/styles/kimbie-light.css new file mode 100644 index 0000000000000000000000000000000000000000..3cefadc8187157ecb2b5fcc2eb8edb9669546972 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/kimbie-light.css @@ -0,0 +1,69 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Name: Kimbie (light) + Author: Jan T. Sott + License: Creative Commons Attribution-ShareAlike 4.0 Unported License + URL: https://github.com/idleberg/Kimbie-highlight.js +*/ +.hljs { + background: #fbebd4; + color: #84613d +} +/* Kimbie Comment */ +.hljs-comment, +.hljs-quote { + color: #a57a4c +} +/* Kimbie Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-meta { + color: #dc3958 +} +/* Kimbie Orange */ +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-deletion, +.hljs-link { + color: #f79a32 +} +/* Kimbie Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #889b4a +} +/* Kimbie Purple */ +.hljs-keyword, +.hljs-selector-tag, +.hljs-function { + color: #98676a +} +/* Kimbie Yellow */ +.hljs-title, +.hljs-section, +.hljs-attribute { + color: #f06431 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/kimbie-light.min.css b/tools/ui/node_modules/highlight.js/styles/kimbie-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b9d0ea447e8b27a5f867b4d19461264275bd4a60 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/kimbie-light.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fbebd4;color:#84613d}.hljs-comment,.hljs-quote{color:#a57a4c}.hljs-meta,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#dc3958}.hljs-built_in,.hljs-deletion,.hljs-link,.hljs-literal,.hljs-number,.hljs-params,.hljs-type{color:#f79a32}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#889b4a}.hljs-function,.hljs-keyword,.hljs-selector-tag{color:#98676a}.hljs-attribute,.hljs-section,.hljs-title{color:#f06431}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/lightfair.css b/tools/ui/node_modules/highlight.js/styles/lightfair.css new file mode 100644 index 0000000000000000000000000000000000000000..5142dff04e1b0ed990866607ada1b9938b385cbe --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/lightfair.css @@ -0,0 +1,81 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Lightfair style (c) Tristian Kelly + +*/ +.hljs { + color: #444; + background: #fff +} +.hljs-name { + color: #01a3a3 +} +.hljs-tag, +.hljs-meta { + color: #778899 +} +.hljs-subst { + /* default */ + +} +.hljs-comment { + color: #888888 +} +.hljs-keyword, +.hljs-attribute, +.hljs-selector-tag, +.hljs-meta .hljs-keyword, +.hljs-doctag, +.hljs-name { + font-weight: bold +} +.hljs-type, +.hljs-string, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #4286f4 +} +.hljs-title, +.hljs-section { + color: #4286f4; + font-weight: bold +} +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #BC6060 +} +.hljs-literal { + color: #62bcbc +} +.hljs-built_in, +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #25c6c6 +} +.hljs-meta .hljs-string { + color: #4d99bf +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/lightfair.min.css b/tools/ui/node_modules/highlight.js/styles/lightfair.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b6c379184ada1e0ab2fed7674640fcfe4c7dc8c0 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/lightfair.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#444;background:#fff}.hljs-name{color:#01a3a3}.hljs-meta,.hljs-tag{color:#789}.hljs-comment{color:#888}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#4286f4}.hljs-section,.hljs-title{color:#4286f4;font-weight:700}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#bc6060}.hljs-literal{color:#62bcbc}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#25c6c6}.hljs-meta .hljs-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/lioshi.css b/tools/ui/node_modules/highlight.js/styles/lioshi.css new file mode 100644 index 0000000000000000000000000000000000000000..035611a344a2ddc88d5c790888caf48d606aa4cf --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/lioshi.css @@ -0,0 +1,76 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* lioshi Theme */ +/* Original theme - https://github.com/lioshi/vscode-lioshi-theme */ +.hljs { + background: #303030; + color: #c5c8c6 +} +/* Comment */ +.hljs-comment { + color: #8d8d8d +} +/* quote */ +.hljs-quote { + color: #b3c7d8 +} +/* Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion { + color: #cc6666 +} +/* Orange */ +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-subst +.hljs-link { + color: #de935f +} +/* Yellow */ +.hljs-attribute { + color: #f0c674 +} +/* Green */ +.hljs-string, +.hljs-bullet, +.hljs-params, +.hljs-addition { + color: #b5bd68 +} +/* Purple */ +.hljs-selector-tag, +.hljs-keyword, +.hljs-function, +.hljs-class { + color: #be94bb +} +/* Blue */ +.hljs-title, +.hljs-meta, +.hljs-section { + color: #81a2be +} +/* Purple light */ +.hljs-symbol { + color: #dbc4d9 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/lioshi.min.css b/tools/ui/node_modules/highlight.js/styles/lioshi.min.css new file mode 100644 index 0000000000000000000000000000000000000000..3d6a92f49283f7967e7357a59d78d63e79871aa8 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/lioshi.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#303030;color:#c5c8c6}.hljs-comment{color:#8d8d8d}.hljs-quote{color:#b3c7d8}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#c66}.hljs-built_in,.hljs-literal,.hljs-number,.hljs-subst .hljs-link,.hljs-type{color:#de935f}.hljs-attribute{color:#f0c674}.hljs-addition,.hljs-bullet,.hljs-params,.hljs-string{color:#b5bd68}.hljs-class,.hljs-function,.hljs-keyword,.hljs-selector-tag{color:#be94bb}.hljs-meta,.hljs-section,.hljs-title{color:#81a2be}.hljs-symbol{color:#dbc4d9}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/magula.css b/tools/ui/node_modules/highlight.js/styles/magula.css new file mode 100644 index 0000000000000000000000000000000000000000..9d304191fc1618eb5a528b13ccc41fbf1f3b4065 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/magula.css @@ -0,0 +1,66 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* +Description: Magula style for highligh.js +Author: Ruslan Keba +Website: http://rukeba.com/ +Version: 1.0 +Date: 2009-01-03 +Music: Aphex Twin / Xtal +*/ +.hljs { + background-color: #f4f4f4; + color: black +} +.hljs-subst { + color: black +} +.hljs-string, +.hljs-title, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #050 +} +.hljs-comment, +.hljs-quote { + color: #777 +} +.hljs-number, +.hljs-regexp, +.hljs-literal, +.hljs-type, +.hljs-link { + color: #800 +} +.hljs-deletion, +.hljs-meta { + color: #00e +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-doctag, +.hljs-title, +.hljs-section, +.hljs-built_in, +.hljs-tag, +.hljs-name { + font-weight: bold; + color: navy +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/magula.min.css b/tools/ui/node_modules/highlight.js/styles/magula.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e02438778aab2b5d94b2c99a592ccef0a51e2828 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/magula.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background-color:#f4f4f4;color:#000}.hljs-subst{color:#000}.hljs-addition,.hljs-attribute,.hljs-bullet,.hljs-string,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-variable{color:#050}.hljs-comment,.hljs-quote{color:#777}.hljs-link,.hljs-literal,.hljs-number,.hljs-regexp,.hljs-type{color:#800}.hljs-deletion,.hljs-meta{color:#00e}.hljs-built_in,.hljs-doctag,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-tag,.hljs-title{font-weight:700;color:navy}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/mono-blue.css b/tools/ui/node_modules/highlight.js/styles/mono-blue.css new file mode 100644 index 0000000000000000000000000000000000000000..bc9bceae4b10f424326c403ba72e4d936c371940 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/mono-blue.css @@ -0,0 +1,56 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Five-color theme from a single blue hue. +*/ +.hljs { + background: #eaeef3; + color: #00193a +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-title, +.hljs-section, +.hljs-doctag, +.hljs-name, +.hljs-strong { + font-weight: bold +} +.hljs-comment { + color: #738191 +} +.hljs-string, +.hljs-title, +.hljs-section, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-addition, +.hljs-tag, +.hljs-quote, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class { + color: #0048ab +} +.hljs-meta, +.hljs-subst, +.hljs-symbol, +.hljs-regexp, +.hljs-attribute, +.hljs-deletion, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-bullet { + color: #4c81c9 +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/mono-blue.min.css b/tools/ui/node_modules/highlight.js/styles/mono-blue.min.css new file mode 100644 index 0000000000000000000000000000000000000000..fb74d4056d2289c47b6aea3770e9cc9f0dc3abed --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/mono-blue.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#eaeef3;color:#00193a}.hljs-doctag,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title{font-weight:700}.hljs-comment{color:#738191}.hljs-addition,.hljs-built_in,.hljs-literal,.hljs-name,.hljs-quote,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-tag,.hljs-title,.hljs-type{color:#0048ab}.hljs-attribute,.hljs-bullet,.hljs-deletion,.hljs-link,.hljs-meta,.hljs-regexp,.hljs-subst,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#4c81c9}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/monokai-sublime.css b/tools/ui/node_modules/highlight.js/styles/monokai-sublime.css new file mode 100644 index 0000000000000000000000000000000000000000..b469dd4fdb414cc4cbe6a0ffbfb919beaa643d4e --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/monokai-sublime.css @@ -0,0 +1,76 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ + +*/ +.hljs { + background: #23241f; + color: #f8f8f2 +} +.hljs-tag, +.hljs-subst { + color: #f8f8f2 +} +.hljs-strong, +.hljs-emphasis { + color: #a8a8a2 +} +.hljs-bullet, +.hljs-quote, +.hljs-number, +.hljs-regexp, +.hljs-literal, +.hljs-link { + color: #ae81ff +} +.hljs-code, +.hljs-title, +.hljs-section, +.hljs-selector-class { + color: #a6e22e +} +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-name, +.hljs-attr { + color: #f92672 +} +.hljs-symbol, +.hljs-attribute { + color: #66d9ef +} +.hljs-params, +.hljs-title.class_, +.hljs-class .hljs-title { + color: #f8f8f2 +} +.hljs-string, +.hljs-type, +.hljs-built_in, +.hljs-selector-id, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-addition, +.hljs-variable, +.hljs-template-variable { + color: #e6db74 +} +.hljs-comment, +.hljs-deletion, +.hljs-meta { + color: #75715e +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/monokai-sublime.min.css b/tools/ui/node_modules/highlight.js/styles/monokai-sublime.min.css new file mode 100644 index 0000000000000000000000000000000000000000..247e2e91f7a96f2ad4666e5c303bf09acb80e51c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/monokai-sublime.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#23241f;color:#f8f8f2}.hljs-subst,.hljs-tag{color:#f8f8f2}.hljs-emphasis,.hljs-strong{color:#a8a8a2}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:#ae81ff}.hljs-code,.hljs-section,.hljs-selector-class,.hljs-title{color:#a6e22e}.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic}.hljs-attr,.hljs-keyword,.hljs-name,.hljs-selector-tag{color:#f92672}.hljs-attribute,.hljs-symbol{color:#66d9ef}.hljs-class .hljs-title,.hljs-params,.hljs-title.class_{color:#f8f8f2}.hljs-addition,.hljs-built_in,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-string,.hljs-template-variable,.hljs-type,.hljs-variable{color:#e6db74}.hljs-comment,.hljs-deletion,.hljs-meta{color:#75715e} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/monokai.css b/tools/ui/node_modules/highlight.js/styles/monokai.css new file mode 100644 index 0000000000000000000000000000000000000000..22a3922f98302e3239b092d72e14c2575fd9f5fe --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/monokai.css @@ -0,0 +1,70 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* +Monokai style - ported by Luigi Maselli - http://grigio.org +*/ +.hljs { + background: #272822; + color: #ddd +} +.hljs-tag, +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-strong, +.hljs-number, +.hljs-name { + color: #f92672 +} +.hljs-code { + color: #66d9ef +} +.hljs-attribute, +.hljs-attr, +.hljs-symbol, +.hljs-regexp, +.hljs-link { + color: #bf79db +} +.hljs-string, +.hljs-bullet, +.hljs-subst, +.hljs-title, +.hljs-section, +.hljs-emphasis, +.hljs-type, +.hljs-built_in, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #a6e22e +} +.hljs-title.class_, +.hljs-class .hljs-title { + color: white +} +.hljs-comment, +.hljs-quote, +.hljs-deletion, +.hljs-meta { + color: #75715e +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-doctag, +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-selector-id { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/monokai.min.css b/tools/ui/node_modules/highlight.js/styles/monokai.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d289f635dd63184025c2461f533ce3ae2c395251 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/monokai.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#272822;color:#ddd}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-number,.hljs-selector-tag,.hljs-strong,.hljs-tag{color:#f92672}.hljs-code{color:#66d9ef}.hljs-attr,.hljs-attribute,.hljs-link,.hljs-regexp,.hljs-symbol{color:#bf79db}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-section,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string,.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#a6e22e}.hljs-class .hljs-title,.hljs-title.class_{color:#fff}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#75715e}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-section,.hljs-selector-id,.hljs-selector-tag,.hljs-title,.hljs-type{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/night-owl.css b/tools/ui/node_modules/highlight.js/styles/night-owl.css new file mode 100644 index 0000000000000000000000000000000000000000..3cad0ebf943b354501be6b071e7aa2975dec3b91 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/night-owl.css @@ -0,0 +1,174 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Night Owl for highlight.js (c) Carl Baxter + +An adaptation of Sarah Drasner's Night Owl VS Code Theme +https://github.com/sdras/night-owl-vscode-theme + +Copyright (c) 2018 Sarah Drasner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ +.hljs { + background: #011627; + color: #d6deeb +} +/* General Purpose */ +.hljs-keyword { + color: #c792ea; + font-style: italic +} +.hljs-built_in { + color: #addb67; + font-style: italic +} +.hljs-type { + color: #82aaff +} +.hljs-literal { + color: #ff5874 +} +.hljs-number { + color: #F78C6C +} +.hljs-regexp { + color: #5ca7e4 +} +.hljs-string { + color: #ecc48d +} +.hljs-subst { + color: #d3423e +} +.hljs-symbol { + color: #82aaff +} +.hljs-class { + color: #ffcb8b +} +.hljs-function { + color: #82AAFF +} +.hljs-title { + color: #DCDCAA; + font-style: italic +} +.hljs-params { + color: #7fdbca +} +/* Meta */ +.hljs-comment { + color: #637777; + font-style: italic +} +.hljs-doctag { + color: #7fdbca +} +.hljs-meta { + color: #82aaff +} +.hljs-meta .hljs-keyword { + color: #82aaff +} +.hljs-meta .hljs-string { + color: #ecc48d +} +/* Tags, attributes, config */ +.hljs-section { + color: #82b1ff +} +.hljs-tag, +.hljs-name { + color: #7fdbca +} +.hljs-attr { + color: #7fdbca +} +.hljs-attribute { + color: #80cbc4 +} +.hljs-variable { + color: #addb67 +} +/* Markup */ +.hljs-bullet { + color: #d9f5dd +} +.hljs-code { + color: #80CBC4 +} +.hljs-emphasis { + color: #c792ea; + font-style: italic +} +.hljs-strong { + color: #addb67; + font-weight: bold +} +.hljs-formula { + color: #c792ea +} +.hljs-link { + color: #ff869a +} +.hljs-quote { + color: #697098; + font-style: italic +} +/* CSS */ +.hljs-selector-tag { + color: #ff6363 +} +.hljs-selector-id { + color: #fad430 +} +.hljs-selector-class { + color: #addb67; + font-style: italic +} +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #c792ea; + font-style: italic +} +/* Templates */ +.hljs-template-tag { + color: #c792ea +} +.hljs-template-variable { + color: #addb67 +} +/* diff */ +.hljs-addition { + color: #addb67ff; + font-style: italic +} +.hljs-deletion { + color: #EF535090; + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/night-owl.min.css b/tools/ui/node_modules/highlight.js/styles/night-owl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..ed945902d555b58322f2688df1d3f79eb0657e33 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/night-owl.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#011627;color:#d6deeb}.hljs-keyword{color:#c792ea;font-style:italic}.hljs-built_in{color:#addb67;font-style:italic}.hljs-type{color:#82aaff}.hljs-literal{color:#ff5874}.hljs-number{color:#f78c6c}.hljs-regexp{color:#5ca7e4}.hljs-string{color:#ecc48d}.hljs-subst{color:#d3423e}.hljs-symbol{color:#82aaff}.hljs-class{color:#ffcb8b}.hljs-function{color:#82aaff}.hljs-title{color:#dcdcaa;font-style:italic}.hljs-params{color:#7fdbca}.hljs-comment{color:#637777;font-style:italic}.hljs-doctag{color:#7fdbca}.hljs-meta,.hljs-meta .hljs-keyword{color:#82aaff}.hljs-meta .hljs-string{color:#ecc48d}.hljs-section{color:#82b1ff}.hljs-attr,.hljs-name,.hljs-tag{color:#7fdbca}.hljs-attribute{color:#80cbc4}.hljs-variable{color:#addb67}.hljs-bullet{color:#d9f5dd}.hljs-code{color:#80cbc4}.hljs-emphasis{color:#c792ea;font-style:italic}.hljs-strong{color:#addb67;font-weight:700}.hljs-formula{color:#c792ea}.hljs-link{color:#ff869a}.hljs-quote{color:#697098;font-style:italic}.hljs-selector-tag{color:#ff6363}.hljs-selector-id{color:#fad430}.hljs-selector-class{color:#addb67;font-style:italic}.hljs-selector-attr,.hljs-selector-pseudo{color:#c792ea;font-style:italic}.hljs-template-tag{color:#c792ea}.hljs-template-variable{color:#addb67}.hljs-addition{color:#addb67ff;font-style:italic}.hljs-deletion{color:#ef535090;font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/nnfx-dark.css b/tools/ui/node_modules/highlight.js/styles/nnfx-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..cbacc28843889f1e7d42a9ab545e0771c469235c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/nnfx-dark.css @@ -0,0 +1,104 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: nnfx dark + Description: a theme inspired by Netscape Navigator/Firefox + Author: (c) 2020-2021 Jim Mason + Maintainer: @RocketMan + License: https://creativecommons.org/licenses/by-sa/4.0 CC BY-SA 4.0 + Updated: 2021-05-17 + + @version 1.1.0 +*/ +.hljs { + background: #333; + color: #fff +} +.language-xml .hljs-meta, +.language-xml .hljs-meta-string { + font-weight: bold; + font-style: italic; + color: #69f +} +.hljs-comment, +.hljs-quote { + font-style: italic; + color: #9c6 +} +.hljs-name, +.hljs-keyword, +.hljs-built_in { + color: #a7a +} +.hljs-name, +.hljs-attr { + font-weight: bold +} +.hljs-string { + font-weight: normal +} +.hljs-code, +.hljs-string, +.hljs-meta .hljs-string, +.hljs-number, +.hljs-regexp, +.hljs-link { + color: #bce +} +.hljs-title, +.hljs-symbol, +.hljs-bullet, +.hljs-variable, +.hljs-template-variable { + color: #d40 +} +.hljs-title.class_, +.hljs-class .hljs-title, +.hljs-type { + font-weight: bold; + color: #96c +} +.hljs-title.function_, +.hljs-function .hljs-title, +.hljs-attr, +.hljs-subst, +.hljs-tag { + color: #fff +} +.hljs-formula { + background-color: #eee; + font-style: italic +} +.hljs-addition { + background-color: #797 +} +.hljs-deletion { + background-color: #c99 +} +.hljs-meta { + color: #69f +} +.hljs-section, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-pseudo, +.hljs-selector-tag { + font-weight: bold; + color: #69f +} +.hljs-selector-pseudo { + font-style: italic +} +.hljs-doctag, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/nnfx-dark.min.css b/tools/ui/node_modules/highlight.js/styles/nnfx-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..4e6403d6e365918c1a9a0d3dd92f8115805af59a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/nnfx-dark.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: nnfx dark + Description: a theme inspired by Netscape Navigator/Firefox + Author: (c) 2020-2021 Jim Mason + Maintainer: @RocketMan + License: https://creativecommons.org/licenses/by-sa/4.0 CC BY-SA 4.0 + Updated: 2021-05-17 + + @version 1.1.0 +*/.hljs{background:#333;color:#fff}.language-xml .hljs-meta,.language-xml .hljs-meta-string{font-weight:700;font-style:italic;color:#69f}.hljs-comment,.hljs-quote{font-style:italic;color:#9c6}.hljs-built_in,.hljs-keyword,.hljs-name{color:#a7a}.hljs-attr,.hljs-name{font-weight:700}.hljs-string{font-weight:400}.hljs-code,.hljs-link,.hljs-meta .hljs-string,.hljs-number,.hljs-regexp,.hljs-string{color:#bce}.hljs-bullet,.hljs-symbol,.hljs-template-variable,.hljs-title,.hljs-variable{color:#d40}.hljs-class .hljs-title,.hljs-title.class_,.hljs-type{font-weight:700;color:#96c}.hljs-attr,.hljs-function .hljs-title,.hljs-subst,.hljs-tag,.hljs-title.function_{color:#fff}.hljs-formula{background-color:#eee;font-style:italic}.hljs-addition{background-color:#797}.hljs-deletion{background-color:#c99}.hljs-meta{color:#69f}.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag{font-weight:700;color:#69f}.hljs-selector-pseudo{font-style:italic}.hljs-doctag,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/nnfx-light.css b/tools/ui/node_modules/highlight.js/styles/nnfx-light.css new file mode 100644 index 0000000000000000000000000000000000000000..87a04c69bfc61c16e92a41e282497eb06586ad88 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/nnfx-light.css @@ -0,0 +1,104 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: nnfx light + Description: a theme inspired by Netscape Navigator/Firefox + Author: (c) 2020-2021 Jim Mason + Maintainer: @RocketMan + License: https://creativecommons.org/licenses/by-sa/4.0 CC BY-SA 4.0 + Updated: 2021-05-17 + + @version 1.1.0 +*/ +.hljs { + background: #fff; + color: #000 +} +.language-xml .hljs-meta, +.language-xml .hljs-meta-string { + font-weight: bold; + font-style: italic; + color: #48b +} +.hljs-comment, +.hljs-quote { + font-style: italic; + color: #070 +} +.hljs-name, +.hljs-keyword, +.hljs-built_in { + color: #808 +} +.hljs-name, +.hljs-attr { + font-weight: bold +} +.hljs-string { + font-weight: normal +} +.hljs-code, +.hljs-string, +.hljs-meta .hljs-string, +.hljs-number, +.hljs-regexp, +.hljs-link { + color: #00f +} +.hljs-title, +.hljs-symbol, +.hljs-bullet, +.hljs-variable, +.hljs-template-variable { + color: #f40 +} +.hljs-title.class_, +.hljs-class .hljs-title, +.hljs-type { + font-weight: bold; + color: #639 +} +.hljs-title.function_, +.hljs-function .hljs-title, +.hljs-attr, +.hljs-subst, +.hljs-tag { + color: #000 +} +.hljs-formula { + background-color: #eee; + font-style: italic +} +.hljs-addition { + background-color: #beb +} +.hljs-deletion { + background-color: #fbb +} +.hljs-meta { + color: #269 +} +.hljs-section, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-pseudo, +.hljs-selector-tag { + font-weight: bold; + color: #48b +} +.hljs-selector-pseudo { + font-style: italic +} +.hljs-doctag, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/nnfx-light.min.css b/tools/ui/node_modules/highlight.js/styles/nnfx-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..469223a984c1683e45c0c2990138d1a0bffd983a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/nnfx-light.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: nnfx light + Description: a theme inspired by Netscape Navigator/Firefox + Author: (c) 2020-2021 Jim Mason + Maintainer: @RocketMan + License: https://creativecommons.org/licenses/by-sa/4.0 CC BY-SA 4.0 + Updated: 2021-05-17 + + @version 1.1.0 +*/.hljs{background:#fff;color:#000}.language-xml .hljs-meta,.language-xml .hljs-meta-string{font-weight:700;font-style:italic;color:#48b}.hljs-comment,.hljs-quote{font-style:italic;color:#070}.hljs-built_in,.hljs-keyword,.hljs-name{color:#808}.hljs-attr,.hljs-name{font-weight:700}.hljs-string{font-weight:400}.hljs-code,.hljs-link,.hljs-meta .hljs-string,.hljs-number,.hljs-regexp,.hljs-string{color:#00f}.hljs-bullet,.hljs-symbol,.hljs-template-variable,.hljs-title,.hljs-variable{color:#f40}.hljs-class .hljs-title,.hljs-title.class_,.hljs-type{font-weight:700;color:#639}.hljs-attr,.hljs-function .hljs-title,.hljs-subst,.hljs-tag,.hljs-title.function_{color:#000}.hljs-formula{background-color:#eee;font-style:italic}.hljs-addition{background-color:#beb}.hljs-deletion{background-color:#fbb}.hljs-meta{color:#269}.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag{font-weight:700;color:#48b}.hljs-selector-pseudo{font-style:italic}.hljs-doctag,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/nord.css b/tools/ui/node_modules/highlight.js/styles/nord.css new file mode 100644 index 0000000000000000000000000000000000000000..2e849af976a7983d548e2d0d8bc9286730b2bb43 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/nord.css @@ -0,0 +1,275 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + * Copyright (c) 2017-present Arctic Ice Studio + * Copyright (c) 2017-present Sven Greb + * + * Project: Nord highlight.js + * Version: 0.1.0 + * Repository: https://github.com/arcticicestudio/nord-highlightjs + * License: MIT + * References: + * https://github.com/arcticicestudio/nord + */ +/* + +Polar Night + +#2E3440 +#3B4252 +#434C5E +#4C566A + +Snow Storm + +#D8DEE9 +#E5E9F0 +#ECEFF4 + +Frost + +#8FBCBB +#88C0D0 +#81A1C1 +#5E81AC + +Aurora + +#BF616A +#D08770 +#EBCB8B +#A3BE8C +#B48EAD + +*/ +.hljs { + background: #2E3440 +} +.hljs, +.hljs-subst { + color: #D8DEE9 +} +.hljs-selector-tag { + color: #81A1C1 +} +.hljs-selector-id { + color: #8FBCBB; + font-weight: bold +} +.hljs-selector-class { + color: #8FBCBB +} +.hljs-selector-attr { + color: #8FBCBB +} +.hljs-property { + color: #88C0D0 +} +.hljs-selector-pseudo { + color: #88C0D0 +} +.hljs-addition { + background-color: rgba(163, 190, 140, 0.5) +} +.hljs-deletion { + background-color: rgba(191, 97, 106, 0.5) +} +.hljs-built_in, +.hljs-type { + color: #8FBCBB +} +.hljs-class { + color: #8FBCBB +} +.hljs-function { + color: #88C0D0 +} +.hljs-title.hljs-function, +.hljs-function > .hljs-title { + color: #88C0D0 +} +.hljs-keyword, +.hljs-literal, +.hljs-symbol { + color: #81A1C1 +} +.hljs-number { + color: #B48EAD +} +.hljs-regexp { + color: #EBCB8B +} +.hljs-string { + color: #A3BE8C +} +.hljs-title { + color: #8FBCBB +} +.hljs-params { + color: #D8DEE9 +} +.hljs-bullet { + color: #81A1C1 +} +.hljs-code { + color: #8FBCBB +} +.hljs-emphasis { + font-style: italic +} +.hljs-formula { + color: #8FBCBB +} +.hljs-strong { + font-weight: bold +} +.hljs-link:hover { + text-decoration: underline +} +.hljs-quote { + color: #4C566A +} +.hljs-comment { + color: #4C566A +} +.hljs-doctag { + color: #8FBCBB +} +.hljs-meta, +.hljs-meta .hljs-keyword { + color: #5E81AC +} +.hljs-meta .hljs-string { + color: #A3BE8C +} +.hljs-attr { + color: #8FBCBB +} +.hljs-attribute { + color: #D8DEE9 +} +.hljs-name { + color: #81A1C1 +} +.hljs-section { + color: #88C0D0 +} +.hljs-tag { + color: #81A1C1 +} +.hljs-variable { + color: #D8DEE9 +} +.hljs-template-variable { + color: #D8DEE9 +} +.hljs-template-tag { + color: #5E81AC +} +/* per language customizations */ +.language-abnf .hljs-attribute { + color: #88C0D0 +} +.language-abnf .hljs-symbol { + color: #EBCB8B +} +.language-apache .hljs-attribute { + color: #88C0D0 +} +.language-apache .hljs-section { + color: #81A1C1 +} +.language-arduino .hljs-built_in { + color: #88C0D0 +} +.language-aspectj .hljs-meta { + color: #D08770 +} +.language-aspectj > .hljs-title { + color: #88C0D0 +} +.language-bnf .hljs-attribute { + color: #8FBCBB +} +.language-clojure .hljs-name { + color: #88C0D0 +} +.language-clojure .hljs-symbol { + color: #EBCB8B +} +.language-coq .hljs-built_in { + color: #88C0D0 +} +.language-cpp .hljs-meta .hljs-string { + color: #8FBCBB +} +.language-css .hljs-built_in { + color: #88C0D0 +} +.language-css .hljs-keyword { + color: #D08770 +} +.language-diff .hljs-meta { + color: #8FBCBB +} +.language-ebnf .hljs-attribute { + color: #8FBCBB +} +.language-glsl .hljs-built_in { + color: #88C0D0 +} +.language-groovy .hljs-meta:not(:first-child) { + color: #D08770 +} +.language-haxe .hljs-meta { + color: #D08770 +} +.language-java .hljs-meta { + color: #D08770 +} +.language-ldif .hljs-attribute { + color: #8FBCBB +} +.language-lisp .hljs-name { + color: #88C0D0 +} +.language-lua .hljs-built_in { + color: #88C0D0 +} +.language-moonscript .hljs-built_in { + color: #88C0D0 +} +.language-nginx .hljs-attribute { + color: #88C0D0 +} +.language-nginx .hljs-section { + color: #5E81AC +} +.language-pf .hljs-built_in { + color: #88C0D0 +} +.language-processing .hljs-built_in { + color: #88C0D0 +} +.language-scss .hljs-keyword { + color: #81A1C1 +} +.language-stylus .hljs-keyword { + color: #81A1C1 +} +.language-swift .hljs-meta { + color: #D08770 +} +.language-vim .hljs-built_in { + color: #88C0D0; + font-style: italic +} +.language-yaml .hljs-meta { + color: #D08770 +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/nord.min.css b/tools/ui/node_modules/highlight.js/styles/nord.min.css new file mode 100644 index 0000000000000000000000000000000000000000..efbb0c13e6fd658a36af01e2d930e57333227e5c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/nord.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#2e3440}.hljs,.hljs-subst{color:#d8dee9}.hljs-selector-tag{color:#81a1c1}.hljs-selector-id{color:#8fbcbb;font-weight:700}.hljs-selector-attr,.hljs-selector-class{color:#8fbcbb}.hljs-property,.hljs-selector-pseudo{color:#88c0d0}.hljs-addition{background-color:rgba(163,190,140,.5)}.hljs-deletion{background-color:rgba(191,97,106,.5)}.hljs-built_in,.hljs-class,.hljs-type{color:#8fbcbb}.hljs-function,.hljs-function>.hljs-title,.hljs-title.hljs-function{color:#88c0d0}.hljs-keyword,.hljs-literal,.hljs-symbol{color:#81a1c1}.hljs-number{color:#b48ead}.hljs-regexp{color:#ebcb8b}.hljs-string{color:#a3be8c}.hljs-title{color:#8fbcbb}.hljs-params{color:#d8dee9}.hljs-bullet{color:#81a1c1}.hljs-code{color:#8fbcbb}.hljs-emphasis{font-style:italic}.hljs-formula{color:#8fbcbb}.hljs-strong{font-weight:700}.hljs-link:hover{text-decoration:underline}.hljs-comment,.hljs-quote{color:#4c566a}.hljs-doctag{color:#8fbcbb}.hljs-meta,.hljs-meta .hljs-keyword{color:#5e81ac}.hljs-meta .hljs-string{color:#a3be8c}.hljs-attr{color:#8fbcbb}.hljs-attribute{color:#d8dee9}.hljs-name{color:#81a1c1}.hljs-section{color:#88c0d0}.hljs-tag{color:#81a1c1}.hljs-template-variable,.hljs-variable{color:#d8dee9}.hljs-template-tag{color:#5e81ac}.language-abnf .hljs-attribute{color:#88c0d0}.language-abnf .hljs-symbol{color:#ebcb8b}.language-apache .hljs-attribute{color:#88c0d0}.language-apache .hljs-section{color:#81a1c1}.language-arduino .hljs-built_in{color:#88c0d0}.language-aspectj .hljs-meta{color:#d08770}.language-aspectj>.hljs-title{color:#88c0d0}.language-bnf .hljs-attribute{color:#8fbcbb}.language-clojure .hljs-name{color:#88c0d0}.language-clojure .hljs-symbol{color:#ebcb8b}.language-coq .hljs-built_in{color:#88c0d0}.language-cpp .hljs-meta .hljs-string{color:#8fbcbb}.language-css .hljs-built_in{color:#88c0d0}.language-css .hljs-keyword{color:#d08770}.language-diff .hljs-meta,.language-ebnf .hljs-attribute{color:#8fbcbb}.language-glsl .hljs-built_in{color:#88c0d0}.language-groovy .hljs-meta:not(:first-child),.language-haxe .hljs-meta,.language-java .hljs-meta{color:#d08770}.language-ldif .hljs-attribute{color:#8fbcbb}.language-lisp .hljs-name,.language-lua .hljs-built_in,.language-moonscript .hljs-built_in,.language-nginx .hljs-attribute{color:#88c0d0}.language-nginx .hljs-section{color:#5e81ac}.language-pf .hljs-built_in,.language-processing .hljs-built_in{color:#88c0d0}.language-scss .hljs-keyword,.language-stylus .hljs-keyword{color:#81a1c1}.language-swift .hljs-meta{color:#d08770}.language-vim .hljs-built_in{color:#88c0d0;font-style:italic}.language-yaml .hljs-meta{color:#d08770} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/obsidian.css b/tools/ui/node_modules/highlight.js/styles/obsidian.css new file mode 100644 index 0000000000000000000000000000000000000000..df7af1deb3e4c59f43820e2ffac3ce8b13c91c7a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/obsidian.css @@ -0,0 +1,79 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/** + * Obsidian style + * ported by Alexander Marenin (http://github.com/ioncreature) + */ +.hljs { + color: #e0e2e4; + background: #282b2e +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-selector-id { + color: #93c763 +} +.hljs-number { + color: #ffcd22 +} +.hljs-attribute { + color: #668bb0 +} +.hljs-regexp, +.hljs-link { + color: #d39745 +} +.hljs-meta { + color: #557182 +} +.hljs-tag, +.hljs-name, +.hljs-bullet, +.hljs-subst, +.hljs-emphasis, +.hljs-type, +.hljs-built_in, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #8cbbad +} +.hljs-string, +.hljs-symbol { + color: #ec7600 +} +.hljs-comment, +.hljs-quote, +.hljs-deletion { + color: #818e96 +} +.hljs-selector-class { + color: #A082BD +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-doctag, +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-name, +.hljs-strong { + font-weight: bold +} +.hljs-code, +.hljs-title.class_, +.hljs-class .hljs-title, +.hljs-section { + color: white +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/obsidian.min.css b/tools/ui/node_modules/highlight.js/styles/obsidian.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c2a07865162125c9cf554edfde7e28d252cad63f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/obsidian.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e0e2e4;background:#282b2e}.hljs-keyword,.hljs-literal,.hljs-selector-id,.hljs-selector-tag{color:#93c763}.hljs-number{color:#ffcd22}.hljs-attribute{color:#668bb0}.hljs-link,.hljs-regexp{color:#d39745}.hljs-meta{color:#557182}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-name,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-subst,.hljs-tag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable{color:#8cbbad}.hljs-string,.hljs-symbol{color:#ec7600}.hljs-comment,.hljs-deletion,.hljs-quote{color:#818e96}.hljs-selector-class{color:#a082bd}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title,.hljs-type{font-weight:700}.hljs-class .hljs-title,.hljs-code,.hljs-section,.hljs-title.class_{color:#fff} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/panda-syntax-dark.css b/tools/ui/node_modules/highlight.js/styles/panda-syntax-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..9a0695d13acf50caa58b6fedca87ecb2f7463faf --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/panda-syntax-dark.css @@ -0,0 +1,92 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/** + * Panda Syntax Theme for Highlight.js + * Based on: https://github.com/tinkertrain/panda-syntax-vscode + * Author: Annmarie Switzer + */ +.hljs { + color: #e6e6e6; + background: #2a2c2d +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-link { + text-decoration: underline +} +.hljs-comment, +.hljs-quote { + color: #bbbbbb; + font-style: italic +} +.hljs-params { + color: #bbbbbb +} +.hljs-punctuation, +.hljs-attr { + color: #e6e6e6 +} +.hljs-selector-tag, +.hljs-name, +.hljs-meta { + color: #ff4b82 +} +.hljs-operator, +.hljs-char.escape_ { + color: #b084eb +} +.hljs-keyword, +.hljs-deletion { + color: #ff75b5 +} +.hljs-regexp, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_ { + color: #ff9ac1 +} +.hljs-subst, +.hljs-property, +.hljs-code, +.hljs-formula, +.hljs-section, +.hljs-title.function_ { + color: #45a9f9 +} +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-selector-class, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-meta .hljs-string { + color: #19f9d8 +} +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-link, +.hljs-built_in, +.hljs-title, +.hljs-selector-id, +.hljs-tag, +.hljs-doctag, +.hljs-attribute, +.hljs-template-tag, +.hljs-meta .hljs-keyword, +.hljs-punctuation { + color: #ffb86c +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/panda-syntax-dark.min.css b/tools/ui/node_modules/highlight.js/styles/panda-syntax-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..55e26c684b745a787cf7464a8e48f8846c8e0409 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/panda-syntax-dark.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e6e6e6;background:#2a2c2d}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}.hljs-comment,.hljs-quote{color:#bbb;font-style:italic}.hljs-params{color:#bbb}.hljs-attr,.hljs-punctuation{color:#e6e6e6}.hljs-meta,.hljs-name,.hljs-selector-tag{color:#ff4b82}.hljs-char.escape_,.hljs-operator{color:#b084eb}.hljs-deletion,.hljs-keyword{color:#ff75b5}.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-variable.language_{color:#ff9ac1}.hljs-code,.hljs-formula,.hljs-property,.hljs-section,.hljs-subst,.hljs-title.function_{color:#45a9f9}.hljs-addition,.hljs-bullet,.hljs-meta .hljs-string,.hljs-selector-class,.hljs-string,.hljs-symbol,.hljs-title.class_,.hljs-title.class_.inherited__{color:#19f9d8}.hljs-attribute,.hljs-built_in,.hljs-doctag,.hljs-link,.hljs-literal,.hljs-meta .hljs-keyword,.hljs-number,.hljs-punctuation,.hljs-selector-id,.hljs-tag,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#ffb86c} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/panda-syntax-light.css b/tools/ui/node_modules/highlight.js/styles/panda-syntax-light.css new file mode 100644 index 0000000000000000000000000000000000000000..4bb4024727b2f674daa412a004ec7eae8a5d6f5c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/panda-syntax-light.css @@ -0,0 +1,89 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/** + * Panda Syntax Theme for Highlight.js + * Based on: https://github.com/tinkertrain/panda-syntax-vscode + * Author: Annmarie Switzer + */ +.hljs { + color: #2a2c2d; + background: #e6e6e6 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-link { + text-decoration: underline +} +.hljs-comment, +.hljs-quote { + color: #676B79; + font-style: italic +} +.hljs-params { + color: #676B79 +} +.hljs-punctuation, +.hljs-attr { + color: #2a2c2d +} +.hljs-selector-tag, +.hljs-name, +.hljs-meta, +.hljs-operator, +.hljs-char.escape_ { + color: #c56200 +} +.hljs-keyword, +.hljs-deletion { + color: #d92792 +} +.hljs-regexp, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_ { + color: #cc5e91 +} +.hljs-subst, +.hljs-property, +.hljs-code, +.hljs-formula, +.hljs-section, +.hljs-title.function_ { + color: #3787c7 +} +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-selector-class, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-meta .hljs-string { + color: #0d7d6c +} +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-link, +.hljs-built_in, +.hljs-title, +.hljs-selector-id, +.hljs-tag, +.hljs-doctag, +.hljs-attribute, +.hljs-template-tag, +.hljs-meta .hljs-keyword { + color: #7641bb +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/panda-syntax-light.min.css b/tools/ui/node_modules/highlight.js/styles/panda-syntax-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..6710dbdf4e316853fee39abe96446e5305429fef --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/panda-syntax-light.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#2a2c2d;background:#e6e6e6}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}.hljs-comment,.hljs-quote{color:#676b79;font-style:italic}.hljs-params{color:#676b79}.hljs-attr,.hljs-punctuation{color:#2a2c2d}.hljs-char.escape_,.hljs-meta,.hljs-name,.hljs-operator,.hljs-selector-tag{color:#c56200}.hljs-deletion,.hljs-keyword{color:#d92792}.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-variable.language_{color:#cc5e91}.hljs-code,.hljs-formula,.hljs-property,.hljs-section,.hljs-subst,.hljs-title.function_{color:#3787c7}.hljs-addition,.hljs-bullet,.hljs-meta .hljs-string,.hljs-selector-class,.hljs-string,.hljs-symbol,.hljs-title.class_,.hljs-title.class_.inherited__{color:#0d7d6c}.hljs-attribute,.hljs-built_in,.hljs-doctag,.hljs-link,.hljs-literal,.hljs-meta .hljs-keyword,.hljs-number,.hljs-selector-id,.hljs-tag,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#7641bb} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/paraiso-dark.css b/tools/ui/node_modules/highlight.js/styles/paraiso-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..e375a883166ae37eef677ad74f710ea82380a413 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/paraiso-dark.css @@ -0,0 +1,67 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Paraíso (dark) + Created by Jan T. Sott (http://github.com/idleberg) + Inspired by the art of Rubens LP (http://www.rubenslp.com.br) +*/ +.hljs { + background: #2f1e2e; + color: #a39e9b +} +/* Paraíso Comment */ +.hljs-comment, +.hljs-quote { + color: #8d8687 +} +/* Paraíso Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-link, +.hljs-meta { + color: #ef6155 +} +/* Paraíso Orange */ +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-deletion { + color: #f99b15 +} +/* Paraíso Yellow */ +.hljs-title, +.hljs-section, +.hljs-attribute { + color: #fec418 +} +/* Paraíso Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #48b685 +} +/* Paraíso Purple */ +.hljs-keyword, +.hljs-selector-tag { + color: #815ba4 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/paraiso-dark.min.css b/tools/ui/node_modules/highlight.js/styles/paraiso-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d51dd185b2cffddca4fc81b996d95f969516a190 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/paraiso-dark.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#2f1e2e;color:#a39e9b}.hljs-comment,.hljs-quote{color:#8d8687}.hljs-link,.hljs-meta,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ef6155}.hljs-built_in,.hljs-deletion,.hljs-literal,.hljs-number,.hljs-params,.hljs-type{color:#f99b15}.hljs-attribute,.hljs-section,.hljs-title{color:#fec418}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#48b685}.hljs-keyword,.hljs-selector-tag{color:#815ba4}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/paraiso-light.css b/tools/ui/node_modules/highlight.js/styles/paraiso-light.css new file mode 100644 index 0000000000000000000000000000000000000000..ef527f090eb96d55b8e96e51cdedb0c63afd50d1 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/paraiso-light.css @@ -0,0 +1,67 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + Paraíso (light) + Created by Jan T. Sott (http://github.com/idleberg) + Inspired by the art of Rubens LP (http://www.rubenslp.com.br) +*/ +.hljs { + background: #e7e9db; + color: #4f424c +} +/* Paraíso Comment */ +.hljs-comment, +.hljs-quote { + color: #776e71 +} +/* Paraíso Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-link, +.hljs-meta { + color: #ef6155 +} +/* Paraíso Orange */ +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-deletion { + color: #f99b15 +} +/* Paraíso Yellow */ +.hljs-title, +.hljs-section, +.hljs-attribute { + color: #fec418 +} +/* Paraíso Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #48b685 +} +/* Paraíso Purple */ +.hljs-keyword, +.hljs-selector-tag { + color: #815ba4 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/paraiso-light.min.css b/tools/ui/node_modules/highlight.js/styles/paraiso-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..3a17c3f8781fe4e6f0eb25c6427f78237eb9aea9 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/paraiso-light.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#e7e9db;color:#4f424c}.hljs-comment,.hljs-quote{color:#776e71}.hljs-link,.hljs-meta,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ef6155}.hljs-built_in,.hljs-deletion,.hljs-literal,.hljs-number,.hljs-params,.hljs-type{color:#f99b15}.hljs-attribute,.hljs-section,.hljs-title{color:#fec418}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#48b685}.hljs-keyword,.hljs-selector-tag{color:#815ba4}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/pojoaque.css b/tools/ui/node_modules/highlight.js/styles/pojoaque.css new file mode 100644 index 0000000000000000000000000000000000000000..e04bf70c672ccc09e647af77d75f537176052b5d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/pojoaque.css @@ -0,0 +1,76 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Pojoaque Style by Jason Tate +http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html +Based on Solarized Style from http://ethanschoonover.com/solarized + +*/ +.hljs { + color: #dccf8f; + background: url(./pojoaque.jpg) repeat scroll left top #181914 +} +.hljs-comment, +.hljs-quote { + color: #586e75; + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-addition { + color: #b64926 +} +.hljs-number, +.hljs-string, +.hljs-doctag, +.hljs-regexp { + color: #468966 +} +.hljs-title, +.hljs-section, +.hljs-built_in, +.hljs-name { + color: #ffb03b +} +.hljs-variable, +.hljs-template-variable, +.hljs-title.class_, +.hljs-class .hljs-title, +.hljs-type, +.hljs-tag { + color: #b58900 +} +.hljs-attribute { + color: #b89859 +} +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-subst, +.hljs-meta { + color: #cb4b16 +} +.hljs-deletion { + color: #dc322f +} +.hljs-selector-id, +.hljs-selector-class { + color: #d3a60c +} +.hljs-formula { + background: #073642 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/pojoaque.jpg b/tools/ui/node_modules/highlight.js/styles/pojoaque.jpg new file mode 100644 index 0000000000000000000000000000000000000000..55ee9951345e7f858d09846e11212dc8afe71a94 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/pojoaque.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:499141b14881b3c0e369666fa11cfc38afb7c05d7ced6e1b25fb0c61b5f386ed +size 1186 diff --git a/tools/ui/node_modules/highlight.js/styles/pojoaque.min.css b/tools/ui/node_modules/highlight.js/styles/pojoaque.min.css new file mode 100644 index 0000000000000000000000000000000000000000..71345a9c17ffb098c06c1cea30d4e16683c9ea2c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/pojoaque.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#dccf8f;background:url(./pojoaque.jpg) left top #181914}.hljs-comment,.hljs-quote{color:#586e75;font-style:italic}.hljs-addition,.hljs-keyword,.hljs-literal,.hljs-selector-tag{color:#b64926}.hljs-doctag,.hljs-number,.hljs-regexp,.hljs-string{color:#468966}.hljs-built_in,.hljs-name,.hljs-section,.hljs-title{color:#ffb03b}.hljs-class .hljs-title,.hljs-tag,.hljs-template-variable,.hljs-title.class_,.hljs-type,.hljs-variable{color:#b58900}.hljs-attribute{color:#b89859}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-subst,.hljs-symbol{color:#cb4b16}.hljs-deletion{color:#dc322f}.hljs-selector-class,.hljs-selector-id{color:#d3a60c}.hljs-formula{background:#073642}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/purebasic.css b/tools/ui/node_modules/highlight.js/styles/purebasic.css new file mode 100644 index 0000000000000000000000000000000000000000..3529efd01ee5a07e6581c89271099de93b87ac79 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/purebasic.css @@ -0,0 +1,103 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +PureBASIC native IDE style ( version 1.0 - April 2016 ) + +by Tristano Ajmone + +Public Domain + +NOTE_1: PureBASIC code syntax highlighting only applies the following classes: + .hljs-comment + .hljs-function + .hljs-keywords + .hljs-string + .hljs-symbol + + Other classes are added here for the benefit of styling other languages with the look and feel of PureBASIC native IDE style. + If you need to customize a stylesheet for PureBASIC only, remove all non-relevant classes -- PureBASIC-related classes are followed by + a "--- used for PureBASIC ... ---" comment on same line. + +NOTE_2: Color names provided in comments were derived using "Name that Color" online tool: + http://chir.ag/projects/name-that-color +*/ +.hljs { + background: #FFFFDF/* Half and Half (approx.) */ + +} +/* --- used for PureBASIC base color --- */ +/* --- used for PureBASIC Procedures return type --- */ +/* --- used for wrapping PureBASIC Procedures definitions --- */ +.hljs, +.hljs-type, +.hljs-function, +.hljs-name, +.hljs-number, +.hljs-attr, +.hljs-params, +.hljs-subst { + color: #000000/* Black */ + +} +/* --- used for PureBASIC Comments --- */ +.hljs-comment, +.hljs-regexp, +.hljs-section, +.hljs-selector-pseudo, +.hljs-addition { + color: #00AAAA/* Persian Green (approx.) */ + +} +/* --- used for PureBASIC Keywords --- */ +.hljs-keyword, +.hljs-class, +.hljs-meta .hljs-keyword, +.hljs-selector-class, +.hljs-built_in { + color: #006666; + /* Blue Stone (approx.) */ + font-weight: bold +} +/* --- used for PureBASIC Procedures Names --- */ +.hljs-title, +.hljs-tag, +.hljs-variable, +.hljs-code { + color: #006666/* Blue Stone (approx.) */ + +} +/* --- used for PureBASIC Strings --- */ +.hljs-string, +.hljs-selector-attr { + color: #0080FF/* Azure Radiance (approx.) */ + +} +/* --- used for PureBASIC Constants --- */ +.hljs-symbol, +.hljs-link, +.hljs-deletion, +.hljs-attribute { + color: #924B72/* Cannon Pink (approx.) */ + +} +.hljs-meta, +.hljs-literal, +.hljs-selector-id { + color: #924B72; + /* Cannon Pink (approx.) */ + font-weight: bold +} +.hljs-strong, +.hljs-name { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/purebasic.min.css b/tools/ui/node_modules/highlight.js/styles/purebasic.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e026c45c3b16301314e83776fe62426cfa8425cf --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/purebasic.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#ffffdf}.hljs,.hljs-attr,.hljs-function,.hljs-name,.hljs-number,.hljs-params,.hljs-subst,.hljs-type{color:#000}.hljs-addition,.hljs-comment,.hljs-regexp,.hljs-section,.hljs-selector-pseudo{color:#0aa}.hljs-built_in,.hljs-class,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-selector-class{color:#066;font-weight:700}.hljs-code,.hljs-tag,.hljs-title,.hljs-variable{color:#066}.hljs-selector-attr,.hljs-string{color:#0080ff}.hljs-attribute,.hljs-deletion,.hljs-link,.hljs-symbol{color:#924b72}.hljs-literal,.hljs-meta,.hljs-selector-id{color:#924b72;font-weight:700}.hljs-name,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/qtcreator-dark.css b/tools/ui/node_modules/highlight.js/styles/qtcreator-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..a655384230bbf353d10aba199168e8bae777ed49 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/qtcreator-dark.css @@ -0,0 +1,76 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Qt Creator dark color scheme + +*/ +.hljs { + color: #aaaaaa; + background: #000000 +} +.hljs-strong, +.hljs-emphasis { + color: #a8a8a2 +} +.hljs-bullet, +.hljs-quote, +.hljs-number, +.hljs-regexp, +.hljs-literal { + color: #ff55ff +} +.hljs-code +.hljs-selector-class { + color: #aaaaff +} +.hljs-emphasis, +.hljs-stronge, +.hljs-type { + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-function, +.hljs-section, +.hljs-symbol, +.hljs-name { + color: #ffff55 +} +.hljs-subst, +.hljs-tag, +.hljs-title { + color: #aaaaaa +} +.hljs-attribute { + color: #ff5555 +} +.hljs-variable, +.hljs-params, +.hljs-title.class_, +.hljs-class .hljs-title { + color: #8888ff +} +.hljs-string, +.hljs-selector-id, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-type, +.hljs-built_in, +.hljs-template-tag, +.hljs-template-variable, +.hljs-addition, +.hljs-link { + color: #ff55ff +} +.hljs-comment, +.hljs-meta, +.hljs-deletion { + color: #55ffff +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/qtcreator-dark.min.css b/tools/ui/node_modules/highlight.js/styles/qtcreator-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..976e519e474e297060dfc9128024f0e55708ca57 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/qtcreator-dark.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#aaa;background:#000}.hljs-emphasis,.hljs-strong{color:#a8a8a2}.hljs-bullet,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:#f5f}.hljs-code .hljs-selector-class{color:#aaf}.hljs-emphasis,.hljs-stronge,.hljs-type{font-style:italic}.hljs-function,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-symbol{color:#ff5}.hljs-subst,.hljs-tag,.hljs-title{color:#aaa}.hljs-attribute{color:#f55}.hljs-class .hljs-title,.hljs-params,.hljs-title.class_,.hljs-variable{color:#88f}.hljs-addition,.hljs-built_in,.hljs-link,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-type{color:#f5f}.hljs-comment,.hljs-deletion,.hljs-meta{color:#5ff} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/qtcreator-light.css b/tools/ui/node_modules/highlight.js/styles/qtcreator-light.css new file mode 100644 index 0000000000000000000000000000000000000000..327126d9049ac5c0bf1166ccc57fc666537dfe44 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/qtcreator-light.css @@ -0,0 +1,74 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* +Qt Creator light color scheme +*/ +.hljs { + color: #000000; + background: #ffffff +} +.hljs-strong, +.hljs-emphasis { + color: #000000 +} +.hljs-bullet, +.hljs-quote, +.hljs-number, +.hljs-regexp, +.hljs-literal { + color: #000080 +} +.hljs-code +.hljs-selector-class { + color: #800080 +} +.hljs-emphasis, +.hljs-stronge, +.hljs-type { + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-function, +.hljs-section, +.hljs-symbol, +.hljs-name { + color: #808000 +} +.hljs-subst, +.hljs-tag, +.hljs-title { + color: #000000 +} +.hljs-attribute { + color: #800000 +} +.hljs-variable, +.hljs-params, +.hljs-title.class_, +.hljs-class .hljs-title { + color: #0055AF +} +.hljs-string, +.hljs-selector-id, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-type, +.hljs-built_in, +.hljs-template-tag, +.hljs-template-variable, +.hljs-addition, +.hljs-link { + color: #008000 +} +.hljs-comment, +.hljs-meta, +.hljs-deletion { + color: #008000 +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/qtcreator-light.min.css b/tools/ui/node_modules/highlight.js/styles/qtcreator-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..7f1af8c6165aac12c992f2c17b8c3ecea36cb9dd --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/qtcreator-light.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#000;background:#fff}.hljs-emphasis,.hljs-strong{color:#000}.hljs-bullet,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:navy}.hljs-code .hljs-selector-class{color:purple}.hljs-emphasis,.hljs-stronge,.hljs-type{font-style:italic}.hljs-function,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-symbol{color:olive}.hljs-subst,.hljs-tag,.hljs-title{color:#000}.hljs-attribute{color:maroon}.hljs-class .hljs-title,.hljs-params,.hljs-title.class_,.hljs-variable{color:#0055af}.hljs-addition,.hljs-built_in,.hljs-comment,.hljs-deletion,.hljs-link,.hljs-meta,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-type{color:green} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rainbow.css b/tools/ui/node_modules/highlight.js/styles/rainbow.css new file mode 100644 index 0000000000000000000000000000000000000000..80b2834a577b203aab64c4b5c296597718ef2197 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rainbow.css @@ -0,0 +1,77 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Style with support for rainbow parens + +*/ +.hljs { + background: #474949; + color: #d1d9e1 +} +.hljs-comment, +.hljs-quote { + color: #969896; + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-type, +.hljs-addition { + color: #cc99cc +} +.hljs-number, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #f99157 +} +.hljs-string, +.hljs-doctag, +.hljs-regexp { + color: #8abeb7 +} +.hljs-title, +.hljs-name, +.hljs-section, +.hljs-built_in { + color: #b5bd68 +} +.hljs-variable, +.hljs-template-variable, +.hljs-selector-id, +.hljs-title.class_, +.hljs-class .hljs-title { + color: #ffcc66 +} +.hljs-section, +.hljs-name, +.hljs-strong { + font-weight: bold +} +.hljs-symbol, +.hljs-bullet, +.hljs-subst, +.hljs-meta, +.hljs-link { + color: #f99157 +} +.hljs-deletion { + color: #dc322f +} +.hljs-formula { + background: #eee8d5 +} +.hljs-attr, +.hljs-attribute { + color: #81a2be +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rainbow.min.css b/tools/ui/node_modules/highlight.js/styles/rainbow.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c8ca25fbdad596951d275574429b327c5e6235ac --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rainbow.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#474949;color:#d1d9e1}.hljs-comment,.hljs-quote{color:#969896;font-style:italic}.hljs-addition,.hljs-keyword,.hljs-literal,.hljs-selector-tag,.hljs-type{color:#c9c}.hljs-number,.hljs-selector-attr,.hljs-selector-pseudo{color:#f99157}.hljs-doctag,.hljs-regexp,.hljs-string{color:#8abeb7}.hljs-built_in,.hljs-name,.hljs-section,.hljs-title{color:#b5bd68}.hljs-class .hljs-title,.hljs-selector-id,.hljs-template-variable,.hljs-title.class_,.hljs-variable{color:#fc6}.hljs-name,.hljs-section,.hljs-strong{font-weight:700}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-subst,.hljs-symbol{color:#f99157}.hljs-deletion{color:#dc322f}.hljs-formula{background:#eee8d5}.hljs-attr,.hljs-attribute{color:#81a2be}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rose-pine-dawn.css b/tools/ui/node_modules/highlight.js/styles/rose-pine-dawn.css new file mode 100644 index 0000000000000000000000000000000000000000..1a237d1c319936ace83eae056254572b179a8565 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rose-pine-dawn.css @@ -0,0 +1,107 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Rose Pine + Origin: https://rosepinetheme.com/ +*/ +/* Comment */ +.hljs-meta, +.hljs-comment { + color: #9893a5 +} +/* Red */ +/*INFO: This keyword, HTML elements, Regex group symbol, CSS units, Terminal Red */ +.hljs-tag, +.hljs-doctag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-template-tag, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_, +.hljs-deletion { + color: #b4637a +} +/*Orange */ +/*INFO: Number and Boolean constants, Language support constants */ +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-link { + color: #d7827e +} +/* Yellow */ +/* INFO: Function parameters, Regex character sets, Terminal Yellow */ +.hljs-built_in, +.hljs-attribute { + color: #ea9d34 +} +/* cyan */ +/* INFO: Language support functions, CSS HTML elements */ +.hljs-selector-tag { + color: #286983 +} +/* light blue */ +/* INFO: Object properties, Regex quantifiers and flags, Markdown headings, Terminal Cyan, Markdown code, Import/export keywords */ +.hljs-keyword, +.hljs-title.function_, +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-subst, +.hljs-property { + color: #56949f +} +/*Green*/ +/* INFO: Object literal keys, Markdown links, Terminal Green */ +.hljs-selector-tag { + color: #56949f +} +/*Green(er) */ +/* INFO: Strings, CSS class names */ +.hljs-quote, +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #286983 +} +/* INFO: Function names, CSS property names, Terminal Blue */ +.hljs-code, +.hljs-formula, +.hljs-section { + color: #d7827e +} +/* Magenta */ +/*INFO: Control Keywords, Storage Types, Regex symbols and operators, HTML Attributes, Terminal Magenta */ +.hljs-name, +.hljs-keyword, +.hljs-operator, +.hljs-keyword, +.hljs-char.escape_, +.hljs-attr { + color: #907aa9 +} +.hljs-punctuation { + color: #575279 +} +.hljs { + background: #faf4ed; + color: #575279 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rose-pine-dawn.min.css b/tools/ui/node_modules/highlight.js/styles/rose-pine-dawn.min.css new file mode 100644 index 0000000000000000000000000000000000000000..711efd7225a11aa8e14859bd78e58dfa529ee87c --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rose-pine-dawn.min.css @@ -0,0 +1,4 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: Rose Pine + Origin: https://rosepinetheme.com/ +*/.hljs-comment,.hljs-meta{color:#9893a5}.hljs-deletion,.hljs-doctag,.hljs-regexp,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-tag,.hljs-template-tag,.hljs-variable.language_{color:#b4637a}.hljs-link,.hljs-literal,.hljs-number,.hljs-params,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d7827e}.hljs-attribute,.hljs-built_in{color:#ea9d34}.hljs-keyword,.hljs-property,.hljs-selector-tag,.hljs-subst,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#56949f}.hljs-addition,.hljs-bullet,.hljs-quote,.hljs-string,.hljs-symbol{color:#286983}.hljs-code,.hljs-formula,.hljs-section{color:#d7827e}.hljs-attr,.hljs-char.escape_,.hljs-keyword,.hljs-name,.hljs-operator{color:#907aa9}.hljs-punctuation{color:#575279}.hljs{background:#faf4ed;color:#575279}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rose-pine-moon.css b/tools/ui/node_modules/highlight.js/styles/rose-pine-moon.css new file mode 100644 index 0000000000000000000000000000000000000000..f2835249c9971e34549a8068cfe5e0d8edaf9214 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rose-pine-moon.css @@ -0,0 +1,109 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Rose Pine + Origin: https://rosepinetheme.com/ +*/ +/* Comment */ +.hljs-meta, +.hljs-comment { + color: #6e6a86 +} +/* Red */ +/*INFO: This keyword, HTML elements, Regex group symbol, CSS units, Terminal Red */ +.hljs-tag, +.hljs-doctag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-template-tag, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_, +.hljs-deletion { + color: #eb6f92 +} +/*Orange */ +/*INFO: Number and Boolean constants, Language support constants */ +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-link { + color: #ea9a97 +} +/* Yellow */ +/* INFO: Function parameters, Regex character sets, Terminal Yellow */ +.hljs-built_in, +.hljs-attribute { + color: #f6c177 +} +/* cyan */ +/* INFO: Language support functions, CSS HTML elements */ +.hljs-selector-tag { + color: #3e8fb0 +} +/* light blue */ +/* INFO: Object properties, Regex quantifiers and flags, Markdown headings, Terminal Cyan, Markdown code, Import/export keywords */ +.hljs-keyword, +.hljs-title.function_, +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-subst, +.hljs-property { + color: #9ccfd8 +} +/*Green*/ +/* INFO: Object literal keys, Markdown links, Terminal Green */ +.hljs-selector-tag { + color: #9ccfd8 +} +/*Green(er) */ +/* INFO: Strings, CSS class names */ +.hljs-quote, +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #3e8fb0 +} +/* INFO: Function names, CSS property names, Terminal Blue */ +.hljs-code, +.hljs-formula, +.hljs-section { + color: #ea9a97 +} +/* Magenta */ +/*INFO: Control Keywords, Storage Types, Regex symbols and operators, HTML Attributes, Terminal Magenta */ +.hljs-name, +.hljs-keyword, +.hljs-operator, +.hljs-keyword, +.hljs-char.escape_, +.hljs-attr { + color: #c4a7e7 +} +/* white*/ +/* INFO: Variables, Class names, Terminal White */ +.hljs-punctuation { + color: #e0def4 +} +.hljs { + background: #232136; + color: #6e6a86 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rose-pine-moon.min.css b/tools/ui/node_modules/highlight.js/styles/rose-pine-moon.min.css new file mode 100644 index 0000000000000000000000000000000000000000..716d872540c8a47e2e0a4768b8bae6d711417995 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rose-pine-moon.min.css @@ -0,0 +1,4 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: Rose Pine + Origin: https://rosepinetheme.com/ +*/.hljs-comment,.hljs-meta{color:#6e6a86}.hljs-deletion,.hljs-doctag,.hljs-regexp,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-tag,.hljs-template-tag,.hljs-variable.language_{color:#eb6f92}.hljs-link,.hljs-literal,.hljs-number,.hljs-params,.hljs-template-variable,.hljs-type,.hljs-variable{color:#ea9a97}.hljs-attribute,.hljs-built_in{color:#f6c177}.hljs-keyword,.hljs-property,.hljs-selector-tag,.hljs-subst,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#9ccfd8}.hljs-addition,.hljs-bullet,.hljs-quote,.hljs-string,.hljs-symbol{color:#3e8fb0}.hljs-code,.hljs-formula,.hljs-section{color:#ea9a97}.hljs-attr,.hljs-char.escape_,.hljs-keyword,.hljs-name,.hljs-operator{color:#c4a7e7}.hljs-punctuation{color:#e0def4}.hljs{background:#232136;color:#6e6a86}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rose-pine.css b/tools/ui/node_modules/highlight.js/styles/rose-pine.css new file mode 100644 index 0000000000000000000000000000000000000000..bd394d69306b68032a4e05201c39f988e8c05c92 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rose-pine.css @@ -0,0 +1,109 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Rose Pine + Origin: https://rosepinetheme.com/ +*/ +/* Comment */ +.hljs-meta, +.hljs-comment { + color: #6e6a86 +} +/* Red */ +/*INFO: This keyword, HTML elements, Regex group symbol, CSS units, Terminal Red */ +.hljs-tag, +.hljs-doctag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-template-tag, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_, +.hljs-deletion { + color: #eb6f92 +} +/*Orange */ +/*INFO: Number and Boolean constants, Language support constants */ +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-link { + color: #ebbcba +} +/* Yellow */ +/* INFO: Function parameters, Regex character sets, Terminal Yellow */ +.hljs-built_in, +.hljs-attribute { + color: #f6c177 +} +/* cyan */ +/* INFO: Language support functions, CSS HTML elements */ +.hljs-selector-tag { + color: #31748f +} +/* light blue */ +/* INFO: Object properties, Regex quantifiers and flags, Markdown headings, Terminal Cyan, Markdown code, Import/export keywords */ +.hljs-keyword, +.hljs-title.function_, +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-subst, +.hljs-property { + color: #9ccfd8 +} +/*Green*/ +/* INFO: Object literal keys, Markdown links, Terminal Green */ +.hljs-selector-tag { + color: #9ccfd8 +} +/*Green(er) */ +/* INFO: Strings, CSS class names */ +.hljs-quote, +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #31748f +} +/* INFO: Function names, CSS property names, Terminal Blue */ +.hljs-code, +.hljs-formula, +.hljs-section { + color: #ebbcba +} +/* Magenta */ +/*INFO: Control Keywords, Storage Types, Regex symbols and operators, HTML Attributes, Terminal Magenta */ +.hljs-name, +.hljs-keyword, +.hljs-operator, +.hljs-keyword, +.hljs-char.escape_, +.hljs-attr { + color: #c4a7e7 +} +/* white*/ +/* INFO: Variables, Class names, Terminal White */ +.hljs-punctuation { + color: #e0def4 +} +.hljs { + background: #191724; + color: #6e6a86 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/rose-pine.min.css b/tools/ui/node_modules/highlight.js/styles/rose-pine.min.css new file mode 100644 index 0000000000000000000000000000000000000000..73470605e4f410608f618e2fca34087c0a425ffb --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/rose-pine.min.css @@ -0,0 +1,4 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: Rose Pine + Origin: https://rosepinetheme.com/ +*/.hljs-comment,.hljs-meta{color:#6e6a86}.hljs-deletion,.hljs-doctag,.hljs-regexp,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-tag,.hljs-template-tag,.hljs-variable.language_{color:#eb6f92}.hljs-link,.hljs-literal,.hljs-number,.hljs-params,.hljs-template-variable,.hljs-type,.hljs-variable{color:#ebbcba}.hljs-attribute,.hljs-built_in{color:#f6c177}.hljs-keyword,.hljs-property,.hljs-selector-tag,.hljs-subst,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#9ccfd8}.hljs-addition,.hljs-bullet,.hljs-quote,.hljs-string,.hljs-symbol{color:#31748f}.hljs-code,.hljs-formula,.hljs-section{color:#ebbcba}.hljs-attr,.hljs-char.escape_,.hljs-keyword,.hljs-name,.hljs-operator{color:#c4a7e7}.hljs-punctuation{color:#e0def4}.hljs{background:#191724;color:#6e6a86}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/routeros.css b/tools/ui/node_modules/highlight.js/styles/routeros.css new file mode 100644 index 0000000000000000000000000000000000000000..5b3602bb9251c9a06e524f6997e861dcfecbc778 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/routeros.css @@ -0,0 +1,86 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + + highlight.js style for MikroTik RouterOS script + +*/ +.hljs { + color: #444; + background: #F0F0F0 +} +/* Base color: saturation 0; */ +.hljs-subst { + color: #444 +} +.hljs-comment { + color: #888888 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-meta .hljs-keyword, +.hljs-doctag, +.hljs-name { + font-weight: bold +} +.hljs-attribute { + color: #0E9A00 +} +.hljs-function { + color: #99069A +} +/* User color: hue: 0 */ +.hljs-type, +.hljs-string, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #880000 +} +.hljs-title, +.hljs-section { + color: #880000; + font-weight: bold +} +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #BC6060 +} +/* Language color: hue: 90; */ +.hljs-literal { + color: #78A960 +} +.hljs-built_in, +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #0C9A9A +} +/* Meta color: hue: 200 */ +.hljs-meta { + color: #1f7199 +} +.hljs-meta .hljs-string { + color: #4d99bf +} +/* Misc effects */ +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/routeros.min.css b/tools/ui/node_modules/highlight.js/styles/routeros.min.css new file mode 100644 index 0000000000000000000000000000000000000000..03786787f7adf8559c400b01b9a705bf7aa1b061 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/routeros.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#444;background:#f0f0f0}.hljs-subst{color:#444}.hljs-comment{color:#888}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-attribute{color:#0e9a00}.hljs-function{color:#99069a}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#bc6060}.hljs-literal{color:#78a960}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#0c9a9a}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/school-book.css b/tools/ui/node_modules/highlight.js/styles/school-book.css new file mode 100644 index 0000000000000000000000000000000000000000..8dcb9021714de772e3c35304fc487e134debea58 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/school-book.css @@ -0,0 +1,62 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +School Book style from goldblog.com.ua (c) Zaripov Yura + +*/ +.hljs { + color: #3e5915; + background: #f6f5b2 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal { + color: #005599; + font-weight: bold +} +.hljs-subst { + color: #3e5915 +} +.hljs-string, +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute, +.hljs-built_in, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable, +.hljs-link { + color: #2c009f +} +.hljs-comment, +.hljs-quote, +.hljs-deletion, +.hljs-meta { + color: #e60415 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-doctag, +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-name, +.hljs-selector-id, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/school-book.min.css b/tools/ui/node_modules/highlight.js/styles/school-book.min.css new file mode 100644 index 0000000000000000000000000000000000000000..843f26879bcd873e436376988436a23e671d1df8 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/school-book.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#3e5915;background:#f6f5b2}.hljs-keyword,.hljs-literal,.hljs-selector-tag{color:#059}.hljs-subst{color:#3e5915}.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-link,.hljs-section,.hljs-string,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#2c009f}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#e60415}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-id,.hljs-selector-tag,.hljs-strong,.hljs-title,.hljs-type{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/shades-of-purple.css b/tools/ui/node_modules/highlight.js/styles/shades-of-purple.css new file mode 100644 index 0000000000000000000000000000000000000000..8a510501fbe41905e652272c008fb0b49009ac15 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/shades-of-purple.css @@ -0,0 +1,84 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/** + * Shades of Purple Theme — for Highlightjs. + * + * @author (c) Ahmad Awais + * @link GitHub Repo → https://github.com/ahmadawais/Shades-of-Purple-HighlightJS + * @version 1.5.0 + */ +.hljs { + background: #2d2b57; + color: #e3dfff; + font-weight: normal +} +.hljs-subst { + color: #e3dfff +} +.hljs-title { + color: #fad000; + font-weight: normal +} +.hljs-name { + color: #a1feff +} +.hljs-tag { + color: #ffffff +} +.hljs-attr { + color: #f8d000; + font-style: italic +} +.hljs-built_in, +.hljs-selector-tag, +.hljs-section { + color: #fb9e00 +} +.hljs-keyword { + color: #fb9e00 +} +.hljs-string, +.hljs-attribute, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-code, +.hljs-regexp, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-template-tag, +.hljs-quote, +.hljs-deletion { + color: #4cd213 +} +.hljs-meta, +.hljs-meta .hljs-string { + color: #fb9e00 +} +.hljs-comment { + color: #ac65ff +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-name, +.hljs-strong { + font-weight: normal +} +.hljs-literal, +.hljs-number { + color: #fa658d +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/shades-of-purple.min.css b/tools/ui/node_modules/highlight.js/styles/shades-of-purple.min.css new file mode 100644 index 0000000000000000000000000000000000000000..3dd25b44c4594ffbf9a8e9ce0858164621740831 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/shades-of-purple.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#2d2b57;color:#e3dfff;font-weight:400}.hljs-subst{color:#e3dfff}.hljs-title{color:#fad000;font-weight:400}.hljs-name{color:#a1feff}.hljs-tag{color:#fff}.hljs-attr{color:#f8d000;font-style:italic}.hljs-built_in,.hljs-keyword,.hljs-section,.hljs-selector-tag{color:#fb9e00}.hljs-addition,.hljs-attribute,.hljs-bullet,.hljs-code,.hljs-deletion,.hljs-quote,.hljs-regexp,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-string,.hljs-symbol,.hljs-template-tag{color:#4cd213}.hljs-meta,.hljs-meta .hljs-string{color:#fb9e00}.hljs-comment{color:#ac65ff}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-selector-tag,.hljs-strong{font-weight:400}.hljs-literal,.hljs-number{color:#fa658d}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/srcery.css b/tools/ui/node_modules/highlight.js/styles/srcery.css new file mode 100644 index 0000000000000000000000000000000000000000..1b60bd400b1970d72a4f9e657f43bc99a5056222 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/srcery.css @@ -0,0 +1,89 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* +Theme: Srcery +Description: Srcery dark color scheme for highlight.js +Author: Chen Bin +Maintainer: @redguardtoo +Website: https://srcery-colors.github.io/ +Date: 2021-04-13 +*/ +.hljs { + background: #1C1B19; + /* Black */ + color: #FCE8C3/* Bright White */ + +} +/* Bright White */ +.hljs-subst, +.hljs-quote, +.hljs-literal { + color: #FCE8C3 +} +/* Bright Blue */ +.hljs-type, +.hljs-symbol { + color: #68A8E4 +} +/* Red */ +.hljs-keyword, +.hljs-deletion { + color: #EF2F27 +} +/* Yellow */ +.hljs-name, +.hljs-function, +.hljs-attribute, +.hljs-selector-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-pseudo, +.hljs-section, +.hljs-title { + color: #FBB829 +} +/* Cyan */ +.hljs-code, +.hljs-variable, +.hljs-property, +.hljs-template-variable, +.hljs-class { + color: #0AAEB3 +} +/* Bright Green */ +.hljs-string, +.hljs-regexp, +.hljs-bullet, +.hljs-addition { + color: #98BC37 +} +/* Bright Magenta */ +.hljs-built_in, +.hljs-params { + color: #FF5C8F +} +/* Blue */ +.hljs-template-tag, +.hljs-selector-tag { + color: #2C78BF +} +/* Bright Black */ +.hljs-link, +.hljs-number, +.hljs-comment, +.hljs-meta { + color: #918175 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +/* @see https://github.com/srcery-colors/srcery-emacs for reference */ diff --git a/tools/ui/node_modules/highlight.js/styles/srcery.min.css b/tools/ui/node_modules/highlight.js/styles/srcery.min.css new file mode 100644 index 0000000000000000000000000000000000000000..377d61ae103f3c61a731d36d981176c041f65608 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/srcery.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#1c1b19;color:#fce8c3}.hljs-literal,.hljs-quote,.hljs-subst{color:#fce8c3}.hljs-symbol,.hljs-type{color:#68a8e4}.hljs-deletion,.hljs-keyword{color:#ef2f27}.hljs-attribute,.hljs-function,.hljs-name,.hljs-section,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-title{color:#fbb829}.hljs-class,.hljs-code,.hljs-property,.hljs-template-variable,.hljs-variable{color:#0aaeb3}.hljs-addition,.hljs-bullet,.hljs-regexp,.hljs-string{color:#98bc37}.hljs-built_in,.hljs-params{color:#ff5c8f}.hljs-selector-tag,.hljs-template-tag{color:#2c78bf}.hljs-comment,.hljs-link,.hljs-meta,.hljs-number{color:#918175}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/stackoverflow-dark.css b/tools/ui/node_modules/highlight.js/styles/stackoverflow-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..6cc355e95926c71e8bccb0edca0b3f0baadd370f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/stackoverflow-dark.css @@ -0,0 +1,117 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: StackOverflow Dark + Description: Dark theme as used on stackoverflow.com + Author: stackoverflow.com + Maintainer: @Hirse + Website: https://github.com/StackExchange/Stacks + License: MIT + Updated: 2021-05-15 + + Updated for @stackoverflow/stacks v0.64.0 + Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less + Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less +*/ +.hljs { + /* var(--highlight-color) */ + color: #ffffff; + /* var(--highlight-bg) */ + background: #1c1b1b +} +.hljs-subst { + /* var(--highlight-color) */ + color: #ffffff +} +.hljs-comment { + /* var(--highlight-comment) */ + color: #999999 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-meta .hljs-keyword, +.hljs-doctag, +.hljs-section { + /* var(--highlight-keyword) */ + color: #88aece +} +.hljs-attr { + /* var(--highlight-attribute); */ + color: #88aece +} +.hljs-attribute { + /* var(--highlight-symbol) */ + color: #c59bc1 +} +.hljs-name, +.hljs-type, +.hljs-number, +.hljs-selector-id, +.hljs-quote, +.hljs-template-tag { + /* var(--highlight-namespace) */ + color: #f08d49 +} +.hljs-selector-class { + /* var(--highlight-keyword) */ + color: #88aece +} +.hljs-string, +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr { + /* var(--highlight-variable) */ + color: #b5bd68 +} +.hljs-meta, +.hljs-selector-pseudo { + /* var(--highlight-keyword) */ + color: #88aece +} +.hljs-built_in, +.hljs-title, +.hljs-literal { + /* var(--highlight-literal) */ + color: #f08d49 +} +.hljs-bullet, +.hljs-code { + /* var(--highlight-punctuation) */ + color: #cccccc +} +.hljs-meta .hljs-string { + /* var(--highlight-variable) */ + color: #b5bd68 +} +.hljs-deletion { + /* var(--highlight-deletion) */ + color: #de7176 +} +.hljs-addition { + /* var(--highlight-addition) */ + color: #76c490 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-formula, +.hljs-operator, +.hljs-params, +.hljs-property, +.hljs-punctuation, +.hljs-tag { + /* purposely ignored */ + +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/stackoverflow-dark.min.css b/tools/ui/node_modules/highlight.js/styles/stackoverflow-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..33cea55a2de1a0faaa05b71182dc939c1e715128 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/stackoverflow-dark.min.css @@ -0,0 +1,13 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: StackOverflow Dark + Description: Dark theme as used on stackoverflow.com + Author: stackoverflow.com + Maintainer: @Hirse + Website: https://github.com/StackExchange/Stacks + License: MIT + Updated: 2021-05-15 + + Updated for @stackoverflow/stacks v0.64.0 + Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less + Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less +*/.hljs{color:#fff;background:#1c1b1b}.hljs-subst{color:#fff}.hljs-comment{color:#999}.hljs-attr,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-selector-tag{color:#88aece}.hljs-attribute{color:#c59bc1}.hljs-name,.hljs-number,.hljs-quote,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#f08d49}.hljs-selector-class{color:#88aece}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-string,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#b5bd68}.hljs-meta,.hljs-selector-pseudo{color:#88aece}.hljs-built_in,.hljs-literal,.hljs-title{color:#f08d49}.hljs-bullet,.hljs-code{color:#ccc}.hljs-meta .hljs-string{color:#b5bd68}.hljs-deletion{color:#de7176}.hljs-addition{color:#76c490}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/stackoverflow-light.css b/tools/ui/node_modules/highlight.js/styles/stackoverflow-light.css new file mode 100644 index 0000000000000000000000000000000000000000..308171d641faa878655f1ed71953392acff8d431 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/stackoverflow-light.css @@ -0,0 +1,117 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: StackOverflow Light + Description: Light theme as used on stackoverflow.com + Author: stackoverflow.com + Maintainer: @Hirse + Website: https://github.com/StackExchange/Stacks + License: MIT + Updated: 2021-05-15 + + Updated for @stackoverflow/stacks v0.64.0 + Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less + Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less +*/ +.hljs { + /* var(--highlight-color) */ + color: #2f3337; + /* var(--highlight-bg) */ + background: #f6f6f6 +} +.hljs-subst { + /* var(--highlight-color) */ + color: #2f3337 +} +.hljs-comment { + /* var(--highlight-comment) */ + color: #656e77 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-meta .hljs-keyword, +.hljs-doctag, +.hljs-section { + /* var(--highlight-keyword) */ + color: #015692 +} +.hljs-attr { + /* var(--highlight-attribute); */ + color: #015692 +} +.hljs-attribute { + /* var(--highlight-symbol) */ + color: #803378 +} +.hljs-name, +.hljs-type, +.hljs-number, +.hljs-selector-id, +.hljs-quote, +.hljs-template-tag { + /* var(--highlight-namespace) */ + color: #b75501 +} +.hljs-selector-class { + /* var(--highlight-keyword) */ + color: #015692 +} +.hljs-string, +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr { + /* var(--highlight-variable) */ + color: #54790d +} +.hljs-meta, +.hljs-selector-pseudo { + /* var(--highlight-keyword) */ + color: #015692 +} +.hljs-built_in, +.hljs-title, +.hljs-literal { + /* var(--highlight-literal) */ + color: #b75501 +} +.hljs-bullet, +.hljs-code { + /* var(--highlight-punctuation) */ + color: #535a60 +} +.hljs-meta .hljs-string { + /* var(--highlight-variable) */ + color: #54790d +} +.hljs-deletion { + /* var(--highlight-deletion) */ + color: #c02d2e +} +.hljs-addition { + /* var(--highlight-addition) */ + color: #2f6f44 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-formula, +.hljs-operator, +.hljs-params, +.hljs-property, +.hljs-punctuation, +.hljs-tag { + /* purposely ignored */ + +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/stackoverflow-light.min.css b/tools/ui/node_modules/highlight.js/styles/stackoverflow-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c36d63d88c1ee14f5d073e041b99edacd357ea21 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/stackoverflow-light.min.css @@ -0,0 +1,13 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: StackOverflow Light + Description: Light theme as used on stackoverflow.com + Author: stackoverflow.com + Maintainer: @Hirse + Website: https://github.com/StackExchange/Stacks + License: MIT + Updated: 2021-05-15 + + Updated for @stackoverflow/stacks v0.64.0 + Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less + Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less +*/.hljs{color:#2f3337;background:#f6f6f6}.hljs-subst{color:#2f3337}.hljs-comment{color:#656e77}.hljs-attr,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-selector-tag{color:#015692}.hljs-attribute{color:#803378}.hljs-name,.hljs-number,.hljs-quote,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#b75501}.hljs-selector-class{color:#015692}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-string,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#54790d}.hljs-meta,.hljs-selector-pseudo{color:#015692}.hljs-built_in,.hljs-literal,.hljs-title{color:#b75501}.hljs-bullet,.hljs-code{color:#535a60}.hljs-meta .hljs-string{color:#54790d}.hljs-deletion{color:#c02d2e}.hljs-addition{color:#2f6f44}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/sunburst.css b/tools/ui/node_modules/highlight.js/styles/sunburst.css new file mode 100644 index 0000000000000000000000000000000000000000..5b49f2151e4a663b509bfdaae7711d8eb3725f62 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/sunburst.css @@ -0,0 +1,89 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Sunburst-like style (c) Vasily Polovnyov + +*/ +.hljs { + background: #000; + color: #f8f8f8 +} +.hljs-comment, +.hljs-quote { + color: #aeaeae; + font-style: italic +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #e28964 +} +.hljs-string { + color: #65b042 +} +.hljs-subst { + color: #daefa3 +} +.hljs-regexp, +.hljs-link { + color: #e9c062 +} +.hljs-title, +.hljs-section, +.hljs-tag, +.hljs-name { + color: #89bdff +} +.hljs-title.class_, +.hljs-class .hljs-title, +.hljs-doctag { + text-decoration: underline +} +.hljs-symbol, +.hljs-bullet, +.hljs-number { + color: #3387cc +} +.hljs-params, +.hljs-variable, +.hljs-template-variable { + color: #3e87e3 +} +.hljs-attribute { + color: #cda869 +} +.hljs-meta { + color: #8996a8 +} +.hljs-formula { + background-color: #0e2231; + color: #f8f8f8; + font-style: italic +} +.hljs-addition { + background-color: #253b22; + color: #f8f8f8 +} +.hljs-deletion { + background-color: #420e09; + color: #f8f8f8 +} +.hljs-selector-class { + color: #9b703f +} +.hljs-selector-id { + color: #8b98ab +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/sunburst.min.css b/tools/ui/node_modules/highlight.js/styles/sunburst.min.css new file mode 100644 index 0000000000000000000000000000000000000000..9210ae6d0bddec75daf8b2c89f18548bbdeb8309 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/sunburst.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#000;color:#f8f8f8}.hljs-comment,.hljs-quote{color:#aeaeae;font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#e28964}.hljs-string{color:#65b042}.hljs-subst{color:#daefa3}.hljs-link,.hljs-regexp{color:#e9c062}.hljs-name,.hljs-section,.hljs-tag,.hljs-title{color:#89bdff}.hljs-class .hljs-title,.hljs-doctag,.hljs-title.class_{text-decoration:underline}.hljs-bullet,.hljs-number,.hljs-symbol{color:#3387cc}.hljs-params,.hljs-template-variable,.hljs-variable{color:#3e87e3}.hljs-attribute{color:#cda869}.hljs-meta{color:#8996a8}.hljs-formula{background-color:#0e2231;color:#f8f8f8;font-style:italic}.hljs-addition{background-color:#253b22;color:#f8f8f8}.hljs-deletion{background-color:#420e09;color:#f8f8f8}.hljs-selector-class{color:#9b703f}.hljs-selector-id{color:#8b98ab}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tokyo-night-dark.css b/tools/ui/node_modules/highlight.js/styles/tokyo-night-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..e746b50cd18ee5fa4d525487fd0f8748e9f1eff7 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tokyo-night-dark.css @@ -0,0 +1,114 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Tokyo-night-Dark + origin: https://github.com/enkia/tokyo-night-vscode-theme + Description: Original highlight.js style + Author: (c) Henri Vandersleyen + License: see project LICENSE + Touched: 2022 +*/ +/* Comment */ +.hljs-meta, +.hljs-comment { + color: #565f89 +} +/* Red */ +/*INFO: This keyword, HTML elements, Regex group symbol, CSS units, Terminal Red */ +.hljs-tag, +.hljs-doctag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-template-tag, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_, +.hljs-deletion { + color: #f7768e +} +/*Orange */ +/*INFO: Number and Boolean constants, Language support constants */ +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-link { + color: #ff9e64 +} +/* Yellow */ +/* INFO: Function parameters, Regex character sets, Terminal Yellow */ +.hljs-built_in, +.hljs-attribute { + color: #e0af68 +} +/* cyan */ +/* INFO: Language support functions, CSS HTML elements */ +.hljs-selector-tag { + color: #2ac3de +} +/* light blue */ +/* INFO: Object properties, Regex quantifiers and flags, Markdown headings, Terminal Cyan, Markdown code, Import/export keywords */ +.hljs-keyword, +.hljs-title.function_, +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-subst, +.hljs-property { + color: #7dcfff +} +/*Green*/ +/* INFO: Object literal keys, Markdown links, Terminal Green */ +.hljs-selector-tag { + color: #73daca +} +/*Green(er) */ +/* INFO: Strings, CSS class names */ +.hljs-quote, +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #9ece6a +} +/* Blue */ +/* INFO: Function names, CSS property names, Terminal Blue */ +.hljs-code, +.hljs-formula, +.hljs-section { + color: #7aa2f7 +} +/* Magenta */ +/*INFO: Control Keywords, Storage Types, Regex symbols and operators, HTML Attributes, Terminal Magenta */ +.hljs-name, +.hljs-keyword, +.hljs-operator, +.hljs-keyword, +.hljs-char.escape_, +.hljs-attr { + color: #bb9af7 +} +/* white*/ +/* INFO: Variables, Class names, Terminal White */ +.hljs-punctuation { + color: #c0caf5 +} +.hljs { + background: #1a1b26; + color: #9aa5ce +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tokyo-night-dark.min.css b/tools/ui/node_modules/highlight.js/styles/tokyo-night-dark.min.css new file mode 100644 index 0000000000000000000000000000000000000000..dc63ad9e764f406df179ca3b5d7ed36ea2be7587 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tokyo-night-dark.min.css @@ -0,0 +1,8 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: Tokyo-night-Dark + origin: https://github.com/enkia/tokyo-night-vscode-theme + Description: Original highlight.js style + Author: (c) Henri Vandersleyen + License: see project LICENSE + Touched: 2022 +*/.hljs-comment,.hljs-meta{color:#565f89}.hljs-deletion,.hljs-doctag,.hljs-regexp,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-tag,.hljs-template-tag,.hljs-variable.language_{color:#f7768e}.hljs-link,.hljs-literal,.hljs-number,.hljs-params,.hljs-template-variable,.hljs-type,.hljs-variable{color:#ff9e64}.hljs-attribute,.hljs-built_in{color:#e0af68}.hljs-keyword,.hljs-property,.hljs-subst,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#7dcfff}.hljs-selector-tag{color:#73daca}.hljs-addition,.hljs-bullet,.hljs-quote,.hljs-string,.hljs-symbol{color:#9ece6a}.hljs-code,.hljs-formula,.hljs-section{color:#7aa2f7}.hljs-attr,.hljs-char.escape_,.hljs-keyword,.hljs-name,.hljs-operator{color:#bb9af7}.hljs-punctuation{color:#c0caf5}.hljs{background:#1a1b26;color:#9aa5ce}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tokyo-night-light.css b/tools/ui/node_modules/highlight.js/styles/tokyo-night-light.css new file mode 100644 index 0000000000000000000000000000000000000000..2c7ca12c67409a5cb06125f2dbddc4e89e69eca5 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tokyo-night-light.css @@ -0,0 +1,114 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/*! + Theme: Tokyo-night-light + origin: https://github.com/enkia/tokyo-night-vscode-theme + Description: Original highlight.js style + Author: (c) Henri Vandersleyen + License: see project LICENSE + Touched: 2022 +*/ +/* Comment */ +.hljs-meta, +.hljs-comment { + color: #9699a3 +} +/* Red */ +/*INFO: This keyword, HTML elements, Regex group symbol, CSS units, Terminal Red */ +.hljs-tag, +.hljs-doctag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-template-tag, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_, +.hljs-deletion { + color: #8c4351 +} +/*Orange */ +/*INFO: Number and Boolean constants, Language support constants */ +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-link { + color: #965027 +} +/* Yellow */ +/* INFO: Function parameters, Regex character sets, Terminal Yellow */ +.hljs-built_in, +.hljs-attribute { + color: #8f5e15 +} +/* cyan */ +/* INFO: Language support functions, CSS HTML elements */ +.hljs-selector-tag { + color: #166775 +} +/* light blue */ +/* INFO: Object properties, Regex quantifiers and flags, Markdown headings, Terminal Cyan, Markdown code, Import/export keywords */ +.hljs-keyword, +.hljs-title.function_, +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-subst, +.hljs-property { + color: #0f4b6e +} +/*Green*/ +/* INFO: Object literal keys, Markdown links, Terminal Green */ +.hljs-selector-tag { + color: #33635c +} +/*Green(er) */ +/* INFO: Strings, CSS class names */ +.hljs-quote, +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #485e30 +} +/* Blue */ +/* INFO: Function names, CSS property names, Terminal Blue */ +.hljs-code, +.hljs-formula, +.hljs-section { + color: #34548a +} +/* Magenta */ +/*INFO: Control Keywords, Storage Types, Regex symbols and operators, HTML Attributes, Terminal Magenta */ +.hljs-name, +.hljs-keyword, +.hljs-operator, +.hljs-keyword, +.hljs-char.escape_, +.hljs-attr { + color: #5a4a78 +} +/* white*/ +/* INFO: Variables, Class names, Terminal White */ +.hljs-punctuation { + color: #343b58 +} +.hljs { + background: #d5d6db; + color: #565a6e +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tokyo-night-light.min.css b/tools/ui/node_modules/highlight.js/styles/tokyo-night-light.min.css new file mode 100644 index 0000000000000000000000000000000000000000..0096d4d1ec07d71066f4db308afaca7011e5198a --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tokyo-night-light.min.css @@ -0,0 +1,8 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: Tokyo-night-light + origin: https://github.com/enkia/tokyo-night-vscode-theme + Description: Original highlight.js style + Author: (c) Henri Vandersleyen + License: see project LICENSE + Touched: 2022 +*/.hljs-comment,.hljs-meta{color:#9699a3}.hljs-deletion,.hljs-doctag,.hljs-regexp,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-tag,.hljs-template-tag,.hljs-variable.language_{color:#8c4351}.hljs-link,.hljs-literal,.hljs-number,.hljs-params,.hljs-template-variable,.hljs-type,.hljs-variable{color:#965027}.hljs-attribute,.hljs-built_in{color:#8f5e15}.hljs-keyword,.hljs-property,.hljs-subst,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#0f4b6e}.hljs-selector-tag{color:#33635c}.hljs-addition,.hljs-bullet,.hljs-quote,.hljs-string,.hljs-symbol{color:#485e30}.hljs-code,.hljs-formula,.hljs-section{color:#34548a}.hljs-attr,.hljs-char.escape_,.hljs-keyword,.hljs-name,.hljs-operator{color:#5a4a78}.hljs-punctuation{color:#343b58}.hljs{background:#d5d6db;color:#565a6e}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tomorrow-night-blue.css b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-blue.css new file mode 100644 index 0000000000000000000000000000000000000000..ae57a713c20d52d07d5d256a527ce47eff40842f --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-blue.css @@ -0,0 +1,69 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* Tomorrow Night Blue Theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Tomorrow Comment */ +.hljs-comment, +.hljs-quote { + color: #7285b7 +} +/* Tomorrow Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion { + color: #ff9da4 +} +/* Tomorrow Orange */ +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-meta, +.hljs-link { + color: #ffc58f +} +/* Tomorrow Yellow */ +.hljs-attribute { + color: #ffeead +} +/* Tomorrow Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #d1f1a9 +} +/* Tomorrow Blue */ +.hljs-title, +.hljs-section { + color: #bbdaff +} +/* Tomorrow Purple */ +.hljs-keyword, +.hljs-selector-tag { + color: #ebbbff +} +.hljs { + background: #002451; + color: white +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tomorrow-night-blue.min.css b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-blue.min.css new file mode 100644 index 0000000000000000000000000000000000000000..2f71b26badf1f6fba2d344f27849069dcfb3c9e1 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-blue.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs-comment,.hljs-quote{color:#7285b7}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ff9da4}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#ffc58f}.hljs-attribute{color:#ffeead}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#d1f1a9}.hljs-section,.hljs-title{color:#bbdaff}.hljs-keyword,.hljs-selector-tag{color:#ebbbff}.hljs{background:#002451;color:#fff}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tomorrow-night-bright.css b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-bright.css new file mode 100644 index 0000000000000000000000000000000000000000..b3b532d1b72f43a974804fb2a66c650fad02a551 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-bright.css @@ -0,0 +1,68 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* Tomorrow Night Bright Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Tomorrow Comment */ +.hljs-comment, +.hljs-quote { + color: #969896 +} +/* Tomorrow Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion { + color: #d54e53 +} +/* Tomorrow Orange */ +.hljs-number, +.hljs-built_in, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-meta, +.hljs-link { + color: #e78c45 +} +/* Tomorrow Yellow */ +.hljs-attribute { + color: #e7c547 +} +/* Tomorrow Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #b9ca4a +} +/* Tomorrow Blue */ +.hljs-title, +.hljs-section { + color: #7aa6da +} +/* Tomorrow Purple */ +.hljs-keyword, +.hljs-selector-tag { + color: #c397d8 +} +.hljs { + background: black; + color: #eaeaea +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/tomorrow-night-bright.min.css b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-bright.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d33562994c7c0aeb460dfcaad929b1aac9af9428 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/tomorrow-night-bright.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs-comment,.hljs-quote{color:#969896}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#d54e53}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#e78c45}.hljs-attribute{color:#e7c547}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#b9ca4a}.hljs-section,.hljs-title{color:#7aa6da}.hljs-keyword,.hljs-selector-tag{color:#c397d8}.hljs{background:#000;color:#eaeaea}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/vs.css b/tools/ui/node_modules/highlight.js/styles/vs.css new file mode 100644 index 0000000000000000000000000000000000000000..dc35c885635de17b5a3fcd3322a23ada52951749 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/vs.css @@ -0,0 +1,63 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +Visual Studio-like style based on original C# coloring by Jason Diamond + +*/ +.hljs { + background: white; + color: black +} +.hljs-comment, +.hljs-quote, +.hljs-variable { + color: #008000 +} +.hljs-keyword, +.hljs-selector-tag, +.hljs-built_in, +.hljs-name, +.hljs-tag { + color: #00f +} +.hljs-string, +.hljs-title, +.hljs-section, +.hljs-attribute, +.hljs-literal, +.hljs-template-tag, +.hljs-template-variable, +.hljs-type, +.hljs-addition { + color: #a31515 +} +.hljs-deletion, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-meta { + color: #2b91af +} +.hljs-doctag { + color: #808080 +} +.hljs-attr { + color: #f00 +} +.hljs-symbol, +.hljs-bullet, +.hljs-link { + color: #00b0e8 +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/vs.min.css b/tools/ui/node_modules/highlight.js/styles/vs.min.css new file mode 100644 index 0000000000000000000000000000000000000000..fb695c14b9193a54dd2b4bbbe77ce0be129b6bcc --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/vs.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-comment,.hljs-quote,.hljs-variable{color:green}.hljs-built_in,.hljs-keyword,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#00f}.hljs-addition,.hljs-attribute,.hljs-literal,.hljs-section,.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type{color:#a31515}.hljs-deletion,.hljs-meta,.hljs-selector-attr,.hljs-selector-pseudo{color:#2b91af}.hljs-doctag{color:grey}.hljs-attr{color:red}.hljs-bullet,.hljs-link,.hljs-symbol{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/vs2015.css b/tools/ui/node_modules/highlight.js/styles/vs2015.css new file mode 100644 index 0000000000000000000000000000000000000000..2c2cf0443e8e081d0605237682d9a9070dd96305 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/vs2015.css @@ -0,0 +1,100 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + * Visual Studio 2015 dark style + * Author: Nicolas LLOBERA + */ +.hljs { + background: #1E1E1E; + color: #DCDCDC +} +.hljs-keyword, +.hljs-literal, +.hljs-symbol, +.hljs-name { + color: #569CD6 +} +.hljs-link { + color: #569CD6; + text-decoration: underline +} +.hljs-built_in, +.hljs-type { + color: #4EC9B0 +} +.hljs-number, +.hljs-class { + color: #B8D7A3 +} +.hljs-string, +.hljs-meta .hljs-string { + color: #D69D85 +} +.hljs-regexp, +.hljs-template-tag { + color: #9A5334 +} +.hljs-subst, +.hljs-function, +.hljs-title, +.hljs-params, +.hljs-formula { + color: #DCDCDC +} +.hljs-comment, +.hljs-quote { + color: #57A64A; + font-style: italic +} +.hljs-doctag { + color: #608B4E +} +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-tag { + color: #9B9B9B +} +.hljs-variable, +.hljs-template-variable { + color: #BD63C5 +} +.hljs-attr, +.hljs-attribute { + color: #9CDCFE +} +.hljs-section { + color: gold +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +/*.hljs-code { + font-family:'Monospace'; +}*/ +.hljs-bullet, +.hljs-selector-tag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #D7BA7D +} +.hljs-addition { + background-color: #144212; + display: inline-block; + width: 100% +} +.hljs-deletion { + background-color: #600; + display: inline-block; + width: 100% +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/vs2015.min.css b/tools/ui/node_modules/highlight.js/styles/vs2015.min.css new file mode 100644 index 0000000000000000000000000000000000000000..7f6fe11cc69c69d4bacd1ace4bf6c479126d0057 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/vs2015.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#1e1e1e;color:#dcdcdc}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-symbol{color:#569cd6}.hljs-link{color:#569cd6;text-decoration:underline}.hljs-built_in,.hljs-type{color:#4ec9b0}.hljs-class,.hljs-number{color:#b8d7a3}.hljs-meta .hljs-string,.hljs-string{color:#d69d85}.hljs-regexp,.hljs-template-tag{color:#9a5334}.hljs-formula,.hljs-function,.hljs-params,.hljs-subst,.hljs-title{color:#dcdcdc}.hljs-comment,.hljs-quote{color:#57a64a;font-style:italic}.hljs-doctag{color:#608b4e}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-tag{color:#9b9b9b}.hljs-template-variable,.hljs-variable{color:#bd63c5}.hljs-attr,.hljs-attribute{color:#9cdcfe}.hljs-section{color:gold}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-bullet,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag{color:#d7ba7d}.hljs-addition{background-color:#144212;display:inline-block;width:100%}.hljs-deletion{background-color:#600;display:inline-block;width:100%} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/xcode.css b/tools/ui/node_modules/highlight.js/styles/xcode.css new file mode 100644 index 0000000000000000000000000000000000000000..6ed07fba4716b76d1c1491c596c030ec50a17477 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/xcode.css @@ -0,0 +1,90 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + +XCode style (c) Angel Garcia + +*/ +.hljs { + background: #fff; + color: black +} +/* Gray DOCTYPE selectors like WebKit */ +.xml .hljs-meta { + color: #c0c0c0 +} +.hljs-comment, +.hljs-quote { + color: #007400 +} +.hljs-tag, +.hljs-attribute, +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-name { + color: #aa0d91 +} +.hljs-variable, +.hljs-template-variable { + color: #3F6E74 +} +.hljs-code, +.hljs-string, +.hljs-meta .hljs-string { + color: #c41a16 +} +.hljs-regexp, +.hljs-link { + color: #0E0EFF +} +.hljs-title, +.hljs-symbol, +.hljs-bullet, +.hljs-number { + color: #1c00cf +} +.hljs-section, +.hljs-meta { + color: #643820 +} +.hljs-title.class_, +.hljs-class .hljs-title, +.hljs-type, +.hljs-built_in, +.hljs-params { + color: #5c2699 +} +.hljs-attr { + color: #836C28 +} +.hljs-subst { + color: #000 +} +.hljs-formula { + background-color: #eee; + font-style: italic +} +.hljs-addition { + background-color: #baeeba +} +.hljs-deletion { + background-color: #ffc8bd +} +.hljs-selector-id, +.hljs-selector-class { + color: #9b703f +} +.hljs-doctag, +.hljs-strong { + font-weight: bold +} +.hljs-emphasis { + font-style: italic +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/xcode.min.css b/tools/ui/node_modules/highlight.js/styles/xcode.min.css new file mode 100644 index 0000000000000000000000000000000000000000..cda4adc17a361aa92e655e488f5d961310c0fff1 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/xcode.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.xml .hljs-meta{color:silver}.hljs-comment,.hljs-quote{color:#007400}.hljs-attribute,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#aa0d91}.hljs-template-variable,.hljs-variable{color:#3f6e74}.hljs-code,.hljs-meta .hljs-string,.hljs-string{color:#c41a16}.hljs-link,.hljs-regexp{color:#0e0eff}.hljs-bullet,.hljs-number,.hljs-symbol,.hljs-title{color:#1c00cf}.hljs-meta,.hljs-section{color:#643820}.hljs-built_in,.hljs-class .hljs-title,.hljs-params,.hljs-title.class_,.hljs-type{color:#5c2699}.hljs-attr{color:#836c28}.hljs-subst{color:#000}.hljs-formula{background-color:#eee;font-style:italic}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-selector-class,.hljs-selector-id{color:#9b703f}.hljs-doctag,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/xt256.css b/tools/ui/node_modules/highlight.js/styles/xt256.css new file mode 100644 index 0000000000000000000000000000000000000000..85950c4027a07d07e391201ac5b5462bb4332317 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/xt256.css @@ -0,0 +1,79 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + xt256.css + + Contact: initbar [at] protonmail [dot] ch + : github.com/initbar +*/ +.hljs { + color: #eaeaea; + background: #000 +} +.hljs-subst { + color: #eaeaea +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +.hljs-type { + color: #eaeaea +} +.hljs-params { + color: #da0000 +} +.hljs-literal, +.hljs-number, +.hljs-name { + color: #ff0000; + font-weight: bolder +} +.hljs-comment { + color: #969896 +} +.hljs-selector-id, +.hljs-quote { + color: #00ffff +} +.hljs-template-variable, +.hljs-variable, +.hljs-title { + color: #00ffff; + font-weight: bold +} +.hljs-selector-class, +.hljs-keyword, +.hljs-symbol { + color: #fff000 +} +.hljs-string, +.hljs-bullet { + color: #00ff00 +} +.hljs-tag, +.hljs-section { + color: #000fff +} +.hljs-selector-tag { + color: #000fff; + font-weight: bold +} +.hljs-attribute, +.hljs-built_in, +.hljs-regexp, +.hljs-link { + color: #ff00ff +} +.hljs-meta { + color: #fff; + font-weight: bolder +} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/styles/xt256.min.css b/tools/ui/node_modules/highlight.js/styles/xt256.min.css new file mode 100644 index 0000000000000000000000000000000000000000..ef34f0c56cff866e05864585bc521524b2529a85 --- /dev/null +++ b/tools/ui/node_modules/highlight.js/styles/xt256.min.css @@ -0,0 +1 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#eaeaea;background:#000}.hljs-subst{color:#eaeaea}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-type{color:#eaeaea}.hljs-params{color:#da0000}.hljs-literal,.hljs-name,.hljs-number{color:red;font-weight:bolder}.hljs-comment{color:#969896}.hljs-quote,.hljs-selector-id{color:#0ff}.hljs-template-variable,.hljs-title,.hljs-variable{color:#0ff;font-weight:700}.hljs-keyword,.hljs-selector-class,.hljs-symbol{color:#fff000}.hljs-bullet,.hljs-string{color:#0f0}.hljs-section,.hljs-tag{color:#000fff}.hljs-selector-tag{color:#000fff;font-weight:700}.hljs-attribute,.hljs-built_in,.hljs-link,.hljs-regexp{color:#f0f}.hljs-meta{color:#fff;font-weight:bolder} \ No newline at end of file diff --git a/tools/ui/node_modules/highlight.js/types/index.d.ts b/tools/ui/node_modules/highlight.js/types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b5ffcbe68edf01eaddc605def8e9049164db99d --- /dev/null +++ b/tools/ui/node_modules/highlight.js/types/index.d.ts @@ -0,0 +1,274 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-use-before-define */ +// For TS consumers who use Node and don't have dom in their tsconfig lib, import the necessary types here. +/// + +declare module 'highlight.js/private' { + import { CompiledMode, Mode, Language } from "highlight.js"; + + type MatchType = "begin" | "end" | "illegal" + type EnhancedMatch = RegExpMatchArray & {rule: CompiledMode, type: MatchType} + type AnnotatedError = Error & {mode?: Mode | Language, languageName?: string, badRule?: Mode} + + type KeywordData = [string, number]; + type KeywordDict = Record +} +declare module 'highlight.js' { + + import { KeywordDict } from "highlight.js/private"; + + export type HLJSApi = PublicApi & ModesAPI + + export interface VuePlugin { + install: (vue: any) => void + } + + // perhaps make this an interface? + type RegexEitherOptions = { + capture?: boolean + } + + interface PublicApi { + highlight(code: string, options: HighlightOptions): HighlightResult + /** @deprecated use `higlight(code, {lang: ..., ignoreIllegals: ...})` */ + highlight(languageName: string, code: string, ignoreIllegals?: boolean): HighlightResult + highlightAuto: (code: string, languageSubset?: string[]) => AutoHighlightResult + highlightBlock: (element: HTMLElement) => void + highlightElement: (element: HTMLElement) => void + configure: (options: Partial) => void + initHighlighting: () => void + initHighlightingOnLoad: () => void + highlightAll: () => void + registerLanguage: (languageName: string, language: LanguageFn) => void + unregisterLanguage: (languageName: string) => void + listLanguages: () => string[] + registerAliases: (aliasList: string | string[], { languageName } : {languageName: string}) => void + getLanguage: (languageName: string) => Language | undefined + autoDetection: (languageName: string) => boolean + inherit: (original: T, ...args: Record[]) => T + addPlugin: (plugin: HLJSPlugin) => void + removePlugin: (plugin: HLJSPlugin) => void + debugMode: () => void + safeMode: () => void + versionString: string + vuePlugin: () => VuePlugin + regex: { + concat: (...args: (RegExp | string)[]) => string, + lookahead: (re: RegExp | string) => string, + either: (...args: (RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]) => string, + optional: (re: RegExp | string) => string, + anyNumberOfTimes: (re: RegExp | string) => string + } + newInstance: () => HLJSApi + } + + interface ModesAPI { + SHEBANG: (mode?: Partial & {binary?: string | RegExp}) => Mode + BACKSLASH_ESCAPE: Mode + QUOTE_STRING_MODE: Mode + APOS_STRING_MODE: Mode + PHRASAL_WORDS_MODE: Mode + COMMENT: (begin: string | RegExp, end: string | RegExp, modeOpts?: Mode | {}) => Mode + C_LINE_COMMENT_MODE: Mode + C_BLOCK_COMMENT_MODE: Mode + HASH_COMMENT_MODE: Mode + NUMBER_MODE: Mode + C_NUMBER_MODE: Mode + BINARY_NUMBER_MODE: Mode + REGEXP_MODE: Mode + TITLE_MODE: Mode + UNDERSCORE_TITLE_MODE: Mode + METHOD_GUARD: Mode + END_SAME_AS_BEGIN: (mode: Mode) => Mode + // built in regex + IDENT_RE: string + UNDERSCORE_IDENT_RE: string + MATCH_NOTHING_RE: string + NUMBER_RE: string + C_NUMBER_RE: string + BINARY_NUMBER_RE: string + RE_STARTERS_RE: string + } + + export type LanguageFn = (hljs: HLJSApi) => Language + export type CompilerExt = (mode: Mode, parent: Mode | Language | null) => void + + export interface HighlightResult { + code?: string + relevance : number + value : string + language? : string + illegal : boolean + errorRaised? : Error + // * for auto-highlight + secondBest? : Omit + // private + _illegalBy? : illegalData + _emitter : Emitter + _top? : Language | CompiledMode + } + export interface AutoHighlightResult extends HighlightResult {} + + export interface illegalData { + message: string + context: string + index: number + resultSoFar : string + mode: CompiledMode + } + + export type BeforeHighlightContext = { + code: string, + language: string, + result?: HighlightResult + } + export type PluginEvent = keyof HLJSPlugin; + export type HLJSPlugin = { + 'after:highlight'?: (result: HighlightResult) => void, + 'before:highlight'?: (context: BeforeHighlightContext) => void, + 'after:highlightElement'?: (data: { el: Element, result: HighlightResult, text: string}) => void, + 'before:highlightElement'?: (data: { el: Element, language: string}) => void, + // TODO: Old API, remove with v12 + 'after:highlightBlock'?: (data: { block: Element, result: HighlightResult, text: string}) => void, + 'before:highlightBlock'?: (data: { block: Element, language: string}) => void, + } + + interface EmitterConstructor { + new (opts: any): Emitter + } + + export interface HighlightOptions { + language: string + ignoreIllegals?: boolean + } + + export interface HLJSOptions { + noHighlightRe: RegExp + languageDetectRe: RegExp + classPrefix: string + cssSelector: string + languages?: string[] + __emitter: EmitterConstructor + ignoreUnescapedHTML?: boolean + throwUnescapedHTML?: boolean + } + + export interface CallbackResponse { + data: Record + ignoreMatch: () => void + isMatchIgnored: boolean + } + + export type ModeCallback = (match: RegExpMatchArray, response: CallbackResponse) => void + export type Language = LanguageDetail & Partial + export interface Mode extends ModeCallbacks, ModeDetails {} + + export interface LanguageDetail { + name?: string + unicodeRegex?: boolean + rawDefinition?: () => Language + aliases?: string[] + disableAutodetect?: boolean + contains: (Mode)[] + case_insensitive?: boolean + keywords?: string | string[] | Record + isCompiled?: boolean, + exports?: any, + classNameAliases?: Record + compilerExtensions?: CompilerExt[] + supersetOf?: string + } + + // technically private, but exported for convenience as this has + // been a pretty stable API and is quite useful + export interface Emitter { + startScope(name: string): void + endScope(): void + addText(text: string): void + toHTML(): string + finalize(): void + __addSublanguage(emitter: Emitter, subLanguageName: string): void + } + + export type HighlightedHTMLElement = HTMLElement & {result?: object, secondBest?: object, parentNode: HTMLElement} + + /* modes */ + + interface ModeCallbacks { + "on:end"?: Function, + "on:begin"?: ModeCallback + } + + export interface CompiledLanguage extends LanguageDetail, CompiledMode { + isCompiled: true + contains: CompiledMode[] + keywords: Record + } + + export type CompiledScope = Record & {_emit?: Record, _multi?: boolean, _wrap?: string}; + + export type CompiledMode = Omit & + { + begin?: RegExp | string + end?: RegExp | string + scope?: string + contains: CompiledMode[] + keywords: KeywordDict + data: Record + terminatorEnd: string + keywordPatternRe: RegExp + beginRe: RegExp + endRe: RegExp + illegalRe: RegExp + matcher: any + isCompiled: true + starts?: CompiledMode + parent?: CompiledMode + beginScope?: CompiledScope + endScope?: CompiledScope + } + + interface ModeDetails { + begin?: RegExp | string | (RegExp | string)[] + match?: RegExp | string | (RegExp | string)[] + end?: RegExp | string | (RegExp | string)[] + // deprecated in favor of `scope` + className?: string + scope?: string | Record + beginScope?: string | Record + endScope?: string | Record + contains?: ("self" | Mode)[] + endsParent?: boolean + endsWithParent?: boolean + endSameAsBegin?: boolean + skip?: boolean + excludeBegin?: boolean + excludeEnd?: boolean + returnBegin?: boolean + returnEnd?: boolean + __beforeBegin?: Function + parent?: Mode + starts?:Mode + lexemes?: string | RegExp + keywords?: string | string[] | Record + beginKeywords?: string + relevance?: number + illegal?: string | RegExp | Array + variants?: Mode[] + cachedVariants?: Mode[] + // parsed + subLanguage?: string | string[] + isCompiled?: boolean + label?: string + } + + const hljs : HLJSApi; + export default hljs; + +} + +declare module 'highlight.js/lib/languages/*' { + import { LanguageFn } from "highlight.js"; + const defineLanguage: LanguageFn; + export default defineLanguage; +} diff --git a/tools/ui/node_modules/hono/LICENSE b/tools/ui/node_modules/hono/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bd174facca69a827a3a5410fa09361da5493e024 --- /dev/null +++ b/tools/ui/node_modules/hono/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 - present, Yusuke Wada and Hono contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/hono/README.md b/tools/ui/node_modules/hono/README.md new file mode 100644 index 0000000000000000000000000000000000000000..18ea698aaed3dd7286b25eb6653257e5a450b461 --- /dev/null +++ b/tools/ui/node_modules/hono/README.md @@ -0,0 +1,85 @@ + + +
+ +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/honojs/hono/ci.yml?branch=main)](https://github.com/honojs/hono/actions) +[![GitHub](https://img.shields.io/github/license/honojs/hono)](https://github.com/honojs/hono/blob/main/LICENSE) +[![npm](https://img.shields.io/npm/v/hono)](https://www.npmjs.com/package/hono) +[![npm](https://img.shields.io/npm/dm/hono)](https://www.npmjs.com/package/hono) +[![JSR](https://jsr.io/badges/@hono/hono)](https://jsr.io/@hono/hono) +[![Bundle Size](https://img.shields.io/bundlephobia/min/hono)](https://bundlephobia.com/result?p=hono) +[![Bundle Size](https://img.shields.io/bundlephobia/minzip/hono)](https://bundlephobia.com/result?p=hono) +[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/honojs/hono)](https://github.com/honojs/hono/pulse) +[![GitHub last commit](https://img.shields.io/github/last-commit/honojs/hono)](https://github.com/honojs/hono/commits/main) +[![codecov](https://codecov.io/github/honojs/hono/graph/badge.svg)](https://codecov.io/github/honojs/hono) +[![Discord badge](https://img.shields.io/discord/1011308539819597844?label=Discord&logo=Discord)](https://discord.gg/KMh2eNSdxV) +[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/honojs/hono) + +Hono - _**means flame🔥 in Japanese**_ - is a small, simple, and ultrafast web framework built on Web Standards. It works on any JavaScript runtime: Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js. + +Fast, but not only fast. + +```ts +import { Hono } from 'hono' +const app = new Hono() + +app.get('/', (c) => c.text('Hono!')) + +export default app +``` + +## Quick Start + +```bash +npm create hono@latest +``` + +## Features + +- **Ultrafast** 🚀 - The router `RegExpRouter` is really fast. Not using linear loops. Fast. +- **Lightweight** 🪶 - The `hono/tiny` preset is under 12kB. Hono has zero dependencies and uses only the Web Standard API. +- **Multi-runtime** 🌍 - Works on Cloudflare Workers, Fastly Compute, Deno, Bun, AWS Lambda, Lambda@Edge, or Node.js. The same code runs on all platforms. +- **Batteries Included** 🔋 - Hono has built-in middleware, custom middleware, and third-party middleware. Batteries included. +- **Delightful DX** 😃 - Super clean APIs. First-class TypeScript support. Now, we've got "Types". + +## Documentation + +The documentation is available on [hono.dev](https://hono.dev). + +## Migration + +The migration guide is available on [docs/MIGRATION.md](docs/MIGRATION.md). + +## Communication + +[X](https://x.com/honojs) and [Discord channel](https://discord.gg/KMh2eNSdxV) are available. + +## Contributing + +Contributions Welcome! You can contribute in the following ways. + +- Create an Issue - Propose a new feature. Report a bug. +- Pull Request - Fix a bug or typo. Refactor the code. +- Create third-party middleware - See instructions below. +- Share - Share your thoughts on the Blog, X, and others. +- Make your application - Please try to use Hono. + +For more details, see [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md). + +## Contributors + +Thanks to [all contributors](https://github.com/honojs/hono/graphs/contributors)! + +## Authors + +Yusuke Wada + +_RegExpRouter_, _SmartRouter_, _LinearRouter_, and _PatternRouter_ are created by Taku Amano + +## License + +Distributed under the MIT License. See [LICENSE](LICENSE) for more information. diff --git a/tools/ui/node_modules/hono/dist/adapter/aws-lambda/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/aws-lambda/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..bcfeb24b50056ad843dc66bfd334829d0b5c544b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/aws-lambda/conninfo.js @@ -0,0 +1,24 @@ +// src/adapter/aws-lambda/conninfo.ts +var getConnInfo = (c) => { + const requestContext = c.env.requestContext; + let address; + if ("identity" in requestContext && requestContext.identity?.sourceIp) { + address = requestContext.identity.sourceIp; + } else if ("http" in requestContext && requestContext.http?.sourceIp) { + address = requestContext.http.sourceIp; + } else { + const xff = c.req.header("x-forwarded-for"); + if (xff) { + const ips = xff.split(","); + address = ips[ips.length - 1].trim(); + } + } + return { + remote: { + address + } + }; +}; +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/aws-lambda/handler.js b/tools/ui/node_modules/hono/dist/adapter/aws-lambda/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..31f93cd8f1067b66a11f00d4e7b36b578fb6a763 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/aws-lambda/handler.js @@ -0,0 +1,364 @@ +// src/adapter/aws-lambda/handler.ts +import { decodeBase64, encodeBase64 } from "../../utils/encode.js"; +function sanitizeHeaderValue(value) { + const hasNonAscii = /[^\x00-\x7F]/.test(value); + if (!hasNonAscii) { + return value; + } + return encodeURIComponent(value); +} +var getRequestContext = (event) => { + return event.requestContext; +}; +var streamToNodeStream = async (reader, writer) => { + let readResult = await reader.read(); + while (!readResult.done) { + writer.write(readResult.value); + readResult = await reader.read(); + } + writer.end(); +}; +var streamHandle = (app) => { + return awslambda.streamifyResponse( + async (event, responseStream, context) => { + const processor = getProcessor(event); + try { + const req = processor.createRequest(event); + const requestContext = getRequestContext(event); + const res = await app.fetch(req, { + event, + requestContext, + context + }); + const headers = {}; + const cookies = []; + res.headers.forEach((value, name) => { + if (name === "set-cookie") { + cookies.push(value); + } else { + headers[name] = value; + } + }); + const httpResponseMetadata = { + statusCode: res.status, + headers, + cookies + }; + responseStream = awslambda.HttpResponseStream.from(responseStream, httpResponseMetadata); + if (res.body) { + await streamToNodeStream(res.body.getReader(), responseStream); + } else { + responseStream.write(""); + } + } catch (error) { + console.error("Error processing request:", error); + responseStream.write("Internal Server Error"); + } finally { + responseStream.end(); + } + } + ); +}; +var handle = (app, { isContentTypeBinary } = { isContentTypeBinary: void 0 }) => { + return async (event, lambdaContext) => { + const processor = getProcessor(event); + let req, requestContext; + try { + req = processor.createRequest(event); + requestContext = getRequestContext(event); + } catch (error) { + console.error("Error processing request:", error); + const errorResponse = error instanceof TypeError ? new Response("Invalid request", { status: 400 }) : new Response("Internal Server Error", { status: 500 }); + return processor.createResult(event, errorResponse, { isContentTypeBinary }); + } + const res = await app.fetch(req, { + event, + requestContext, + lambdaContext + }); + return processor.createResult(event, res, { isContentTypeBinary }); + }; +}; +var EventProcessor = class { + getHeaderValue(headers, key) { + const value = headers ? Array.isArray(headers[key]) ? headers[key][0] : headers[key] : void 0; + return value; + } + getDomainName(event) { + if (event.requestContext && "domainName" in event.requestContext) { + return event.requestContext.domainName; + } + const hostFromHeaders = this.getHeaderValue(event.headers, "host"); + if (hostFromHeaders) { + return hostFromHeaders; + } + const multiValueHeaders = "multiValueHeaders" in event ? event.multiValueHeaders : {}; + const hostFromMultiValueHeaders = this.getHeaderValue(multiValueHeaders, "host"); + return hostFromMultiValueHeaders; + } + createRequest(event) { + const queryString = this.getQueryString(event); + const domainName = this.getDomainName(event); + const path = this.getPath(event); + const urlPath = `https://${domainName}${path}`; + const url = queryString ? `${urlPath}?${queryString}` : urlPath; + const headers = this.getHeaders(event); + const method = this.getMethod(event); + const requestInit = { + headers, + method + }; + if (event.body) { + const body = event.isBase64Encoded ? decodeBase64(event.body) : new TextEncoder().encode(event.body); + requestInit.body = body; + headers.set("content-length", body.length.toString()); + } + return new Request(url, requestInit); + } + async createResult(event, res, options) { + const contentType = res.headers.get("content-type"); + const isContentTypeBinary = options.isContentTypeBinary ?? defaultIsContentTypeBinary; + let isBase64Encoded = contentType && isContentTypeBinary(contentType) ? true : false; + if (!isBase64Encoded) { + const contentEncoding = res.headers.get("content-encoding"); + isBase64Encoded = isContentEncodingBinary(contentEncoding); + } + const body = isBase64Encoded ? encodeBase64(await res.arrayBuffer()) : await res.text(); + const result = { + body, + statusCode: res.status, + isBase64Encoded, + ..."multiValueHeaders" in event && event.multiValueHeaders ? { + multiValueHeaders: {} + } : { + headers: {} + } + }; + this.setCookies(event, res, result); + if (result.multiValueHeaders) { + res.headers.forEach((value, key) => { + result.multiValueHeaders[key] = [value]; + }); + } else { + res.headers.forEach((value, key) => { + result.headers[key] = value; + }); + } + return result; + } + setCookies(_event, res, result) { + if (res.headers.has("set-cookie")) { + const cookies = res.headers.getSetCookie ? res.headers.getSetCookie() : Array.from(res.headers.entries()).filter(([k]) => k === "set-cookie").map(([, v]) => v); + if (Array.isArray(cookies)) { + this.setCookiesToResult(result, cookies); + res.headers.delete("set-cookie"); + } + } + } +}; +var EventV2Processor = class extends EventProcessor { + getPath(event) { + return event.rawPath; + } + getMethod(event) { + return event.requestContext.http.method; + } + getQueryString(event) { + return event.rawQueryString; + } + getCookies(event, headers) { + if (Array.isArray(event.cookies)) { + headers.set("Cookie", event.cookies.join("; ")); + } + } + setCookiesToResult(result, cookies) { + result.cookies = cookies; + } + getHeaders(event) { + const headers = new Headers(); + this.getCookies(event, headers); + if (event.headers) { + for (const [k, v] of Object.entries(event.headers)) { + if (v) { + headers.set(k, v); + } + } + } + return headers; + } +}; +var v2Processor = new EventV2Processor(); +var EventV1Processor = class extends EventProcessor { + getPath(event) { + return event.path; + } + getMethod(event) { + return event.httpMethod; + } + getQueryString(event) { + if (event.multiValueQueryStringParameters) { + return Object.entries(event.multiValueQueryStringParameters || {}).filter(([, value]) => value).map( + ([key, values]) => values.map((value) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") + ).join("&"); + } else { + return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value || "")}`).join("&"); + } + } + getCookies(_event, _headers) { + } + getHeaders(event) { + const headers = new Headers(); + this.getCookies(event, headers); + if (event.multiValueHeaders) { + for (const [k, values] of Object.entries(event.multiValueHeaders)) { + if (values) { + values.forEach((v) => headers.append(k, sanitizeHeaderValue(v))); + } + } + } + if (event.headers) { + for (const [k, v] of Object.entries(event.headers)) { + if (v && !headers.has(k)) { + headers.set(k, sanitizeHeaderValue(v)); + } + } + } + return headers; + } + setCookiesToResult(result, cookies) { + result.multiValueHeaders = { + "set-cookie": cookies + }; + } +}; +var v1Processor = new EventV1Processor(); +var ALBProcessor = class extends EventProcessor { + getHeaders(event) { + const headers = new Headers(); + if (event.multiValueHeaders) { + for (const [key, values] of Object.entries(event.multiValueHeaders)) { + if (values && Array.isArray(values)) { + const sanitizedValue = sanitizeHeaderValue(values.join("; ")); + headers.set(key, sanitizedValue); + } + } + } else { + for (const [key, value] of Object.entries(event.headers ?? {})) { + if (value) { + headers.set(key, sanitizeHeaderValue(value)); + } + } + } + return headers; + } + getPath(event) { + return event.path; + } + getMethod(event) { + return event.httpMethod; + } + getQueryString(event) { + if (event.multiValueQueryStringParameters) { + return Object.entries(event.multiValueQueryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value.join(`&${key}=`)}`).join("&"); + } else { + return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value}`).join("&"); + } + } + getCookies(event, headers) { + let cookie; + if (event.multiValueHeaders) { + cookie = event.multiValueHeaders["cookie"]?.join("; "); + } else { + cookie = event.headers ? event.headers["cookie"] : void 0; + } + if (cookie) { + headers.append("Cookie", cookie); + } + } + setCookiesToResult(result, cookies) { + if (result.multiValueHeaders) { + result.multiValueHeaders["set-cookie"] = cookies; + } else { + result.headers["set-cookie"] = cookies[0]; + } + } +}; +var albProcessor = new ALBProcessor(); +var LatticeV2Processor = class extends EventProcessor { + getPath(event) { + return event.path; + } + getMethod(event) { + return event.method; + } + getQueryString() { + return ""; + } + getHeaders(event) { + const headers = new Headers(); + if (event.headers) { + for (const [k, values] of Object.entries(event.headers)) { + if (values) { + values.forEach((v) => headers.append(k, sanitizeHeaderValue(v))); + } + } + } + return headers; + } + getCookies() { + } + setCookiesToResult(result, cookies) { + result.headers = { + ...result.headers, + "set-cookie": cookies + }; + } +}; +var latticeV2Processor = new LatticeV2Processor(); +var getProcessor = (event) => { + if (isProxyEventALB(event)) { + return albProcessor; + } + if (isProxyEventV2(event)) { + return v2Processor; + } + if (isLatticeEventV2(event)) { + return latticeV2Processor; + } + return v1Processor; +}; +var isProxyEventALB = (event) => { + if (event.requestContext) { + return Object.hasOwn(event.requestContext, "elb"); + } + return false; +}; +var isProxyEventV2 = (event) => { + return Object.hasOwn(event, "rawPath") && Object.hasOwn(event.requestContext ?? {}, "http"); +}; +var isLatticeEventV2 = (event) => { + if (event.requestContext) { + return Object.hasOwn(event.requestContext, "serviceArn"); + } + return false; +}; +var defaultIsContentTypeBinary = (contentType) => { + return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/.test( + contentType + ); +}; +var isContentEncodingBinary = (contentEncoding) => { + return !!contentEncoding && !/^identity$/i.test(contentEncoding); +}; +export { + ALBProcessor, + EventProcessor, + EventV1Processor, + EventV2Processor, + LatticeV2Processor, + defaultIsContentTypeBinary, + getProcessor, + handle, + isContentEncodingBinary, + streamHandle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/aws-lambda/index.js b/tools/ui/node_modules/hono/dist/adapter/aws-lambda/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f67966b93763067458d0ac3c6e0970d4656ac504 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/aws-lambda/index.js @@ -0,0 +1,9 @@ +// src/adapter/aws-lambda/index.ts +import { handle, streamHandle, defaultIsContentTypeBinary } from "./handler.js"; +import { getConnInfo } from "./conninfo.js"; +export { + defaultIsContentTypeBinary, + getConnInfo, + handle, + streamHandle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/aws-lambda/types.js b/tools/ui/node_modules/hono/dist/adapter/aws-lambda/types.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/adapter/bun/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/bun/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..52215543914e630b01a065f00b5488dca7c32e42 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/bun/conninfo.js @@ -0,0 +1,27 @@ +// src/adapter/bun/conninfo.ts +import { getBunServer } from "./server.js"; +var getConnInfo = (c) => { + const server = getBunServer(c); + if (!server) { + throw new TypeError("env has to include the 2nd argument of fetch."); + } + if (typeof server.requestIP !== "function") { + throw new TypeError("server.requestIP is not a function."); + } + const info = server.requestIP(c.req.raw); + if (!info) { + return { + remote: {} + }; + } + return { + remote: { + address: info.address, + addressType: info.family === "IPv6" || info.family === "IPv4" ? info.family : void 0, + port: info.port + } + }; +}; +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/bun/index.js b/tools/ui/node_modules/hono/dist/adapter/bun/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5105d6198fa696b3c3a9701d10e633c9939a41fd --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/bun/index.js @@ -0,0 +1,16 @@ +// src/adapter/bun/index.ts +import { serveStatic } from "./serve-static.js"; +import { bunFileSystemModule, toSSG } from "./ssg.js"; +import { createBunWebSocket, upgradeWebSocket, websocket } from "./websocket.js"; +import { getConnInfo } from "./conninfo.js"; +import { getBunServer } from "./server.js"; +export { + bunFileSystemModule, + createBunWebSocket, + getBunServer, + getConnInfo, + serveStatic, + toSSG, + upgradeWebSocket, + websocket +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/bun/serve-static.js b/tools/ui/node_modules/hono/dist/adapter/bun/serve-static.js new file mode 100644 index 0000000000000000000000000000000000000000..5cd8755204f5dbbc1284c581be8c1c9f12190ee9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/bun/serve-static.js @@ -0,0 +1,30 @@ +// src/adapter/bun/serve-static.ts +import { stat } from "node:fs/promises"; +import { join } from "node:path"; +import { serveStatic as baseServeStatic } from "../../middleware/serve-static/index.js"; +var serveStatic = (options = {}) => { + return async function serveStatic2(c, next) { + const getContent = async (path) => { + const file = Bun.file(path); + return await file.exists() ? file : null; + }; + const isDir = async (path) => { + let isDir2; + try { + const stats = await stat(path); + isDir2 = stats.isDirectory(); + } catch { + } + return isDir2; + }; + return baseServeStatic({ + ...options, + getContent, + join, + isDir + })(c, next); + }; +}; +export { + serveStatic +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/bun/server.js b/tools/ui/node_modules/hono/dist/adapter/bun/server.js new file mode 100644 index 0000000000000000000000000000000000000000..7c047d5a8425e22f0b13aaed59d4e9a77e380dfe --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/bun/server.js @@ -0,0 +1,5 @@ +// src/adapter/bun/server.ts +var getBunServer = (c) => "server" in c.env ? c.env.server : c.env; +export { + getBunServer +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/bun/ssg.js b/tools/ui/node_modules/hono/dist/adapter/bun/ssg.js new file mode 100644 index 0000000000000000000000000000000000000000..9314fb0d2f8e5840a38f11d27165274a3b578134 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/bun/ssg.js @@ -0,0 +1,17 @@ +// src/adapter/bun/ssg.ts +import { toSSG as baseToSSG } from "../../helper/ssg/index.js"; +var { write } = Bun; +var bunFileSystemModule = { + writeFile: async (path, data) => { + await write(path, data); + }, + mkdir: async () => { + } +}; +var toSSG = async (app, options) => { + return baseToSSG(app, bunFileSystemModule, options); +}; +export { + bunFileSystemModule, + toSSG +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/bun/websocket.js b/tools/ui/node_modules/hono/dist/adapter/bun/websocket.js new file mode 100644 index 0000000000000000000000000000000000000000..5f0d5f7f1901db2fedd518dcb375ba1254677cfa --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/bun/websocket.js @@ -0,0 +1,73 @@ +// src/adapter/bun/websocket.ts +import { createWSMessageEvent, defineWebSocketHelper, WSContext } from "../../helper/websocket/index.js"; +import { getBunServer } from "./server.js"; +var createWSContext = (ws) => { + return new WSContext({ + send: (source, options) => { + ws.send(source, options?.compress); + }, + raw: ws, + readyState: ws.readyState, + url: ws.data.url, + protocol: ws.data.protocol, + close(code, reason) { + ws.close(code, reason); + } + }); +}; +var upgradeWebSocket = defineWebSocketHelper((c, events) => { + const server = getBunServer(c); + if (!server) { + throw new TypeError("env has to include the 2nd argument of fetch."); + } + const upgradeResult = server.upgrade(c.req.raw, { + data: { + events, + url: new URL(c.req.url), + // The first requested subprotocol, exposed via WSContext.protocol to + // match the deno and cloudflare adapters. + protocol: c.req.header("sec-websocket-protocol")?.split(",")[0]?.trim() ?? "" + } + }); + if (upgradeResult) { + return new Response(null); + } + return; +}); +var websocket = { + open(ws) { + const websocketListeners = ws.data.events; + if (websocketListeners.onOpen) { + websocketListeners.onOpen(new Event("open"), createWSContext(ws)); + } + }, + close(ws, code, reason) { + const websocketListeners = ws.data.events; + if (websocketListeners.onClose) { + websocketListeners.onClose( + new CloseEvent("close", { + code, + reason + }), + createWSContext(ws) + ); + } + }, + message(ws, message) { + const websocketListeners = ws.data.events; + if (websocketListeners.onMessage) { + const normalizedReceiveData = typeof message === "string" ? message : message.buffer; + websocketListeners.onMessage(createWSMessageEvent(normalizedReceiveData), createWSContext(ws)); + } + } +}; +var createBunWebSocket = () => ({ + upgradeWebSocket, + websocket +}); +export { + createBunWebSocket, + createWSContext, + upgradeWebSocket, + websocket +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..61e961e93f870861847c684a78c279280fc9301c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js @@ -0,0 +1,9 @@ +// src/adapter/cloudflare-pages/conninfo.ts +var getConnInfo = (c) => ({ + remote: { + address: c.req.header("cf-connecting-ip") + } +}); +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/handler.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..83f7781b6158925ec9794ac75ff3f70f7dad0398 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/handler.js @@ -0,0 +1,67 @@ +// src/adapter/cloudflare-pages/handler.ts +import { Context } from "../../context.js"; +import { HTTPException } from "../../http-exception.js"; +var handle = (app) => (eventContext) => { + return app.fetch( + eventContext.request, + { ...eventContext.env, eventContext }, + { + waitUntil: eventContext.waitUntil, + passThroughOnException: eventContext.passThroughOnException, + props: {} + } + ); +}; +function handleMiddleware(middleware) { + return async (executionCtx) => { + const context = new Context(executionCtx.request, { + env: { ...executionCtx.env, eventContext: executionCtx }, + executionCtx + }); + let response = void 0; + try { + response = await middleware(context, async () => { + try { + context.res = await executionCtx.next(); + } catch (error) { + if (error instanceof Error) { + context.error = error; + } else { + throw error; + } + } + }); + } catch (error) { + if (error instanceof Error) { + context.error = error; + } else { + throw error; + } + } + if (response) { + return response; + } + if (context.error instanceof HTTPException) { + return context.error.getResponse(); + } + if (context.error) { + throw context.error; + } + return context.res; + }; +} +var serveStatic = () => { + return async (c) => { + const env = c.env; + const res = await env.ASSETS.fetch(c.req.raw); + if (res.status === 404) { + return c.notFound(); + } + return res; + }; +}; +export { + handle, + handleMiddleware, + serveStatic +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/index.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/index.js new file mode 100644 index 0000000000000000000000000000000000000000..07c732dc45415ea0488a5e13d43386ed2b27c4e8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-pages/index.js @@ -0,0 +1,9 @@ +// src/adapter/cloudflare-pages/index.ts +import { handle, handleMiddleware, serveStatic } from "./handler.js"; +import { getConnInfo } from "./conninfo.js"; +export { + getConnInfo, + handle, + handleMiddleware, + serveStatic +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..44937193c781d95be86bb72276b534fde8c9abbc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js @@ -0,0 +1,9 @@ +// src/adapter/cloudflare-workers/conninfo.ts +var getConnInfo = (c) => ({ + remote: { + address: c.req.header("cf-connecting-ip") + } +}); +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/index.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ee9b3de65d08641ecfcac971f3cc6efb336e3bb8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/index.js @@ -0,0 +1,9 @@ +// src/adapter/cloudflare-workers/index.ts +import { serveStatic } from "./serve-static-module.js"; +import { upgradeWebSocket } from "./websocket.js"; +import { getConnInfo } from "./conninfo.js"; +export { + getConnInfo, + serveStatic, + upgradeWebSocket +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js new file mode 100644 index 0000000000000000000000000000000000000000..36871f970979919d147317d4e7610203c5c90a6a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js @@ -0,0 +1,8 @@ +// src/adapter/cloudflare-workers/serve-static-module.ts +import { serveStatic } from "./serve-static.js"; +var module = (options) => { + return serveStatic(options); +}; +export { + module as serveStatic +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js new file mode 100644 index 0000000000000000000000000000000000000000..7cf1f7ef35ae63fce53da73060463e2c205396dd --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js @@ -0,0 +1,22 @@ +// src/adapter/cloudflare-workers/serve-static.ts +import { serveStatic as baseServeStatic } from "../../middleware/serve-static/index.js"; +import { getContentFromKVAsset } from "./utils.js"; +var serveStatic = (options = {}) => { + return async function serveStatic2(c, next) { + const getContent = async (path) => { + return getContentFromKVAsset(path, { + manifest: options.manifest, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + namespace: options.namespace ? options.namespace : c.env ? c.env.__STATIC_CONTENT : void 0 + }); + }; + return baseServeStatic({ + ...options, + getContent + })(c, next); + }; +}; +export { + serveStatic +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/utils.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c4ee5d52df884117a4c2a503476574e503a42e82 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/utils.js @@ -0,0 +1,35 @@ +// src/adapter/cloudflare-workers/utils.ts +var getContentFromKVAsset = async (path, options) => { + let ASSET_MANIFEST; + if (options && options.manifest) { + if (typeof options.manifest === "string") { + ASSET_MANIFEST = JSON.parse(options.manifest); + } else { + ASSET_MANIFEST = options.manifest; + } + } else { + if (typeof __STATIC_CONTENT_MANIFEST === "string") { + ASSET_MANIFEST = JSON.parse(__STATIC_CONTENT_MANIFEST); + } else { + ASSET_MANIFEST = __STATIC_CONTENT_MANIFEST; + } + } + let ASSET_NAMESPACE; + if (options && options.namespace) { + ASSET_NAMESPACE = options.namespace; + } else { + ASSET_NAMESPACE = __STATIC_CONTENT; + } + const key = ASSET_MANIFEST[path]; + if (!key) { + return null; + } + const content = await ASSET_NAMESPACE.get(key, { type: "stream" }); + if (!content) { + return null; + } + return content; +}; +export { + getContentFromKVAsset +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js new file mode 100644 index 0000000000000000000000000000000000000000..f3b952cccf1ef108853e73377c1536aca77bcaf0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js @@ -0,0 +1,41 @@ +// src/adapter/cloudflare-workers/websocket.ts +import { WSContext, defineWebSocketHelper } from "../../helper/websocket/index.js"; +var upgradeWebSocket = defineWebSocketHelper(async (c, events) => { + const upgradeHeader = c.req.header("Upgrade"); + if (upgradeHeader !== "websocket") { + return; + } + const webSocketPair = new WebSocketPair(); + const client = webSocketPair[0]; + const server = webSocketPair[1]; + const wsContext = new WSContext({ + close: (code, reason) => server.close(code, reason), + get protocol() { + return server.protocol; + }, + raw: server, + get readyState() { + return server.readyState; + }, + url: server.url ? new URL(server.url) : null, + send: (source) => server.send(source) + }); + if (events.onClose) { + server.addEventListener("close", (evt) => events.onClose?.(evt, wsContext)); + } + if (events.onMessage) { + server.addEventListener("message", (evt) => events.onMessage?.(evt, wsContext)); + } + if (events.onError) { + server.addEventListener("error", (evt) => events.onError?.(evt, wsContext)); + } + server.accept?.(); + return new Response(null, { + status: 101, + // @ts-expect-error - webSocket is not typed + webSocket: client + }); +}); +export { + upgradeWebSocket +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/deno/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/deno/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..5ee66643092c7349103e172ea38100105866f9b7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/deno/conninfo.js @@ -0,0 +1,14 @@ +// src/adapter/deno/conninfo.ts +var getConnInfo = (c) => { + const { remoteAddr } = c.env; + return { + remote: { + address: remoteAddr.hostname, + port: remoteAddr.port, + transport: remoteAddr.transport + } + }; +}; +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/deno/deno.d.js b/tools/ui/node_modules/hono/dist/adapter/deno/deno.d.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/adapter/deno/index.js b/tools/ui/node_modules/hono/dist/adapter/deno/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bc06d954bd9e6da7d62c5a9567dab63788aa8a94 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/deno/index.js @@ -0,0 +1,12 @@ +// src/adapter/deno/index.ts +import { serveStatic } from "./serve-static.js"; +import { toSSG, denoFileSystemModule } from "./ssg.js"; +import { upgradeWebSocket } from "./websocket.js"; +import { getConnInfo } from "./conninfo.js"; +export { + denoFileSystemModule, + getConnInfo, + serveStatic, + toSSG, + upgradeWebSocket +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/deno/serve-static.js b/tools/ui/node_modules/hono/dist/adapter/deno/serve-static.js new file mode 100644 index 0000000000000000000000000000000000000000..aea60db11902cbb0cb85889184bf1b26d0c89dae --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/deno/serve-static.js @@ -0,0 +1,40 @@ +// src/adapter/deno/serve-static.ts +import { join } from "node:path"; +import { serveStatic as baseServeStatic } from "../../middleware/serve-static/index.js"; +var { open, lstatSync, errors } = Deno; +var serveStatic = (options = {}) => { + return async function serveStatic2(c, next) { + const getContent = async (path) => { + try { + if (isDir(path)) { + return null; + } + const file = await open(path); + return file.readable; + } catch (e) { + if (!(e instanceof errors.NotFound)) { + console.warn(`${e}`); + } + return null; + } + }; + const isDir = (path) => { + let isDir2; + try { + const stat = lstatSync(path); + isDir2 = stat.isDirectory; + } catch { + } + return isDir2; + }; + return baseServeStatic({ + ...options, + getContent, + join, + isDir + })(c, next); + }; +}; +export { + serveStatic +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/deno/ssg.js b/tools/ui/node_modules/hono/dist/adapter/deno/ssg.js new file mode 100644 index 0000000000000000000000000000000000000000..c7b9b313bebf26b0d4770cd9f7510c9b64a1939b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/deno/ssg.js @@ -0,0 +1,18 @@ +// src/adapter/deno/ssg.ts +import { toSSG as baseToSSG } from "../../helper/ssg/index.js"; +var denoFileSystemModule = { + writeFile: async (path, data) => { + const uint8Data = typeof data === "string" ? new TextEncoder().encode(data) : new Uint8Array(data); + await Deno.writeFile(path, uint8Data); + }, + mkdir: async (path, options) => { + return Deno.mkdir(path, { recursive: options?.recursive ?? false }); + } +}; +var toSSG = async (app, options) => { + return baseToSSG(app, denoFileSystemModule, options); +}; +export { + denoFileSystemModule, + toSSG +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/deno/websocket.js b/tools/ui/node_modules/hono/dist/adapter/deno/websocket.js new file mode 100644 index 0000000000000000000000000000000000000000..f5bfa20f146f42316a7be1b401ec00183cd4ba0e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/deno/websocket.js @@ -0,0 +1,32 @@ +// src/adapter/deno/websocket.ts +import { WSContext, defineWebSocketHelper } from "../../helper/websocket/index.js"; +var upgradeWebSocket = defineWebSocketHelper(async (c, events, options) => { + if (c.req.header("upgrade") !== "websocket") { + return; + } + const subprotocol = c.req.header("sec-websocket-protocol")?.split(",")[0]?.trim(); + const { response, socket } = Deno.upgradeWebSocket(c.req.raw, { + ...subprotocol ? { protocol: subprotocol } : {}, + ...options + }); + const wsContext = new WSContext({ + close: (code, reason) => socket.close(code, reason), + get protocol() { + return socket.protocol; + }, + raw: socket, + get readyState() { + return socket.readyState; + }, + url: socket.url ? new URL(socket.url) : null, + send: (source) => socket.send(source) + }); + socket.onopen = (evt) => events.onOpen?.(evt, wsContext); + socket.onmessage = (evt) => events.onMessage?.(evt, wsContext); + socket.onclose = (evt) => events.onClose?.(evt, wsContext); + socket.onerror = (evt) => events.onError?.(evt, wsContext); + return response; +}); +export { + upgradeWebSocket +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/lambda-edge/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/lambda-edge/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..0f143a3bc011d155021a2c32ceac5a8387d1e1fb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/lambda-edge/conninfo.js @@ -0,0 +1,9 @@ +// src/adapter/lambda-edge/conninfo.ts +var getConnInfo = (c) => ({ + remote: { + address: c.env.event.Records[0].cf.request.clientIp + } +}); +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/lambda-edge/handler.js b/tools/ui/node_modules/hono/dist/adapter/lambda-edge/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..d3ca259e8c4ed99cde1aa1222e209b4a4c8a466e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/lambda-edge/handler.js @@ -0,0 +1,96 @@ +// src/adapter/lambda-edge/handler.ts +import crypto from "node:crypto"; +import { decodeBase64, encodeBase64 } from "../../utils/encode.js"; +globalThis.crypto ??= crypto; +var convertHeaders = (headers) => { + const cfHeaders = {}; + headers.forEach((value, key) => { + cfHeaders[key.toLowerCase()] = [ + ...cfHeaders[key.toLowerCase()] || [], + { key: key.toLowerCase(), value } + ]; + }); + return cfHeaders; +}; +var handle = (app) => { + return async (event, ...args) => { + const [context, callback] = args; + let callbackError = null; + let callbackResult; + const res = await app.fetch(createRequest(event), { + event, + context, + callback: (err, result) => { + if (!callbackError && !callbackResult) { + callbackError = err; + callbackResult = result; + } + callback?.(err, result); + }, + config: event.Records[0].cf.config, + request: event.Records[0].cf.request, + response: event.Records[0].cf.response + }); + if (callbackError) { + throw callbackError; + } + return callbackResult ?? createResult(res); + }; +}; +var createResult = async (res) => { + const contentEncoding = res.headers.get("content-encoding"); + const isBase64Encoded = isContentTypeBinary(res.headers.get("content-type") || "") || !!contentEncoding && !/^identity$/i.test(contentEncoding); + const body = isBase64Encoded ? encodeBase64(await res.arrayBuffer()) : await res.text(); + return { + status: res.status.toString(), + headers: convertHeaders(res.headers), + body, + ...isBase64Encoded && { bodyEncoding: "base64" } + }; +}; +var createRequest = (event) => { + const queryString = event.Records[0].cf.request.querystring; + const host = event.Records[0].cf.request.headers?.host?.[0]?.value || event.Records[0].cf.config.distributionDomainName; + const urlPath = `https://${host}${event.Records[0].cf.request.uri}`; + const url = queryString ? `${urlPath}?${queryString}` : urlPath; + const headers = new Headers(); + Object.entries(event.Records[0].cf.request.headers).forEach(([k, v]) => { + v.forEach((header) => headers.append(k, header.value)); + }); + const requestBody = event.Records[0].cf.request.body; + const method = event.Records[0].cf.request.method; + const rawBody = createBody(method, requestBody); + let body = rawBody; + if (rawBody !== void 0) { + const bytes = typeof rawBody === "string" ? new TextEncoder().encode(rawBody) : rawBody; + body = bytes; + headers.set("content-length", bytes.length.toString()); + } + return new Request(url, { + headers, + method, + body + }); +}; +var createBody = (method, requestBody) => { + if (!requestBody || !requestBody.data) { + return void 0; + } + if (method === "GET" || method === "HEAD") { + return void 0; + } + if (requestBody.encoding === "base64") { + return decodeBase64(requestBody.data); + } + return requestBody.data; +}; +var isContentTypeBinary = (contentType) => { + return !/^(text\/(plain|html|css|javascript|csv).*|application\/(.*json|.*xml).*|image\/svg\+xml.*)$/.test( + contentType + ); +}; +export { + createBody, + handle, + isContentTypeBinary +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/lambda-edge/index.js b/tools/ui/node_modules/hono/dist/adapter/lambda-edge/index.js new file mode 100644 index 0000000000000000000000000000000000000000..584aa3c67defb72bb473c979ff4bb73fe0a6ed4f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/lambda-edge/index.js @@ -0,0 +1,7 @@ +// src/adapter/lambda-edge/index.ts +import { handle } from "./handler.js"; +import { getConnInfo } from "./conninfo.js"; +export { + getConnInfo, + handle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/netlify/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/netlify/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..a35121eed0f30c60472e9d3ce550ff8a69a3a76b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/netlify/conninfo.js @@ -0,0 +1,9 @@ +// src/adapter/netlify/conninfo.ts +var getConnInfo = (c) => ({ + remote: { + address: c.env.context?.ip + } +}); +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/netlify/handler.js b/tools/ui/node_modules/hono/dist/adapter/netlify/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..364a06a915d3219a8c09c1b903ed274510cd062c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/netlify/handler.js @@ -0,0 +1,9 @@ +// src/adapter/netlify/handler.ts +var handle = (app) => { + return (req, context) => { + return app.fetch(req, { context }); + }; +}; +export { + handle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/netlify/index.js b/tools/ui/node_modules/hono/dist/adapter/netlify/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e48e8bd731f282d1ea23b3973a183579dd5d00bc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/netlify/index.js @@ -0,0 +1,2 @@ +// src/adapter/netlify/index.ts +export * from "./mod.js"; diff --git a/tools/ui/node_modules/hono/dist/adapter/netlify/mod.js b/tools/ui/node_modules/hono/dist/adapter/netlify/mod.js new file mode 100644 index 0000000000000000000000000000000000000000..7763450baa33aad6631a619f6c95b3ee3687c4c6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/netlify/mod.js @@ -0,0 +1,7 @@ +// src/adapter/netlify/mod.ts +import { handle } from "./handler.js"; +import { getConnInfo } from "./conninfo.js"; +export { + getConnInfo, + handle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/service-worker/handler.js b/tools/ui/node_modules/hono/dist/adapter/service-worker/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..b76e5fce98a28c4fbe309c0b36044a4e9e1fdff0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/service-worker/handler.js @@ -0,0 +1,20 @@ +// src/adapter/service-worker/handler.ts +var handle = (app, opts = { + // To use `fetch` on a Service Worker correctly, bind it to `globalThis`. + fetch: globalThis.fetch.bind(globalThis) +}) => { + return (evt) => { + evt.respondWith( + (async () => { + const res = await app.fetch(evt.request, {}, evt); + if (opts.fetch && res.status === 404) { + return await opts.fetch(evt.request); + } + return res; + })() + ); + }; +}; +export { + handle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/service-worker/index.js b/tools/ui/node_modules/hono/dist/adapter/service-worker/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6c270a2541515ba593e269555612c927722a6b98 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/service-worker/index.js @@ -0,0 +1,9 @@ +// src/adapter/service-worker/index.ts +import { handle } from "./handler.js"; +var fire = (app, options) => { + addEventListener("fetch", handle(app, options)); +}; +export { + fire, + handle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/service-worker/types.js b/tools/ui/node_modules/hono/dist/adapter/service-worker/types.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/adapter/vercel/conninfo.js b/tools/ui/node_modules/hono/dist/adapter/vercel/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..532635d6f165145ed6e67faa0c8c1dfdde0fb63a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/vercel/conninfo.js @@ -0,0 +1,10 @@ +// src/adapter/vercel/conninfo.ts +var getConnInfo = (c) => ({ + remote: { + // https://github.com/vercel/vercel/blob/b70bfb5fbf28a4650d4042ce68ca5c636d37cf44/packages/edge/src/edge-headers.ts#L10-L12C32 + address: c.req.header("x-real-ip") + } +}); +export { + getConnInfo +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/vercel/handler.js b/tools/ui/node_modules/hono/dist/adapter/vercel/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..6037b2b3d158e8e506ecb8ad360479058a8461c4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/vercel/handler.js @@ -0,0 +1,7 @@ +// src/adapter/vercel/handler.ts +var handle = (app) => (req) => { + return app.fetch(req); +}; +export { + handle +}; diff --git a/tools/ui/node_modules/hono/dist/adapter/vercel/index.js b/tools/ui/node_modules/hono/dist/adapter/vercel/index.js new file mode 100644 index 0000000000000000000000000000000000000000..dcd9d48582a935766e7a058db46f35f977b422c4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/adapter/vercel/index.js @@ -0,0 +1,7 @@ +// src/adapter/vercel/index.ts +import { handle } from "./handler.js"; +import { getConnInfo } from "./conninfo.js"; +export { + getConnInfo, + handle +}; diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..f94df6a54ff075c57d13ff5060c11f77c2a8b40a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js @@ -0,0 +1,46 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +const getConnInfo = (c) => { + const requestContext = c.env.requestContext; + let address; + if ("identity" in requestContext && requestContext.identity?.sourceIp) { + address = requestContext.identity.sourceIp; + } else if ("http" in requestContext && requestContext.http?.sourceIp) { + address = requestContext.http.sourceIp; + } else { + const xff = c.req.header("x-forwarded-for"); + if (xff) { + const ips = xff.split(","); + address = ips[ips.length - 1].trim(); + } + } + return { + remote: { + address + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..6cfa63437203983a5132057f50085046d8887bb2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js @@ -0,0 +1,395 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var handler_exports = {}; +__export(handler_exports, { + ALBProcessor: () => ALBProcessor, + EventProcessor: () => EventProcessor, + EventV1Processor: () => EventV1Processor, + EventV2Processor: () => EventV2Processor, + LatticeV2Processor: () => LatticeV2Processor, + defaultIsContentTypeBinary: () => defaultIsContentTypeBinary, + getProcessor: () => getProcessor, + handle: () => handle, + isContentEncodingBinary: () => isContentEncodingBinary, + streamHandle: () => streamHandle +}); +module.exports = __toCommonJS(handler_exports); +var import_encode = require("../../utils/encode"); +function sanitizeHeaderValue(value) { + const hasNonAscii = /[^\x00-\x7F]/.test(value); + if (!hasNonAscii) { + return value; + } + return encodeURIComponent(value); +} +const getRequestContext = (event) => { + return event.requestContext; +}; +const streamToNodeStream = async (reader, writer) => { + let readResult = await reader.read(); + while (!readResult.done) { + writer.write(readResult.value); + readResult = await reader.read(); + } + writer.end(); +}; +const streamHandle = (app) => { + return awslambda.streamifyResponse( + async (event, responseStream, context) => { + const processor = getProcessor(event); + try { + const req = processor.createRequest(event); + const requestContext = getRequestContext(event); + const res = await app.fetch(req, { + event, + requestContext, + context + }); + const headers = {}; + const cookies = []; + res.headers.forEach((value, name) => { + if (name === "set-cookie") { + cookies.push(value); + } else { + headers[name] = value; + } + }); + const httpResponseMetadata = { + statusCode: res.status, + headers, + cookies + }; + responseStream = awslambda.HttpResponseStream.from(responseStream, httpResponseMetadata); + if (res.body) { + await streamToNodeStream(res.body.getReader(), responseStream); + } else { + responseStream.write(""); + } + } catch (error) { + console.error("Error processing request:", error); + responseStream.write("Internal Server Error"); + } finally { + responseStream.end(); + } + } + ); +}; +const handle = (app, { isContentTypeBinary } = { isContentTypeBinary: void 0 }) => { + return async (event, lambdaContext) => { + const processor = getProcessor(event); + let req, requestContext; + try { + req = processor.createRequest(event); + requestContext = getRequestContext(event); + } catch (error) { + console.error("Error processing request:", error); + const errorResponse = error instanceof TypeError ? new Response("Invalid request", { status: 400 }) : new Response("Internal Server Error", { status: 500 }); + return processor.createResult(event, errorResponse, { isContentTypeBinary }); + } + const res = await app.fetch(req, { + event, + requestContext, + lambdaContext + }); + return processor.createResult(event, res, { isContentTypeBinary }); + }; +}; +class EventProcessor { + getHeaderValue(headers, key) { + const value = headers ? Array.isArray(headers[key]) ? headers[key][0] : headers[key] : void 0; + return value; + } + getDomainName(event) { + if (event.requestContext && "domainName" in event.requestContext) { + return event.requestContext.domainName; + } + const hostFromHeaders = this.getHeaderValue(event.headers, "host"); + if (hostFromHeaders) { + return hostFromHeaders; + } + const multiValueHeaders = "multiValueHeaders" in event ? event.multiValueHeaders : {}; + const hostFromMultiValueHeaders = this.getHeaderValue(multiValueHeaders, "host"); + return hostFromMultiValueHeaders; + } + createRequest(event) { + const queryString = this.getQueryString(event); + const domainName = this.getDomainName(event); + const path = this.getPath(event); + const urlPath = `https://${domainName}${path}`; + const url = queryString ? `${urlPath}?${queryString}` : urlPath; + const headers = this.getHeaders(event); + const method = this.getMethod(event); + const requestInit = { + headers, + method + }; + if (event.body) { + const body = event.isBase64Encoded ? (0, import_encode.decodeBase64)(event.body) : new TextEncoder().encode(event.body); + requestInit.body = body; + headers.set("content-length", body.length.toString()); + } + return new Request(url, requestInit); + } + async createResult(event, res, options) { + const contentType = res.headers.get("content-type"); + const isContentTypeBinary = options.isContentTypeBinary ?? defaultIsContentTypeBinary; + let isBase64Encoded = contentType && isContentTypeBinary(contentType) ? true : false; + if (!isBase64Encoded) { + const contentEncoding = res.headers.get("content-encoding"); + isBase64Encoded = isContentEncodingBinary(contentEncoding); + } + const body = isBase64Encoded ? (0, import_encode.encodeBase64)(await res.arrayBuffer()) : await res.text(); + const result = { + body, + statusCode: res.status, + isBase64Encoded, + ..."multiValueHeaders" in event && event.multiValueHeaders ? { + multiValueHeaders: {} + } : { + headers: {} + } + }; + this.setCookies(event, res, result); + if (result.multiValueHeaders) { + res.headers.forEach((value, key) => { + result.multiValueHeaders[key] = [value]; + }); + } else { + res.headers.forEach((value, key) => { + result.headers[key] = value; + }); + } + return result; + } + setCookies(_event, res, result) { + if (res.headers.has("set-cookie")) { + const cookies = res.headers.getSetCookie ? res.headers.getSetCookie() : Array.from(res.headers.entries()).filter(([k]) => k === "set-cookie").map(([, v]) => v); + if (Array.isArray(cookies)) { + this.setCookiesToResult(result, cookies); + res.headers.delete("set-cookie"); + } + } + } +} +class EventV2Processor extends EventProcessor { + getPath(event) { + return event.rawPath; + } + getMethod(event) { + return event.requestContext.http.method; + } + getQueryString(event) { + return event.rawQueryString; + } + getCookies(event, headers) { + if (Array.isArray(event.cookies)) { + headers.set("Cookie", event.cookies.join("; ")); + } + } + setCookiesToResult(result, cookies) { + result.cookies = cookies; + } + getHeaders(event) { + const headers = new Headers(); + this.getCookies(event, headers); + if (event.headers) { + for (const [k, v] of Object.entries(event.headers)) { + if (v) { + headers.set(k, v); + } + } + } + return headers; + } +} +const v2Processor = new EventV2Processor(); +class EventV1Processor extends EventProcessor { + getPath(event) { + return event.path; + } + getMethod(event) { + return event.httpMethod; + } + getQueryString(event) { + if (event.multiValueQueryStringParameters) { + return Object.entries(event.multiValueQueryStringParameters || {}).filter(([, value]) => value).map( + ([key, values]) => values.map((value) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") + ).join("&"); + } else { + return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value || "")}`).join("&"); + } + } + getCookies(_event, _headers) { + } + getHeaders(event) { + const headers = new Headers(); + this.getCookies(event, headers); + if (event.multiValueHeaders) { + for (const [k, values] of Object.entries(event.multiValueHeaders)) { + if (values) { + values.forEach((v) => headers.append(k, sanitizeHeaderValue(v))); + } + } + } + if (event.headers) { + for (const [k, v] of Object.entries(event.headers)) { + if (v && !headers.has(k)) { + headers.set(k, sanitizeHeaderValue(v)); + } + } + } + return headers; + } + setCookiesToResult(result, cookies) { + result.multiValueHeaders = { + "set-cookie": cookies + }; + } +} +const v1Processor = new EventV1Processor(); +class ALBProcessor extends EventProcessor { + getHeaders(event) { + const headers = new Headers(); + if (event.multiValueHeaders) { + for (const [key, values] of Object.entries(event.multiValueHeaders)) { + if (values && Array.isArray(values)) { + const sanitizedValue = sanitizeHeaderValue(values.join("; ")); + headers.set(key, sanitizedValue); + } + } + } else { + for (const [key, value] of Object.entries(event.headers ?? {})) { + if (value) { + headers.set(key, sanitizeHeaderValue(value)); + } + } + } + return headers; + } + getPath(event) { + return event.path; + } + getMethod(event) { + return event.httpMethod; + } + getQueryString(event) { + if (event.multiValueQueryStringParameters) { + return Object.entries(event.multiValueQueryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value.join(`&${key}=`)}`).join("&"); + } else { + return Object.entries(event.queryStringParameters || {}).filter(([, value]) => value).map(([key, value]) => `${key}=${value}`).join("&"); + } + } + getCookies(event, headers) { + let cookie; + if (event.multiValueHeaders) { + cookie = event.multiValueHeaders["cookie"]?.join("; "); + } else { + cookie = event.headers ? event.headers["cookie"] : void 0; + } + if (cookie) { + headers.append("Cookie", cookie); + } + } + setCookiesToResult(result, cookies) { + if (result.multiValueHeaders) { + result.multiValueHeaders["set-cookie"] = cookies; + } else { + result.headers["set-cookie"] = cookies[0]; + } + } +} +const albProcessor = new ALBProcessor(); +class LatticeV2Processor extends EventProcessor { + getPath(event) { + return event.path; + } + getMethod(event) { + return event.method; + } + getQueryString() { + return ""; + } + getHeaders(event) { + const headers = new Headers(); + if (event.headers) { + for (const [k, values] of Object.entries(event.headers)) { + if (values) { + values.forEach((v) => headers.append(k, sanitizeHeaderValue(v))); + } + } + } + return headers; + } + getCookies() { + } + setCookiesToResult(result, cookies) { + result.headers = { + ...result.headers, + "set-cookie": cookies + }; + } +} +const latticeV2Processor = new LatticeV2Processor(); +const getProcessor = (event) => { + if (isProxyEventALB(event)) { + return albProcessor; + } + if (isProxyEventV2(event)) { + return v2Processor; + } + if (isLatticeEventV2(event)) { + return latticeV2Processor; + } + return v1Processor; +}; +const isProxyEventALB = (event) => { + if (event.requestContext) { + return Object.hasOwn(event.requestContext, "elb"); + } + return false; +}; +const isProxyEventV2 = (event) => { + return Object.hasOwn(event, "rawPath") && Object.hasOwn(event.requestContext ?? {}, "http"); +}; +const isLatticeEventV2 = (event) => { + if (event.requestContext) { + return Object.hasOwn(event.requestContext, "serviceArn"); + } + return false; +}; +const defaultIsContentTypeBinary = (contentType) => { + return !/^text\/(?:plain|html|css|javascript|csv)|(?:\/|\+)(?:json|xml)\s*(?:;|$)/.test( + contentType + ); +}; +const isContentEncodingBinary = (contentEncoding) => { + return !!contentEncoding && !/^identity$/i.test(contentEncoding); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ALBProcessor, + EventProcessor, + EventV1Processor, + EventV2Processor, + LatticeV2Processor, + defaultIsContentTypeBinary, + getProcessor, + handle, + isContentEncodingBinary, + streamHandle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js new file mode 100644 index 0000000000000000000000000000000000000000..adee13c7759e40ca51ac33adb85960d13d737d88 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js @@ -0,0 +1,34 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var aws_lambda_exports = {}; +__export(aws_lambda_exports, { + defaultIsContentTypeBinary: () => import_handler.defaultIsContentTypeBinary, + getConnInfo: () => import_conninfo.getConnInfo, + handle: () => import_handler.handle, + streamHandle: () => import_handler.streamHandle +}); +module.exports = __toCommonJS(aws_lambda_exports); +var import_handler = require("./handler"); +var import_conninfo = require("./conninfo"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + defaultIsContentTypeBinary, + getConnInfo, + handle, + streamHandle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js new file mode 100644 index 0000000000000000000000000000000000000000..81f4408be55bf33a4b69221862e2856a0c1dfa05 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/bun/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..35d1081ce84b86b010b91522bd3a51070e48a67a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/conninfo.js @@ -0,0 +1,49 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +var import_server = require("./server"); +const getConnInfo = (c) => { + const server = (0, import_server.getBunServer)(c); + if (!server) { + throw new TypeError("env has to include the 2nd argument of fetch."); + } + if (typeof server.requestIP !== "function") { + throw new TypeError("server.requestIP is not a function."); + } + const info = server.requestIP(c.req.raw); + if (!info) { + return { + remote: {} + }; + } + return { + remote: { + address: info.address, + addressType: info.family === "IPv6" || info.family === "IPv4" ? info.family : void 0, + port: info.port + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/bun/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a6ac430a617fa3ccccbd816e0cc6031f1a8cf6e1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/index.js @@ -0,0 +1,45 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var bun_exports = {}; +__export(bun_exports, { + bunFileSystemModule: () => import_ssg.bunFileSystemModule, + createBunWebSocket: () => import_websocket.createBunWebSocket, + getBunServer: () => import_server.getBunServer, + getConnInfo: () => import_conninfo.getConnInfo, + serveStatic: () => import_serve_static.serveStatic, + toSSG: () => import_ssg.toSSG, + upgradeWebSocket: () => import_websocket.upgradeWebSocket, + websocket: () => import_websocket.websocket +}); +module.exports = __toCommonJS(bun_exports); +var import_serve_static = require("./serve-static"); +var import_ssg = require("./ssg"); +var import_websocket = require("./websocket"); +var import_conninfo = require("./conninfo"); +var import_server = require("./server"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + bunFileSystemModule, + createBunWebSocket, + getBunServer, + getConnInfo, + serveStatic, + toSSG, + upgradeWebSocket, + websocket +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/bun/serve-static.js b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/serve-static.js new file mode 100644 index 0000000000000000000000000000000000000000..27405bb3f5c3c1c47bd6cc4c3aa10635831f62d2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/serve-static.js @@ -0,0 +1,52 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var serve_static_exports = {}; +__export(serve_static_exports, { + serveStatic: () => serveStatic +}); +module.exports = __toCommonJS(serve_static_exports); +var import_promises = require("node:fs/promises"); +var import_node_path = require("node:path"); +var import_serve_static = require("../../middleware/serve-static"); +const serveStatic = (options = {}) => { + return async function serveStatic2(c, next) { + const getContent = async (path) => { + const file = Bun.file(path); + return await file.exists() ? file : null; + }; + const isDir = async (path) => { + let isDir2; + try { + const stats = await (0, import_promises.stat)(path); + isDir2 = stats.isDirectory(); + } catch { + } + return isDir2; + }; + return (0, import_serve_static.serveStatic)({ + ...options, + getContent, + join: import_node_path.join, + isDir + })(c, next); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + serveStatic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/bun/server.js b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/server.js new file mode 100644 index 0000000000000000000000000000000000000000..8cef4db40c95a5e1ae4aed8fe9a0795a0994d0c1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/server.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var server_exports = {}; +__export(server_exports, { + getBunServer: () => getBunServer +}); +module.exports = __toCommonJS(server_exports); +const getBunServer = (c) => "server" in c.env ? c.env.server : c.env; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getBunServer +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/bun/ssg.js b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/ssg.js new file mode 100644 index 0000000000000000000000000000000000000000..52a1b896be2f7df199f271b17d917cda78f82d7f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/ssg.js @@ -0,0 +1,40 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ssg_exports = {}; +__export(ssg_exports, { + bunFileSystemModule: () => bunFileSystemModule, + toSSG: () => toSSG +}); +module.exports = __toCommonJS(ssg_exports); +var import_ssg = require("../../helper/ssg"); +const { write } = Bun; +const bunFileSystemModule = { + writeFile: async (path, data) => { + await write(path, data); + }, + mkdir: async () => { + } +}; +const toSSG = async (app, options) => { + return (0, import_ssg.toSSG)(app, bunFileSystemModule, options); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + bunFileSystemModule, + toSSG +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/bun/websocket.js b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/websocket.js new file mode 100644 index 0000000000000000000000000000000000000000..19d6d88fdaa4c09bb3579f2db14843f8ddbe4b53 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/bun/websocket.js @@ -0,0 +1,98 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var websocket_exports = {}; +__export(websocket_exports, { + createBunWebSocket: () => createBunWebSocket, + createWSContext: () => createWSContext, + upgradeWebSocket: () => upgradeWebSocket, + websocket: () => websocket +}); +module.exports = __toCommonJS(websocket_exports); +var import_websocket = require("../../helper/websocket"); +var import_server = require("./server"); +const createWSContext = (ws) => { + return new import_websocket.WSContext({ + send: (source, options) => { + ws.send(source, options?.compress); + }, + raw: ws, + readyState: ws.readyState, + url: ws.data.url, + protocol: ws.data.protocol, + close(code, reason) { + ws.close(code, reason); + } + }); +}; +const upgradeWebSocket = (0, import_websocket.defineWebSocketHelper)((c, events) => { + const server = (0, import_server.getBunServer)(c); + if (!server) { + throw new TypeError("env has to include the 2nd argument of fetch."); + } + const upgradeResult = server.upgrade(c.req.raw, { + data: { + events, + url: new URL(c.req.url), + // The first requested subprotocol, exposed via WSContext.protocol to + // match the deno and cloudflare adapters. + protocol: c.req.header("sec-websocket-protocol")?.split(",")[0]?.trim() ?? "" + } + }); + if (upgradeResult) { + return new Response(null); + } + return; +}); +const websocket = { + open(ws) { + const websocketListeners = ws.data.events; + if (websocketListeners.onOpen) { + websocketListeners.onOpen(new Event("open"), createWSContext(ws)); + } + }, + close(ws, code, reason) { + const websocketListeners = ws.data.events; + if (websocketListeners.onClose) { + websocketListeners.onClose( + new CloseEvent("close", { + code, + reason + }), + createWSContext(ws) + ); + } + }, + message(ws, message) { + const websocketListeners = ws.data.events; + if (websocketListeners.onMessage) { + const normalizedReceiveData = typeof message === "string" ? message : message.buffer; + websocketListeners.onMessage((0, import_websocket.createWSMessageEvent)(normalizedReceiveData), createWSContext(ws)); + } + } +}; +const createBunWebSocket = () => ({ + upgradeWebSocket, + websocket +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createBunWebSocket, + createWSContext, + upgradeWebSocket, + websocket +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..a04d7dbe82fd25b65eb1c920a4bde4e24ec0ecee --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js @@ -0,0 +1,31 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +const getConnInfo = (c) => ({ + remote: { + address: c.req.header("cf-connecting-ip") + } +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..c22ed9581654a447e7a254c4133bf1ba06bd2dd7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js @@ -0,0 +1,91 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var handler_exports = {}; +__export(handler_exports, { + handle: () => handle, + handleMiddleware: () => handleMiddleware, + serveStatic: () => serveStatic +}); +module.exports = __toCommonJS(handler_exports); +var import_context = require("../../context"); +var import_http_exception = require("../../http-exception"); +const handle = (app) => (eventContext) => { + return app.fetch( + eventContext.request, + { ...eventContext.env, eventContext }, + { + waitUntil: eventContext.waitUntil, + passThroughOnException: eventContext.passThroughOnException, + props: {} + } + ); +}; +function handleMiddleware(middleware) { + return async (executionCtx) => { + const context = new import_context.Context(executionCtx.request, { + env: { ...executionCtx.env, eventContext: executionCtx }, + executionCtx + }); + let response = void 0; + try { + response = await middleware(context, async () => { + try { + context.res = await executionCtx.next(); + } catch (error) { + if (error instanceof Error) { + context.error = error; + } else { + throw error; + } + } + }); + } catch (error) { + if (error instanceof Error) { + context.error = error; + } else { + throw error; + } + } + if (response) { + return response; + } + if (context.error instanceof import_http_exception.HTTPException) { + return context.error.getResponse(); + } + if (context.error) { + throw context.error; + } + return context.res; + }; +} +const serveStatic = () => { + return async (c) => { + const env = c.env; + const res = await env.ASSETS.fetch(c.req.raw); + if (res.status === 404) { + return c.notFound(); + } + return res; + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handle, + handleMiddleware, + serveStatic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js new file mode 100644 index 0000000000000000000000000000000000000000..74c5c6a37347f2c67b1a172058cfb993bb5b745d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js @@ -0,0 +1,34 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var cloudflare_pages_exports = {}; +__export(cloudflare_pages_exports, { + getConnInfo: () => import_conninfo.getConnInfo, + handle: () => import_handler.handle, + handleMiddleware: () => import_handler.handleMiddleware, + serveStatic: () => import_handler.serveStatic +}); +module.exports = __toCommonJS(cloudflare_pages_exports); +var import_handler = require("./handler"); +var import_conninfo = require("./conninfo"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo, + handle, + handleMiddleware, + serveStatic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..a04d7dbe82fd25b65eb1c920a4bde4e24ec0ecee --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js @@ -0,0 +1,31 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +const getConnInfo = (c) => ({ + remote: { + address: c.req.header("cf-connecting-ip") + } +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e61f043039d9a37b37cebf76e75a48baab550c19 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js @@ -0,0 +1,33 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var cloudflare_workers_exports = {}; +__export(cloudflare_workers_exports, { + getConnInfo: () => import_conninfo.getConnInfo, + serveStatic: () => import_serve_static_module.serveStatic, + upgradeWebSocket: () => import_websocket.upgradeWebSocket +}); +module.exports = __toCommonJS(cloudflare_workers_exports); +var import_serve_static_module = require("./serve-static-module"); +var import_websocket = require("./websocket"); +var import_conninfo = require("./conninfo"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo, + serveStatic, + upgradeWebSocket +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js new file mode 100644 index 0000000000000000000000000000000000000000..4c58b3ebaf5b37b417aa6f2fe18c804fff9effbf --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js @@ -0,0 +1,30 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var serve_static_module_exports = {}; +__export(serve_static_module_exports, { + serveStatic: () => module2 +}); +module.exports = __toCommonJS(serve_static_module_exports); +var import_serve_static = require("./serve-static"); +const module2 = (options) => { + return (0, import_serve_static.serveStatic)(options); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + serveStatic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js new file mode 100644 index 0000000000000000000000000000000000000000..b216c9312ed81cc1ddf6c92a79bcfd4d5d5a6448 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js @@ -0,0 +1,44 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var serve_static_exports = {}; +__export(serve_static_exports, { + serveStatic: () => serveStatic +}); +module.exports = __toCommonJS(serve_static_exports); +var import_serve_static = require("../../middleware/serve-static"); +var import_utils = require("./utils"); +const serveStatic = (options = {}) => { + return async function serveStatic2(c, next) { + const getContent = async (path) => { + return (0, import_utils.getContentFromKVAsset)(path, { + manifest: options.manifest, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + namespace: options.namespace ? options.namespace : c.env ? c.env.__STATIC_CONTENT : void 0 + }); + }; + return (0, import_serve_static.serveStatic)({ + ...options, + getContent + })(c, next); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + serveStatic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..30454563d31e336c7848fd0a1022ed8819919966 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js @@ -0,0 +1,57 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + getContentFromKVAsset: () => getContentFromKVAsset +}); +module.exports = __toCommonJS(utils_exports); +const getContentFromKVAsset = async (path, options) => { + let ASSET_MANIFEST; + if (options && options.manifest) { + if (typeof options.manifest === "string") { + ASSET_MANIFEST = JSON.parse(options.manifest); + } else { + ASSET_MANIFEST = options.manifest; + } + } else { + if (typeof __STATIC_CONTENT_MANIFEST === "string") { + ASSET_MANIFEST = JSON.parse(__STATIC_CONTENT_MANIFEST); + } else { + ASSET_MANIFEST = __STATIC_CONTENT_MANIFEST; + } + } + let ASSET_NAMESPACE; + if (options && options.namespace) { + ASSET_NAMESPACE = options.namespace; + } else { + ASSET_NAMESPACE = __STATIC_CONTENT; + } + const key = ASSET_MANIFEST[path]; + if (!key) { + return null; + } + const content = await ASSET_NAMESPACE.get(key, { type: "stream" }); + if (!content) { + return null; + } + return content; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getContentFromKVAsset +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js new file mode 100644 index 0000000000000000000000000000000000000000..1d703bb0109bb7124a578e84c206e4f07bf0456a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js @@ -0,0 +1,63 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var websocket_exports = {}; +__export(websocket_exports, { + upgradeWebSocket: () => upgradeWebSocket +}); +module.exports = __toCommonJS(websocket_exports); +var import_websocket = require("../../helper/websocket"); +const upgradeWebSocket = (0, import_websocket.defineWebSocketHelper)(async (c, events) => { + const upgradeHeader = c.req.header("Upgrade"); + if (upgradeHeader !== "websocket") { + return; + } + const webSocketPair = new WebSocketPair(); + const client = webSocketPair[0]; + const server = webSocketPair[1]; + const wsContext = new import_websocket.WSContext({ + close: (code, reason) => server.close(code, reason), + get protocol() { + return server.protocol; + }, + raw: server, + get readyState() { + return server.readyState; + }, + url: server.url ? new URL(server.url) : null, + send: (source) => server.send(source) + }); + if (events.onClose) { + server.addEventListener("close", (evt) => events.onClose?.(evt, wsContext)); + } + if (events.onMessage) { + server.addEventListener("message", (evt) => events.onMessage?.(evt, wsContext)); + } + if (events.onError) { + server.addEventListener("error", (evt) => events.onError?.(evt, wsContext)); + } + server.accept?.(); + return new Response(null, { + status: 101, + // @ts-expect-error - webSocket is not typed + webSocket: client + }); +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + upgradeWebSocket +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/deno/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..c5049743d1c71ec59e7bd96c7674d280db892a1c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/conninfo.js @@ -0,0 +1,36 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +const getConnInfo = (c) => { + const { remoteAddr } = c.env; + return { + remote: { + address: remoteAddr.hostname, + port: remoteAddr.port, + transport: remoteAddr.transport + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/deno/deno.d.js b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/deno.d.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/deno/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9add914c0d2c4a8f8131594839f3dcec8927825c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/index.js @@ -0,0 +1,38 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var deno_exports = {}; +__export(deno_exports, { + denoFileSystemModule: () => import_ssg.denoFileSystemModule, + getConnInfo: () => import_conninfo.getConnInfo, + serveStatic: () => import_serve_static.serveStatic, + toSSG: () => import_ssg.toSSG, + upgradeWebSocket: () => import_websocket.upgradeWebSocket +}); +module.exports = __toCommonJS(deno_exports); +var import_serve_static = require("./serve-static"); +var import_ssg = require("./ssg"); +var import_websocket = require("./websocket"); +var import_conninfo = require("./conninfo"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + denoFileSystemModule, + getConnInfo, + serveStatic, + toSSG, + upgradeWebSocket +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/deno/serve-static.js b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/serve-static.js new file mode 100644 index 0000000000000000000000000000000000000000..a40c3713d58f6306debd9cc9d62e9e9a90a6702d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/serve-static.js @@ -0,0 +1,62 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var serve_static_exports = {}; +__export(serve_static_exports, { + serveStatic: () => serveStatic +}); +module.exports = __toCommonJS(serve_static_exports); +var import_node_path = require("node:path"); +var import_serve_static = require("../../middleware/serve-static"); +const { open, lstatSync, errors } = Deno; +const serveStatic = (options = {}) => { + return async function serveStatic2(c, next) { + const getContent = async (path) => { + try { + if (isDir(path)) { + return null; + } + const file = await open(path); + return file.readable; + } catch (e) { + if (!(e instanceof errors.NotFound)) { + console.warn(`${e}`); + } + return null; + } + }; + const isDir = (path) => { + let isDir2; + try { + const stat = lstatSync(path); + isDir2 = stat.isDirectory; + } catch { + } + return isDir2; + }; + return (0, import_serve_static.serveStatic)({ + ...options, + getContent, + join: import_node_path.join, + isDir + })(c, next); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + serveStatic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/deno/ssg.js b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/ssg.js new file mode 100644 index 0000000000000000000000000000000000000000..d4b97bdbd270dfff1b7ca1a42a0ae468b8b33a03 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/ssg.js @@ -0,0 +1,41 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ssg_exports = {}; +__export(ssg_exports, { + denoFileSystemModule: () => denoFileSystemModule, + toSSG: () => toSSG +}); +module.exports = __toCommonJS(ssg_exports); +var import_ssg = require("../../helper/ssg/index"); +const denoFileSystemModule = { + writeFile: async (path, data) => { + const uint8Data = typeof data === "string" ? new TextEncoder().encode(data) : new Uint8Array(data); + await Deno.writeFile(path, uint8Data); + }, + mkdir: async (path, options) => { + return Deno.mkdir(path, { recursive: options?.recursive ?? false }); + } +}; +const toSSG = async (app, options) => { + return (0, import_ssg.toSSG)(app, denoFileSystemModule, options); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + denoFileSystemModule, + toSSG +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/deno/websocket.js b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/websocket.js new file mode 100644 index 0000000000000000000000000000000000000000..f2606908e3668057a058e55f916b812c2d183f9c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/deno/websocket.js @@ -0,0 +1,54 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var websocket_exports = {}; +__export(websocket_exports, { + upgradeWebSocket: () => upgradeWebSocket +}); +module.exports = __toCommonJS(websocket_exports); +var import_websocket = require("../../helper/websocket"); +const upgradeWebSocket = (0, import_websocket.defineWebSocketHelper)(async (c, events, options) => { + if (c.req.header("upgrade") !== "websocket") { + return; + } + const subprotocol = c.req.header("sec-websocket-protocol")?.split(",")[0]?.trim(); + const { response, socket } = Deno.upgradeWebSocket(c.req.raw, { + ...subprotocol ? { protocol: subprotocol } : {}, + ...options + }); + const wsContext = new import_websocket.WSContext({ + close: (code, reason) => socket.close(code, reason), + get protocol() { + return socket.protocol; + }, + raw: socket, + get readyState() { + return socket.readyState; + }, + url: socket.url ? new URL(socket.url) : null, + send: (source) => socket.send(source) + }); + socket.onopen = (evt) => events.onOpen?.(evt, wsContext); + socket.onmessage = (evt) => events.onMessage?.(evt, wsContext); + socket.onclose = (evt) => events.onClose?.(evt, wsContext); + socket.onerror = (evt) => events.onError?.(evt, wsContext); + return response; +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + upgradeWebSocket +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..755482fa0eb7b55851a723ea6fffc539e8121bc4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js @@ -0,0 +1,31 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +const getConnInfo = (c) => ({ + remote: { + address: c.env.event.Records[0].cf.request.clientIp + } +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js b/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..15eefbf72717009ff9583ef2bf22a7dd5a438269 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js @@ -0,0 +1,130 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var handler_exports = {}; +__export(handler_exports, { + createBody: () => createBody, + handle: () => handle, + isContentTypeBinary: () => isContentTypeBinary +}); +module.exports = __toCommonJS(handler_exports); +var import_node_crypto = __toESM(require("node:crypto"), 1); +var import_encode = require("../../utils/encode"); +globalThis.crypto ??= import_node_crypto.default; +const convertHeaders = (headers) => { + const cfHeaders = {}; + headers.forEach((value, key) => { + cfHeaders[key.toLowerCase()] = [ + ...cfHeaders[key.toLowerCase()] || [], + { key: key.toLowerCase(), value } + ]; + }); + return cfHeaders; +}; +const handle = (app) => { + return async (event, ...args) => { + const [context, callback] = args; + let callbackError = null; + let callbackResult; + const res = await app.fetch(createRequest(event), { + event, + context, + callback: (err, result) => { + if (!callbackError && !callbackResult) { + callbackError = err; + callbackResult = result; + } + callback?.(err, result); + }, + config: event.Records[0].cf.config, + request: event.Records[0].cf.request, + response: event.Records[0].cf.response + }); + if (callbackError) { + throw callbackError; + } + return callbackResult ?? createResult(res); + }; +}; +const createResult = async (res) => { + const contentEncoding = res.headers.get("content-encoding"); + const isBase64Encoded = isContentTypeBinary(res.headers.get("content-type") || "") || !!contentEncoding && !/^identity$/i.test(contentEncoding); + const body = isBase64Encoded ? (0, import_encode.encodeBase64)(await res.arrayBuffer()) : await res.text(); + return { + status: res.status.toString(), + headers: convertHeaders(res.headers), + body, + ...isBase64Encoded && { bodyEncoding: "base64" } + }; +}; +const createRequest = (event) => { + const queryString = event.Records[0].cf.request.querystring; + const host = event.Records[0].cf.request.headers?.host?.[0]?.value || event.Records[0].cf.config.distributionDomainName; + const urlPath = `https://${host}${event.Records[0].cf.request.uri}`; + const url = queryString ? `${urlPath}?${queryString}` : urlPath; + const headers = new Headers(); + Object.entries(event.Records[0].cf.request.headers).forEach(([k, v]) => { + v.forEach((header) => headers.append(k, header.value)); + }); + const requestBody = event.Records[0].cf.request.body; + const method = event.Records[0].cf.request.method; + const rawBody = createBody(method, requestBody); + let body = rawBody; + if (rawBody !== void 0) { + const bytes = typeof rawBody === "string" ? new TextEncoder().encode(rawBody) : rawBody; + body = bytes; + headers.set("content-length", bytes.length.toString()); + } + return new Request(url, { + headers, + method, + body + }); +}; +const createBody = (method, requestBody) => { + if (!requestBody || !requestBody.data) { + return void 0; + } + if (method === "GET" || method === "HEAD") { + return void 0; + } + if (requestBody.encoding === "base64") { + return (0, import_encode.decodeBase64)(requestBody.data); + } + return requestBody.data; +}; +const isContentTypeBinary = (contentType) => { + return !/^(text\/(plain|html|css|javascript|csv).*|application\/(.*json|.*xml).*|image\/svg\+xml.*)$/.test( + contentType + ); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createBody, + handle, + isContentTypeBinary +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cd37b22ddb153db881dd5e9173db7e47f9b28d3d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js @@ -0,0 +1,30 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var lambda_edge_exports = {}; +__export(lambda_edge_exports, { + getConnInfo: () => import_conninfo.getConnInfo, + handle: () => import_handler.handle +}); +module.exports = __toCommonJS(lambda_edge_exports); +var import_handler = require("./handler"); +var import_conninfo = require("./conninfo"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo, + handle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..f4ec4ffd779f6b0e821b3c81dfafad8d8f5d4927 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js @@ -0,0 +1,31 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +const getConnInfo = (c) => ({ + remote: { + address: c.env.context?.ip + } +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/handler.js b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..80596ceeb2c62f2121e77f83e0b0e2af20753ad3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/handler.js @@ -0,0 +1,31 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var handler_exports = {}; +__export(handler_exports, { + handle: () => handle +}); +module.exports = __toCommonJS(handler_exports); +const handle = (app) => { + return (req, context) => { + return app.fetch(req, { context }); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0417facab8b67da74e7f3b240a5229377122bd4d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/index.js @@ -0,0 +1,21 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var netlify_exports = {}; +module.exports = __toCommonJS(netlify_exports); +__reExport(netlify_exports, require("./mod"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ...require("./mod") +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/mod.js b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/mod.js new file mode 100644 index 0000000000000000000000000000000000000000..93a5e05e22a0e2fea838aaaae8e8254ff5360458 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/netlify/mod.js @@ -0,0 +1,30 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var mod_exports = {}; +__export(mod_exports, { + getConnInfo: () => import_conninfo.getConnInfo, + handle: () => import_handler.handle +}); +module.exports = __toCommonJS(mod_exports); +var import_handler = require("./handler"); +var import_conninfo = require("./conninfo"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo, + handle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/handler.js b/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..5a9479b840fcb596ddf1cb8a2dcf5f84bcf59435 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/handler.js @@ -0,0 +1,42 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var handler_exports = {}; +__export(handler_exports, { + handle: () => handle +}); +module.exports = __toCommonJS(handler_exports); +const handle = (app, opts = { + // To use `fetch` on a Service Worker correctly, bind it to `globalThis`. + fetch: globalThis.fetch.bind(globalThis) +}) => { + return (evt) => { + evt.respondWith( + (async () => { + const res = await app.fetch(evt.request, {}, evt); + if (opts.fetch && res.status === 404) { + return await opts.fetch(evt.request); + } + return res; + })() + ); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5a42ab78d7315067fd31df0b30954649c82d0995 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/index.js @@ -0,0 +1,32 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var service_worker_exports = {}; +__export(service_worker_exports, { + fire: () => fire, + handle: () => import_handler.handle +}); +module.exports = __toCommonJS(service_worker_exports); +var import_handler = require("./handler"); +const fire = (app, options) => { + addEventListener("fetch", (0, import_handler.handle)(app, options)); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + fire, + handle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/types.js b/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/types.js new file mode 100644 index 0000000000000000000000000000000000000000..81f4408be55bf33a4b69221862e2856a0c1dfa05 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/service-worker/types.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js b/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js new file mode 100644 index 0000000000000000000000000000000000000000..18ba2135f98877b8937ef344c77808b6827da9e2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js @@ -0,0 +1,32 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +__export(conninfo_exports, { + getConnInfo: () => getConnInfo +}); +module.exports = __toCommonJS(conninfo_exports); +const getConnInfo = (c) => ({ + remote: { + // https://github.com/vercel/vercel/blob/b70bfb5fbf28a4650d4042ce68ca5c636d37cf44/packages/edge/src/edge-headers.ts#L10-L12C32 + address: c.req.header("x-real-ip") + } +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/handler.js b/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..15db3a29da9f7c575aa14a4bd064a86162296c7c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/handler.js @@ -0,0 +1,29 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var handler_exports = {}; +__export(handler_exports, { + handle: () => handle +}); +module.exports = __toCommonJS(handler_exports); +const handle = (app) => (req) => { + return app.fetch(req); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/index.js b/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ce6344e0c400d17da13a8004a309a69d58ae36a7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/adapter/vercel/index.js @@ -0,0 +1,30 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var vercel_exports = {}; +__export(vercel_exports, { + getConnInfo: () => import_conninfo.getConnInfo, + handle: () => import_handler.handle +}); +module.exports = __toCommonJS(vercel_exports); +var import_handler = require("./handler"); +var import_conninfo = require("./conninfo"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getConnInfo, + handle +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/client/client.js b/tools/ui/node_modules/hono/dist/cjs/client/client.js new file mode 100644 index 0000000000000000000000000000000000000000..36b145c0f524873d9e974d6bbb0ef0b34784fc51 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/client/client.js @@ -0,0 +1,204 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var client_exports = {}; +__export(client_exports, { + hc: () => hc +}); +module.exports = __toCommonJS(client_exports); +var import_cookie = require("../utils/cookie"); +var import_utils = require("./utils"); +const createProxy = (callback, path) => { + const proxy = new Proxy(() => { + }, { + get(_obj, key) { + if (typeof key !== "string" || key === "then") { + return void 0; + } + return createProxy(callback, [...path, key]); + }, + apply(_1, _2, args) { + return callback({ + path, + args + }); + } + }); + return proxy; +}; +class ClientRequestImpl { + url; + method; + buildSearchParams; + queryParams = void 0; + pathParams = {}; + rBody; + cType = void 0; + constructor(url, method, options) { + this.url = url; + this.method = method; + this.buildSearchParams = options.buildSearchParams; + } + fetch = async (args, opt) => { + if (args) { + if (args.query) { + this.queryParams = this.buildSearchParams(args.query); + } + if (args.form) { + const form = new FormData(); + for (const [k, v] of Object.entries(args.form)) { + if (v === void 0) { + continue; + } + if (Array.isArray(v)) { + for (const v2 of v) { + form.append(k, v2); + } + } else { + form.append(k, v); + } + } + this.rBody = form; + } + if (args.json) { + this.rBody = JSON.stringify(args.json); + this.cType = "application/json"; + } + if (args.param) { + this.pathParams = args.param; + } + } + let methodUpperCase = this.method.toUpperCase(); + const headerValues = { + ...args?.header, + ...typeof opt?.headers === "function" ? await opt.headers() : opt?.headers + }; + if (args?.cookie) { + const cookies = []; + for (const [key, value] of Object.entries(args.cookie)) { + cookies.push((0, import_cookie.serialize)(key, value, { path: "/" })); + } + headerValues["Cookie"] = cookies.join(","); + } + if (this.cType) { + headerValues["Content-Type"] = this.cType; + } + const headers = new Headers(headerValues ?? void 0); + let url = this.url; + url = (0, import_utils.removeIndexString)(url); + url = (0, import_utils.replaceUrlParam)(url, this.pathParams); + if (this.queryParams) { + url = url + "?" + this.queryParams.toString(); + } + methodUpperCase = this.method.toUpperCase(); + const setBody = !(methodUpperCase === "GET" || methodUpperCase === "HEAD"); + return (opt?.fetch || fetch)(url, { + body: setBody ? this.rBody : void 0, + method: methodUpperCase, + headers, + ...opt?.init + }); + }; +} +const hc = (baseUrl, options) => createProxy(function proxyCallback(opts) { + const buildSearchParamsOption = options?.buildSearchParams ?? import_utils.buildSearchParams; + const parts = [...opts.path]; + const lastParts = parts.slice(-3).reverse(); + if (lastParts[0] === "toString") { + if (lastParts[1] === "name") { + return lastParts[2] || ""; + } + return proxyCallback.toString(); + } + if (lastParts[0] === "valueOf") { + if (lastParts[1] === "name") { + return lastParts[2] || ""; + } + return proxyCallback; + } + let method = ""; + if (/^\$/.test(lastParts[0])) { + const last = parts.pop(); + if (last) { + method = last.replace(/^\$/, ""); + } + } + const path = parts.join("/"); + const url = (0, import_utils.mergePath)(baseUrl, path); + if (method === "url" || method === "path") { + let result = url; + if (opts.args[0]) { + if (opts.args[0].param) { + result = (0, import_utils.replaceUrlParam)(url, opts.args[0].param); + } + if (opts.args[0].query) { + result = result + "?" + buildSearchParamsOption(opts.args[0].query).toString(); + } + } + result = (0, import_utils.removeIndexString)(result); + if (method === "url") { + return new URL(result); + } + return result.slice(baseUrl.replace(/\/+$/, "").length).replace(/^\/?/, "/"); + } + if (method === "ws") { + const webSocketUrl = (0, import_utils.replaceUrlProtocol)( + opts.args[0] && opts.args[0].param ? (0, import_utils.replaceUrlParam)(url, opts.args[0].param) : url, + "ws" + ); + const targetUrl = new URL(webSocketUrl); + const queryParams = opts.args[0]?.query; + if (queryParams) { + Object.entries(queryParams).forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach((item) => targetUrl.searchParams.append(key, item)); + } else { + targetUrl.searchParams.set(key, value); + } + }); + } + const establishWebSocket = (...args) => { + if (options?.webSocket !== void 0 && typeof options.webSocket === "function") { + return options.webSocket(...args); + } + return new WebSocket(...args); + }; + return establishWebSocket(targetUrl.toString()); + } + const req = new ClientRequestImpl(url, method, { + buildSearchParams: buildSearchParamsOption + }); + if (method) { + options ??= {}; + const reqOptions = { ...opts.args[1] }; + const baseHeaders = options.headers; + const reqHeaders = reqOptions.headers; + if (baseHeaders && reqHeaders) { + reqOptions.headers = async () => ({ + ...typeof baseHeaders === "function" ? await baseHeaders() : baseHeaders, + ...typeof reqHeaders === "function" ? await reqHeaders() : reqHeaders + }); + } + const args = (0, import_utils.deepMerge)(options, reqOptions); + return req.fetch(opts.args[0], args); + } + return req; +}, []); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + hc +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/client/fetch-result-please.js b/tools/ui/node_modules/hono/dist/cjs/client/fetch-result-please.js new file mode 100644 index 0000000000000000000000000000000000000000..d5ca0c42956229dc02eafc7a4bdfef0ac756aa56 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/client/fetch-result-please.js @@ -0,0 +1,85 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var fetch_result_please_exports = {}; +__export(fetch_result_please_exports, { + DetailedError: () => DetailedError, + fetchRP: () => fetchRP +}); +module.exports = __toCommonJS(fetch_result_please_exports); +const nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]); +async function fetchRP(fetchRes) { + const _fetchRes = await fetchRes; + const hasBody = (_fetchRes.body || _fetchRes._bodyInit) && !nullBodyResponses.has(_fetchRes.status); + if (hasBody) { + const responseType = detectResponseType(_fetchRes); + _fetchRes._data = await _fetchRes[responseType](); + } + if (!_fetchRes.ok) { + throw new DetailedError(`${_fetchRes.status} ${_fetchRes.statusText}`, { + statusCode: _fetchRes?.status, + detail: { + data: _fetchRes?._data, + statusText: _fetchRes?.statusText + } + }); + } + return _fetchRes._data; +} +class DetailedError extends Error { + /** + * Additional `message` that will be logged AND returned to client + */ + detail; + /** + * Additional `code` that will be logged AND returned to client + */ + code; + /** + * Additional value that will be logged AND NOT returned to client + */ + log; + /** + * Optionally set the status code to return, in a web server context + */ + statusCode; + constructor(message, options = {}) { + super(message); + this.name = "DetailedError"; + this.log = options.log; + this.detail = options.detail; + this.code = options.code; + this.statusCode = options.statusCode; + } +} +const jsonRegex = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(?:;.+)?$/i; +function detectResponseType(response) { + const _contentType = response.headers.get("content-type"); + if (!_contentType) { + return "text"; + } + const contentType = _contentType.split(";").shift(); + if (jsonRegex.test(contentType)) { + return "json"; + } + return "text"; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + DetailedError, + fetchRP +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/client/index.js b/tools/ui/node_modules/hono/dist/cjs/client/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c4b3290a3e4a13809c2e338143b04e6ab3f10064 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/client/index.js @@ -0,0 +1,32 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var client_exports = {}; +__export(client_exports, { + DetailedError: () => import_utils.DetailedError, + hc: () => import_client.hc, + parseResponse: () => import_utils.parseResponse +}); +module.exports = __toCommonJS(client_exports); +var import_client = require("./client"); +var import_utils = require("./utils"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + DetailedError, + hc, + parseResponse +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/client/types.js b/tools/ui/node_modules/hono/dist/cjs/client/types.js new file mode 100644 index 0000000000000000000000000000000000000000..81f4408be55bf33a4b69221862e2856a0c1dfa05 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/client/types.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/client/utils.js b/tools/ui/node_modules/hono/dist/cjs/client/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..f3316f7a20daf3bc938550e7eb81116734d08c8b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/client/utils.js @@ -0,0 +1,105 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + DetailedError: () => import_fetch_result_please.DetailedError, + buildSearchParams: () => buildSearchParams, + deepMerge: () => deepMerge, + mergePath: () => mergePath, + parseResponse: () => parseResponse, + removeIndexString: () => removeIndexString, + replaceUrlParam: () => replaceUrlParam, + replaceUrlProtocol: () => replaceUrlProtocol +}); +module.exports = __toCommonJS(utils_exports); +var import_fetch_result_please = require("./fetch-result-please"); +const mergePath = (base, path) => { + base = base.replace(/\/+$/, ""); + base = base + "/"; + path = path.replace(/^\/+/, ""); + return base + path; +}; +const replaceUrlParam = (urlString, params) => { + for (const [k, v] of Object.entries(params)) { + const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)"); + urlString = urlString.replace(reg, v ? `/${v}` : ""); + } + return urlString; +}; +const buildSearchParams = (query) => { + const searchParams = new URLSearchParams(); + for (const [k, v] of Object.entries(query)) { + if (v === void 0) { + continue; + } + if (Array.isArray(v)) { + for (const v2 of v) { + searchParams.append(k, v2); + } + } else { + searchParams.set(k, v); + } + } + return searchParams; +}; +const replaceUrlProtocol = (urlString, protocol) => { + switch (protocol) { + case "ws": + return urlString.replace(/^http/, "ws"); + case "http": + return urlString.replace(/^ws/, "http"); + } +}; +const removeIndexString = (urlString) => { + if (/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(urlString)) { + return urlString.replace(/\/index(?=\?|$)/, "/"); + } + return urlString.replace(/\/index(?=\?|$)/, ""); +}; +function isObject(item) { + return typeof item === "object" && item !== null && !Array.isArray(item); +} +function deepMerge(target, source) { + if (!isObject(target) && !isObject(source)) { + return source; + } + const merged = { ...target }; + for (const key in source) { + const value = source[key]; + if (isObject(merged[key]) && isObject(value)) { + merged[key] = deepMerge(merged[key], value); + } else { + merged[key] = value; + } + } + return merged; +} +async function parseResponse(fetchRes) { + return (0, import_fetch_result_please.fetchRP)(fetchRes); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + DetailedError, + buildSearchParams, + deepMerge, + mergePath, + parseResponse, + removeIndexString, + replaceUrlParam, + replaceUrlProtocol +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/compose.js b/tools/ui/node_modules/hono/dist/cjs/compose.js new file mode 100644 index 0000000000000000000000000000000000000000..392c30f8121480a41e1a0f0d1afab90319a6eeed --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/compose.js @@ -0,0 +1,68 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var compose_exports = {}; +__export(compose_exports, { + compose: () => compose +}); +module.exports = __toCommonJS(compose_exports); +const compose = (middleware, onError, onNotFound) => { + return (context, next) => { + let index = -1; + return dispatch(0); + async function dispatch(i) { + if (i <= index) { + throw new Error("next() called multiple times"); + } + index = i; + let res; + let isError = false; + let handler; + if (middleware[i]) { + handler = middleware[i][0][0]; + context.req.routeIndex = i; + } else { + handler = i === middleware.length && next || void 0; + } + if (handler) { + try { + res = await handler(context, () => dispatch(i + 1)); + } catch (err) { + if (err instanceof Error && onError) { + context.error = err; + res = await onError(err, context); + isError = true; + } else { + throw err; + } + } + } else { + if (context.finalized === false && onNotFound) { + res = await onNotFound(context); + } + } + if (res && (context.finalized === false || isError)) { + context.res = res; + } + return context; + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + compose +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/context.js b/tools/ui/node_modules/hono/dist/cjs/context.js new file mode 100644 index 0000000000000000000000000000000000000000..b63ae3f04340694826164217689d8bd14955e3a1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/context.js @@ -0,0 +1,450 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var context_exports = {}; +__export(context_exports, { + Context: () => Context, + TEXT_PLAIN: () => TEXT_PLAIN +}); +module.exports = __toCommonJS(context_exports); +var import_request = require("./request"); +var import_html = require("./utils/html"); +const TEXT_PLAIN = "text/plain; charset=UTF-8"; +const setDefaultContentType = (contentType, headers) => { + return { + "Content-Type": contentType, + ...headers + }; +}; +const createResponseInstance = (body, init) => new Response(body, init); +class Context { + #rawRequest; + #req; + /** + * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers. + * + * @see {@link https://hono.dev/docs/api/context#env} + * + * @example + * ```ts + * // Environment object for Cloudflare Workers + * app.get('*', async c => { + * const counter = c.env.COUNTER + * }) + * ``` + */ + env = {}; + #var; + finalized = false; + /** + * `.error` can get the error object from the middleware if the Handler throws an error. + * + * @see {@link https://hono.dev/docs/api/context#error} + * + * @example + * ```ts + * app.use('*', async (c, next) => { + * await next() + * if (c.error) { + * // do something... + * } + * }) + * ``` + */ + error; + #status; + #executionCtx; + #res; + #layout; + #renderer; + #notFoundHandler; + #preparedHeaders; + #matchResult; + #path; + /** + * Creates an instance of the Context class. + * + * @param req - The Request object. + * @param options - Optional configuration options for the context. + */ + constructor(req, options) { + this.#rawRequest = req; + if (options) { + this.#executionCtx = options.executionCtx; + this.env = options.env; + this.#notFoundHandler = options.notFoundHandler; + this.#path = options.path; + this.#matchResult = options.matchResult; + } + } + /** + * `.req` is the instance of {@link HonoRequest}. + */ + get req() { + this.#req ??= new import_request.HonoRequest(this.#rawRequest, this.#path, this.#matchResult); + return this.#req; + } + /** + * @see {@link https://hono.dev/docs/api/context#event} + * The FetchEvent associated with the current request. + * + * @throws Will throw an error if the context does not have a FetchEvent. + */ + get event() { + if (this.#executionCtx && "respondWith" in this.#executionCtx) { + return this.#executionCtx; + } else { + throw Error("This context has no FetchEvent"); + } + } + /** + * @see {@link https://hono.dev/docs/api/context#executionctx} + * The ExecutionContext associated with the current request. + * + * @throws Will throw an error if the context does not have an ExecutionContext. + */ + get executionCtx() { + if (this.#executionCtx) { + return this.#executionCtx; + } else { + throw Error("This context has no ExecutionContext"); + } + } + /** + * @see {@link https://hono.dev/docs/api/context#res} + * The Response object for the current request. + */ + get res() { + return this.#res ||= createResponseInstance(null, { + headers: this.#preparedHeaders ??= new Headers() + }); + } + /** + * Sets the Response object for the current request. + * + * @param _res - The Response object to set. + */ + set res(_res) { + if (this.#res && _res) { + _res = createResponseInstance(_res.body, _res); + for (const [k, v] of this.#res.headers.entries()) { + if (k === "content-type") { + continue; + } + if (k === "set-cookie") { + const cookies = this.#res.headers.getSetCookie(); + _res.headers.delete("set-cookie"); + for (const cookie of cookies) { + _res.headers.append("set-cookie", cookie); + } + } else { + _res.headers.set(k, v); + } + } + } + this.#res = _res; + this.finalized = true; + } + /** + * `.render()` can create a response within a layout. + * + * @see {@link https://hono.dev/docs/api/context#render-setrenderer} + * + * @example + * ```ts + * app.get('/', (c) => { + * return c.render('Hello!') + * }) + * ``` + */ + render = (...args) => { + this.#renderer ??= (content) => this.html(content); + return this.#renderer(...args); + }; + /** + * Sets the layout for the response. + * + * @param layout - The layout to set. + * @returns The layout function. + */ + setLayout = (layout) => this.#layout = layout; + /** + * Gets the current layout for the response. + * + * @returns The current layout function. + */ + getLayout = () => this.#layout; + /** + * `.setRenderer()` can set the layout in the custom middleware. + * + * @see {@link https://hono.dev/docs/api/context#render-setrenderer} + * + * @example + * ```tsx + * app.use('*', async (c, next) => { + * c.setRenderer((content) => { + * return c.html( + * + * + *

{content}

+ * + * + * ) + * }) + * await next() + * }) + * ``` + */ + setRenderer = (renderer) => { + this.#renderer = renderer; + }; + /** + * `.header()` can set headers. + * + * @see {@link https://hono.dev/docs/api/context#header} + * + * @example + * ```ts + * app.get('/welcome', (c) => { + * // Set headers + * c.header('X-Message', 'Hello!') + * c.header('Content-Type', 'text/plain') + * + * return c.body('Thank you for coming') + * }) + * ``` + */ + header = (name, value, options) => { + if (this.finalized) { + this.#res = createResponseInstance(this.#res.body, this.#res); + } + const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers(); + if (value === void 0) { + headers.delete(name); + } else if (options?.append) { + headers.append(name, value); + } else { + headers.set(name, value); + } + }; + status = (status) => { + this.#status = status; + }; + /** + * `.set()` can set the value specified by the key. + * + * @see {@link https://hono.dev/docs/api/context#set-get} + * + * @example + * ```ts + * app.use('*', async (c, next) => { + * c.set('message', 'Hono is hot!!') + * await next() + * }) + * ``` + */ + set = (key, value) => { + this.#var ??= /* @__PURE__ */ new Map(); + this.#var.set(key, value); + }; + /** + * `.get()` can use the value specified by the key. + * + * @see {@link https://hono.dev/docs/api/context#set-get} + * + * @example + * ```ts + * app.get('/', (c) => { + * const message = c.get('message') + * return c.text(`The message is "${message}"`) + * }) + * ``` + */ + get = (key) => { + return this.#var ? this.#var.get(key) : void 0; + }; + /** + * `.var` can access the value of a variable. + * + * @see {@link https://hono.dev/docs/api/context#var} + * + * @example + * ```ts + * const result = c.var.client.oneMethod() + * ``` + */ + // c.var.propName is a read-only + get var() { + if (!this.#var) { + return {}; + } + return Object.fromEntries(this.#var); + } + #newResponse(data, arg, headers) { + let responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders; + if (typeof arg === "object" && arg.headers) { + responseHeaders ??= new Headers(); + for (const [key, value] of new Headers(arg.headers)) { + if (key === "set-cookie") { + responseHeaders.append(key, value); + } else { + responseHeaders.set(key, value); + } + } + } + if (headers) { + if (!responseHeaders) { + let count = 0; + for (const k in headers) { + if (++count > 1 || typeof headers[k] !== "string") { + responseHeaders = new Headers(); + break; + } + } + } + if (responseHeaders) { + for (const k in headers) { + const v = headers[k]; + if (typeof v === "string") { + responseHeaders.set(k, v); + } else { + responseHeaders.delete(k); + for (const v2 of v) { + responseHeaders.append(k, v2); + } + } + } + } + } + const status = typeof arg === "number" ? arg : arg?.status ?? this.#status; + return createResponseInstance(data, { + status, + headers: responseHeaders ?? headers + }); + } + newResponse = (...args) => this.#newResponse(...args); + /** + * `.body()` can return the HTTP response. + * You can set headers with `.header()` and set HTTP status code with `.status`. + * This can also be set in `.text()`, `.json()` and so on. + * + * @see {@link https://hono.dev/docs/api/context#body} + * + * @example + * ```ts + * app.get('/welcome', (c) => { + * // Set headers + * c.header('X-Message', 'Hello!') + * c.header('Content-Type', 'text/plain') + * // Set HTTP status code + * c.status(201) + * + * // Return the response body + * return c.body('Thank you for coming') + * }) + * ``` + */ + body = (data, arg, headers) => this.#newResponse(data, arg, headers); + /** + * `.text()` can render text as `Content-Type:text/plain`. + * + * @see {@link https://hono.dev/docs/api/context#text} + * + * @example + * ```ts + * app.get('/say', (c) => { + * return c.text('Hello!') + * }) + * ``` + */ + text = (text, arg, headers) => { + return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse( + text, + arg, + setDefaultContentType(TEXT_PLAIN, headers) + ); + }; + /** + * `.json()` can render JSON as `Content-Type:application/json`. + * + * @see {@link https://hono.dev/docs/api/context#json} + * + * @example + * ```ts + * app.get('/api', (c) => { + * return c.json({ message: 'Hello!' }) + * }) + * ``` + */ + json = (object, arg, headers) => { + return this.#newResponse( + JSON.stringify(object), + arg, + setDefaultContentType("application/json", headers) + ); + }; + html = (html, arg, headers) => { + const res = (html2) => this.#newResponse(html2, arg, setDefaultContentType("text/html; charset=UTF-8", headers)); + return typeof html === "object" ? (0, import_html.resolveCallback)(html, import_html.HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html); + }; + /** + * `.redirect()` can Redirect, default status code is 302. + * + * @see {@link https://hono.dev/docs/api/context#redirect} + * + * @example + * ```ts + * app.get('/redirect', (c) => { + * return c.redirect('/') + * }) + * app.get('/redirect-permanently', (c) => { + * return c.redirect('/', 301) + * }) + * ``` + */ + redirect = (location, status) => { + const locationString = String(location); + this.header( + "Location", + // Multibyes should be encoded + // eslint-disable-next-line no-control-regex + !/[^\x00-\xFF]/.test(locationString) ? locationString : encodeURI(locationString) + ); + return this.newResponse(null, status ?? 302); + }; + /** + * `.notFound()` can return the Not Found Response. + * + * @see {@link https://hono.dev/docs/api/context#notfound} + * + * @example + * ```ts + * app.get('/notfound', (c) => { + * return c.notFound() + * }) + * ``` + */ + notFound = () => { + this.#notFoundHandler ??= () => createResponseInstance(); + return this.#notFoundHandler(this); + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Context, + TEXT_PLAIN +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/accepts/accepts.js b/tools/ui/node_modules/hono/dist/cjs/helper/accepts/accepts.js new file mode 100644 index 0000000000000000000000000000000000000000..148fe2d1c0d760146f054d76d5485065fb9fe1a9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/accepts/accepts.js @@ -0,0 +1,43 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var accepts_exports = {}; +__export(accepts_exports, { + accepts: () => accepts, + defaultMatch: () => defaultMatch +}); +module.exports = __toCommonJS(accepts_exports); +var import_accept = require("../../utils/accept"); +const defaultMatch = (accepts2, config) => { + const { supports, default: defaultSupport } = config; + const accept = accepts2.sort((a, b) => b.q - a.q).find((accept2) => supports.includes(accept2.type)); + return accept ? accept.type : defaultSupport; +}; +const accepts = (c, options) => { + const acceptHeader = c.req.header(options.header); + if (!acceptHeader) { + return options.default; + } + const accepts2 = (0, import_accept.parseAccept)(acceptHeader); + const match = options.match || defaultMatch; + return match(accepts2, options); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + accepts, + defaultMatch +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/accepts/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/accepts/index.js new file mode 100644 index 0000000000000000000000000000000000000000..850bfd7382c68e2a68a213d8b0c0de2a27a0f996 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/accepts/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var accepts_exports = {}; +__export(accepts_exports, { + accepts: () => import_accepts.accepts +}); +module.exports = __toCommonJS(accepts_exports); +var import_accepts = require("./accepts"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + accepts +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/adapter/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/adapter/index.js new file mode 100644 index 0000000000000000000000000000000000000000..293fae4dbc8545475d14a82d55cf6eb563c6380d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/adapter/index.js @@ -0,0 +1,81 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var adapter_exports = {}; +__export(adapter_exports, { + checkUserAgentEquals: () => checkUserAgentEquals, + env: () => env, + getRuntimeKey: () => getRuntimeKey, + knownUserAgents: () => knownUserAgents +}); +module.exports = __toCommonJS(adapter_exports); +const env = (c, runtime) => { + const global = globalThis; + const globalEnv = global?.process?.env; + runtime ??= getRuntimeKey(); + const runtimeEnvHandlers = { + bun: () => globalEnv, + node: () => globalEnv, + "edge-light": () => globalEnv, + deno: () => { + return Deno.env.toObject(); + }, + workerd: () => c.env, + // On Fastly Compute, you can use the ConfigStore to manage user-defined data. + fastly: () => ({}), + other: () => ({}) + }; + return runtimeEnvHandlers[runtime](); +}; +const knownUserAgents = { + deno: "Deno", + bun: "Bun", + workerd: "Cloudflare-Workers", + node: "Node.js" +}; +const getRuntimeKey = () => { + const global = globalThis; + const userAgentSupported = typeof navigator !== "undefined" && typeof navigator.userAgent === "string"; + if (userAgentSupported) { + for (const [runtimeKey, userAgent] of Object.entries(knownUserAgents)) { + if (checkUserAgentEquals(userAgent)) { + return runtimeKey; + } + } + } + if (typeof global?.EdgeRuntime === "string") { + return "edge-light"; + } + if (global?.fastly !== void 0) { + return "fastly"; + } + if (global?.process?.release?.name === "node") { + return "node"; + } + return "other"; +}; +const checkUserAgentEquals = (platform) => { + const userAgent = navigator.userAgent; + return userAgent.startsWith(platform); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + checkUserAgentEquals, + env, + getRuntimeKey, + knownUserAgents +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/conninfo/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/conninfo/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8443757f8e5db55c97f8d0aa8d6795c128937579 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/conninfo/index.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var conninfo_exports = {}; +module.exports = __toCommonJS(conninfo_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/conninfo/types.js b/tools/ui/node_modules/hono/dist/cjs/helper/conninfo/types.js new file mode 100644 index 0000000000000000000000000000000000000000..81f4408be55bf33a4b69221862e2856a0c1dfa05 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/conninfo/types.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/cookie/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/cookie/index.js new file mode 100644 index 0000000000000000000000000000000000000000..62fc19b1d01c17268167659e2aa29023a9066215 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/cookie/index.js @@ -0,0 +1,130 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var cookie_exports = {}; +__export(cookie_exports, { + deleteCookie: () => deleteCookie, + generateCookie: () => generateCookie, + generateSignedCookie: () => generateSignedCookie, + getCookie: () => getCookie, + getSignedCookie: () => getSignedCookie, + setCookie: () => setCookie, + setSignedCookie: () => setSignedCookie +}); +module.exports = __toCommonJS(cookie_exports); +var import_cookie = require("../../utils/cookie"); +const getCookie = (c, key, prefix) => { + const cookie = c.req.raw.headers.get("Cookie"); + if (typeof key === "string") { + if (!cookie) { + return void 0; + } + let finalKey = key; + if (prefix === "secure") { + finalKey = "__Secure-" + key; + } else if (prefix === "host") { + finalKey = "__Host-" + key; + } + const obj2 = (0, import_cookie.parse)(cookie, finalKey); + return obj2[finalKey]; + } + if (!cookie) { + return {}; + } + const obj = (0, import_cookie.parse)(cookie); + return obj; +}; +const getSignedCookie = async (c, secret, key, prefix) => { + const cookie = c.req.raw.headers.get("Cookie"); + if (typeof key === "string") { + if (!cookie) { + return void 0; + } + let finalKey = key; + if (prefix === "secure") { + finalKey = "__Secure-" + key; + } else if (prefix === "host") { + finalKey = "__Host-" + key; + } + const obj2 = await (0, import_cookie.parseSigned)(cookie, secret, finalKey); + return obj2[finalKey]; + } + if (!cookie) { + return {}; + } + const obj = await (0, import_cookie.parseSigned)(cookie, secret); + return obj; +}; +const generateCookie = (name, value, opt) => { + let cookie; + if (opt?.prefix === "secure") { + cookie = (0, import_cookie.serialize)("__Secure-" + name, value, { path: "/", ...opt, secure: true }); + } else if (opt?.prefix === "host") { + cookie = (0, import_cookie.serialize)("__Host-" + name, value, { + ...opt, + path: "/", + secure: true, + domain: void 0 + }); + } else { + cookie = (0, import_cookie.serialize)(name, value, { path: "/", ...opt }); + } + return cookie; +}; +const setCookie = (c, name, value, opt) => { + const cookie = generateCookie(name, value, opt); + c.header("Set-Cookie", cookie, { append: true }); +}; +const generateSignedCookie = async (name, value, secret, opt) => { + let cookie; + if (opt?.prefix === "secure") { + cookie = await (0, import_cookie.serializeSigned)("__Secure-" + name, value, secret, { + path: "/", + ...opt, + secure: true + }); + } else if (opt?.prefix === "host") { + cookie = await (0, import_cookie.serializeSigned)("__Host-" + name, value, secret, { + ...opt, + path: "/", + secure: true, + domain: void 0 + }); + } else { + cookie = await (0, import_cookie.serializeSigned)(name, value, secret, { path: "/", ...opt }); + } + return cookie; +}; +const setSignedCookie = async (c, name, value, secret, opt) => { + const cookie = await generateSignedCookie(name, value, secret, opt); + c.header("set-cookie", cookie, { append: true }); +}; +const deleteCookie = (c, name, opt) => { + const deletedCookie = getCookie(c, name, opt?.prefix); + setCookie(c, name, "", { ...opt, maxAge: 0 }); + return deletedCookie; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + deleteCookie, + generateCookie, + generateSignedCookie, + getCookie, + getSignedCookie, + setCookie, + setSignedCookie +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/css/common.js b/tools/ui/node_modules/hono/dist/cjs/helper/css/common.js new file mode 100644 index 0000000000000000000000000000000000000000..8d7b536f1c223acdd9c906bd3690d5463d129e65 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/css/common.js @@ -0,0 +1,273 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var common_exports = {}; +__export(common_exports, { + CLASS_NAME: () => CLASS_NAME, + DEFAULT_STYLE_ID: () => DEFAULT_STYLE_ID, + EXTERNAL_CLASS_NAMES: () => EXTERNAL_CLASS_NAMES, + IS_CSS_ESCAPED: () => IS_CSS_ESCAPED, + PSEUDO_GLOBAL_SELECTOR: () => PSEUDO_GLOBAL_SELECTOR, + SELECTOR: () => SELECTOR, + SELECTORS: () => SELECTORS, + STYLE_STRING: () => STYLE_STRING, + buildStyleString: () => buildStyleString, + cssCommon: () => cssCommon, + cxCommon: () => cxCommon, + isPseudoGlobalSelectorRe: () => isPseudoGlobalSelectorRe, + keyframesCommon: () => keyframesCommon, + minify: () => minify, + rawCssString: () => rawCssString, + viewTransitionCommon: () => viewTransitionCommon +}); +module.exports = __toCommonJS(common_exports); +const PSEUDO_GLOBAL_SELECTOR = ":-hono-global"; +const isPseudoGlobalSelectorRe = new RegExp(`^${PSEUDO_GLOBAL_SELECTOR}{(.*)}$`); +const DEFAULT_STYLE_ID = "hono-css"; +const SELECTOR = /* @__PURE__ */ Symbol(); +const CLASS_NAME = /* @__PURE__ */ Symbol(); +const STYLE_STRING = /* @__PURE__ */ Symbol(); +const SELECTORS = /* @__PURE__ */ Symbol(); +const EXTERNAL_CLASS_NAMES = /* @__PURE__ */ Symbol(); +const CSS_ESCAPED = /* @__PURE__ */ Symbol(); +const IS_CSS_ESCAPED = /* @__PURE__ */ Symbol(); +const rawCssString = (value) => { + return { + [CSS_ESCAPED]: value + }; +}; +const toHash = (str) => { + let i = 0, out = 11; + while (i < str.length) { + out = 101 * out + str.charCodeAt(i++) >>> 0; + } + return "css-" + out; +}; +const normalizeLabel = (label) => { + return label.trim().replace(/\s+/g, "-"); +}; +const isValidClassName = (name) => /^-?[_a-zA-Z][_a-zA-Z0-9-]*$/.test(name); +const hasUnsafeSelectorChar = (name) => /[<{}]/.test(name); +const RESERVED_KEYFRAME_NAMES = /* @__PURE__ */ new Set([ + "default", + "inherit", + "initial", + "none", + "revert", + "revert-layer", + "unset" +]); +const isValidKeyframeName = (name) => isValidClassName(name) && !RESERVED_KEYFRAME_NAMES.has(name.toLowerCase()); +const defaultOnInvalidSlug = (slug) => { + console.warn(`Invalid slug: ${slug}`); +}; +const cssStringReStr = [ + '"(?:(?:\\\\[\\s\\S]|[^"\\\\])*)"', + // double quoted string + "'(?:(?:\\\\[\\s\\S]|[^'\\\\])*)'" + // single quoted string +].join("|"); +const minifyCssRe = new RegExp( + [ + "(" + cssStringReStr + ")", + // $1: quoted string + "(?:" + [ + "^\\s+", + // head whitespace + "\\/\\*.*?\\*\\/\\s*", + // multi-line comment + "\\/\\/.*\\n\\s*", + // single-line comment + "\\s+$" + // tail whitespace + ].join("|") + ")", + "\\s*;\\s*(}|$)\\s*", + // $2: trailing semicolon + "\\s*([{};:,])\\s*", + // $3: whitespace around { } : , ; + "(\\s)\\s+" + // $4: 2+ spaces + ].join("|"), + "g" +); +const minify = (css) => { + return css.replace(minifyCssRe, (_, $1, $2, $3, $4) => $1 || $2 || $3 || $4 || ""); +}; +const buildStyleString = (strings, values) => { + const selectors = []; + const externalClassNames = []; + const label = strings[0].match(/^\s*\/\*(.*?)\*\//)?.[1] || ""; + let styleString = ""; + for (let i = 0, len = strings.length; i < len; i++) { + styleString += strings[i]; + let vArray = values[i]; + if (typeof vArray === "boolean" || vArray === null || vArray === void 0) { + continue; + } + if (!Array.isArray(vArray)) { + vArray = [vArray]; + } + for (let j = 0, len2 = vArray.length; j < len2; j++) { + let value = vArray[j]; + if (typeof value === "boolean" || value === null || value === void 0) { + continue; + } + if (typeof value === "string") { + if (/([\\"'\/])/.test(value)) { + styleString += value.replace(/([\\"']|(?<=<)\/)/g, "\\$1"); + } else { + styleString += value; + } + } else if (typeof value === "number") { + styleString += value; + } else if (value[CSS_ESCAPED]) { + styleString += value[CSS_ESCAPED]; + } else if (value[CLASS_NAME].startsWith("@keyframes ")) { + selectors.push(value); + styleString += ` ${value[CLASS_NAME].substring(11)} `; + } else { + if (strings[i + 1]?.match(/^\s*{/)) { + selectors.push(value); + value = `.${value[CLASS_NAME]}`; + } else { + selectors.push(...value[SELECTORS]); + externalClassNames.push(...value[EXTERNAL_CLASS_NAMES]); + value = value[STYLE_STRING]; + const valueLen = value.length; + if (valueLen > 0) { + const lastChar = value[valueLen - 1]; + if (lastChar !== ";" && lastChar !== "}") { + value += ";"; + } + } + } + styleString += `${value || ""}`; + } + } + } + return [label, minify(styleString), selectors, externalClassNames]; +}; +const cssCommon = (strings, values, classNameSlug, onInvalidSlug) => { + let [label, thisStyleString, selectors, externalClassNames] = buildStyleString(strings, values); + const isPseudoGlobal = isPseudoGlobalSelectorRe.exec(thisStyleString); + if (isPseudoGlobal) { + thisStyleString = isPseudoGlobal[1]; + } + const hash = toHash(label + thisStyleString); + let customSlug; + if (classNameSlug) { + const slug = classNameSlug(hash, normalizeLabel(label), thisStyleString); + if (slug) { + if (isValidClassName(slug)) { + customSlug = slug; + } else { + ; + (onInvalidSlug || defaultOnInvalidSlug)(slug); + } + } + } + const selector = (isPseudoGlobal ? PSEUDO_GLOBAL_SELECTOR : "") + (customSlug || hash); + const className = (isPseudoGlobal ? selectors.map((s) => s[CLASS_NAME]) : [selector, ...externalClassNames]).join(" "); + return { + [SELECTOR]: selector, + [CLASS_NAME]: className, + [STYLE_STRING]: thisStyleString, + [SELECTORS]: selectors, + [EXTERNAL_CLASS_NAMES]: externalClassNames + }; +}; +const cxCommon = (args) => { + for (let i = 0, len = args.length; i < len; i++) { + const arg = args[i]; + if (typeof arg === "string") { + args[i] = { + [SELECTOR]: "", + [CLASS_NAME]: "", + [STYLE_STRING]: "", + [SELECTORS]: [], + // drop names that are unsafe to emit as a selector + [EXTERNAL_CLASS_NAMES]: hasUnsafeSelectorChar(arg) ? [] : [arg] + }; + } + } + return args; +}; +const keyframesCommon = (strings, values, classNameSlug, onInvalidSlug) => { + const [label, styleString] = buildStyleString(strings, values); + const hash = toHash(label + styleString); + let customSlug; + if (classNameSlug) { + const slug = classNameSlug(hash, normalizeLabel(label), styleString); + if (slug) { + if (isValidKeyframeName(slug)) { + customSlug = slug; + } else { + ; + (onInvalidSlug || defaultOnInvalidSlug)(slug); + } + } + } + return { + [SELECTOR]: "", + [CLASS_NAME]: `@keyframes ${customSlug || hash}`, + [STYLE_STRING]: styleString, + [SELECTORS]: [], + [EXTERNAL_CLASS_NAMES]: [] + }; +}; +let viewTransitionNameIndex = 0; +const viewTransitionCommon = ((strings, values, classNameSlug, onInvalidSlug) => { + if (!strings) { + strings = [`/* h-v-t ${viewTransitionNameIndex++} */`]; + } + const content = Array.isArray(strings) ? cssCommon(strings, values, classNameSlug, onInvalidSlug) : strings; + const transitionName = content[CLASS_NAME]; + const res = cssCommon( + ["view-transition-name:", ""], + // eslint-disable-line @typescript-eslint/no-explicit-any + [transitionName], + classNameSlug, + onInvalidSlug + ); + content[CLASS_NAME] = PSEUDO_GLOBAL_SELECTOR + content[CLASS_NAME]; + content[STYLE_STRING] = content[STYLE_STRING].replace( + /(?<=::view-transition(?:[a-z-]*)\()(?=\))/g, + transitionName + ); + res[CLASS_NAME] = res[SELECTOR] = transitionName; + res[SELECTORS] = [...content[SELECTORS], content]; + return res; +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + CLASS_NAME, + DEFAULT_STYLE_ID, + EXTERNAL_CLASS_NAMES, + IS_CSS_ESCAPED, + PSEUDO_GLOBAL_SELECTOR, + SELECTOR, + SELECTORS, + STYLE_STRING, + buildStyleString, + cssCommon, + cxCommon, + isPseudoGlobalSelectorRe, + keyframesCommon, + minify, + rawCssString, + viewTransitionCommon +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/css/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/css/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f5bd56eff60def096379a12e270d45985a5ccb80 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/css/index.js @@ -0,0 +1,157 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var css_exports = {}; +__export(css_exports, { + Style: () => Style, + createCssContext: () => createCssContext, + css: () => css, + cx: () => cx, + keyframes: () => keyframes, + rawCssString: () => import_common2.rawCssString, + viewTransition: () => viewTransition +}); +module.exports = __toCommonJS(css_exports); +var import_html = require("../../helper/html"); +var import_constants = require("../../jsx/constants"); +var import_css = require("../../jsx/dom/css"); +var import_html2 = require("../../utils/html"); +var import_common = require("./common"); +var import_common2 = require("./common"); +const createCssContext = ({ + id, + classNameSlug, + onInvalidSlug +}) => { + const [cssJsxDomObject, StyleRenderToDom] = (0, import_css.createCssJsxDomObjects)({ id }); + const contextMap = /* @__PURE__ */ new WeakMap(); + const nonceMap = /* @__PURE__ */ new WeakMap(); + const replaceStyleRe = new RegExp(`()`); + const newCssClassNameObject = (cssClassName) => { + const appendStyle = ({ buffer, context }) => { + const [toAdd, added] = contextMap.get(context); + const names = Object.keys(toAdd); + if (!names.length) { + return; + } + let stylesStr = ""; + names.forEach((className2) => { + added[className2] = true; + stylesStr += className2.startsWith(import_common.PSEUDO_GLOBAL_SELECTOR) ? toAdd[className2] : `${className2[0] === "@" ? "" : "."}${className2}{${toAdd[className2]}}`; + }); + contextMap.set(context, [{}, added]); + if (buffer && replaceStyleRe.test(buffer[0])) { + buffer[0] = buffer[0].replace(replaceStyleRe, (_, pre, post) => `${pre}${stylesStr}${post}`); + return; + } + const nonce = nonceMap.get(context); + const appendStyleScript = `document.querySelector('#${id}').textContent+=${JSON.stringify(stylesStr)}`; + if (buffer) { + buffer[0] = `${appendStyleScript}${buffer[0]}`; + return; + } + return Promise.resolve(appendStyleScript); + }; + const addClassNameToContext = ({ context }) => { + if (!contextMap.has(context)) { + contextMap.set(context, [{}, {}]); + } + const [toAdd, added] = contextMap.get(context); + let allAdded = true; + if (!added[cssClassName[import_common.SELECTOR]]) { + allAdded = false; + toAdd[cssClassName[import_common.SELECTOR]] = cssClassName[import_common.STYLE_STRING]; + } + cssClassName[import_common.SELECTORS].forEach( + ({ [import_common.CLASS_NAME]: className2, [import_common.STYLE_STRING]: styleString }) => { + if (!added[className2]) { + allAdded = false; + toAdd[className2] = styleString; + } + } + ); + if (allAdded) { + return; + } + return Promise.resolve((0, import_html.raw)("", [appendStyle])); + }; + const rawClassName = cssClassName[import_common.CLASS_NAME]; + let escapedClassName = rawClassName; + if (/[&<>'"]/.test(rawClassName)) { + const escapedBuffer = [""]; + (0, import_html2.escapeToBuffer)(rawClassName, escapedBuffer); + escapedClassName = escapedBuffer[0]; + } + const className = new String(escapedClassName); + Object.assign(className, cssClassName); + className.isEscaped = true; + className.callbacks = [addClassNameToContext]; + const promise = Promise.resolve(className); + Object.assign(promise, cssClassName); + promise.toString = cssJsxDomObject.toString; + return promise; + }; + const css2 = (strings, ...values) => { + return newCssClassNameObject((0, import_common.cssCommon)(strings, values, classNameSlug, onInvalidSlug)); + }; + const cx2 = (...args) => { + args = (0, import_common.cxCommon)(args); + return css2(Array(args.length).fill(""), ...args); + }; + const keyframes2 = (strings, ...values) => (0, import_common.keyframesCommon)(strings, values, classNameSlug, onInvalidSlug); + const viewTransition2 = ((strings, ...values) => { + return newCssClassNameObject( + (0, import_common.viewTransitionCommon)(strings, values, classNameSlug, onInvalidSlug) + // eslint-disable-line @typescript-eslint/no-explicit-any + ); + }); + const Style2 = ({ children, nonce } = {}) => (0, import_html.raw)( + ``, + [ + ({ context }) => { + nonceMap.set(context, nonce); + return void 0; + } + ] + ); + Style2[import_constants.DOM_RENDERER] = StyleRenderToDom; + return { + css: css2, + cx: cx2, + keyframes: keyframes2, + viewTransition: viewTransition2, + Style: Style2 + }; +}; +const defaultContext = createCssContext({ + id: import_common.DEFAULT_STYLE_ID +}); +const css = defaultContext.css; +const cx = defaultContext.cx; +const keyframes = defaultContext.keyframes; +const viewTransition = defaultContext.viewTransition; +const Style = defaultContext.Style; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Style, + createCssContext, + css, + cx, + keyframes, + rawCssString, + viewTransition +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/dev/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/dev/index.js new file mode 100644 index 0000000000000000000000000000000000000000..96dc1fa4aa2282a2c2a9b8043d0c66f7121b62c8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/dev/index.js @@ -0,0 +1,79 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var dev_exports = {}; +__export(dev_exports, { + getRouterName: () => getRouterName, + inspectRoutes: () => inspectRoutes, + showRoutes: () => showRoutes +}); +module.exports = __toCommonJS(dev_exports); +var import_color = require("../../utils/color"); +var import_handler = require("../../utils/handler"); +const handlerName = (handler) => { + return handler.name || ((0, import_handler.isMiddleware)(handler) ? "[middleware]" : "[handler]"); +}; +const inspectRoutes = (hono) => { + return hono.routes.map(({ path, method, handler }) => { + const targetHandler = (0, import_handler.findTargetHandler)(handler); + return { + path, + method, + name: handlerName(targetHandler), + isMiddleware: (0, import_handler.isMiddleware)(targetHandler) + }; + }); +}; +const showRoutes = (hono, opts) => { + const colorEnabled = opts?.colorize ?? (0, import_color.getColorEnabled)(); + const routeData = {}; + let maxMethodLength = 0; + let maxPathLength = 0; + inspectRoutes(hono).filter(({ isMiddleware: isMiddleware2 }) => opts?.verbose || !isMiddleware2).map((route) => { + const key = `${route.method}-${route.path}`; + (routeData[key] ||= []).push(route); + if (routeData[key].length > 1) { + return; + } + maxMethodLength = Math.max(maxMethodLength, route.method.length); + maxPathLength = Math.max(maxPathLength, route.path.length); + return { method: route.method, path: route.path, routes: routeData[key] }; + }).forEach((data) => { + if (!data) { + return; + } + const { method, path, routes } = data; + const methodStr = colorEnabled ? `\x1B[32m${method}\x1B[0m` : method; + console.log(`${methodStr} ${" ".repeat(maxMethodLength - method.length)} ${path}`); + if (!opts?.verbose) { + return; + } + routes.forEach(({ name }) => { + console.log(`${" ".repeat(maxMethodLength + 3)} ${name}`); + }); + }); +}; +const getRouterName = (app) => { + app.router.match("GET", "/"); + return app.router.name; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getRouterName, + inspectRoutes, + showRoutes +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/factory/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/factory/index.js new file mode 100644 index 0000000000000000000000000000000000000000..22901dd99425c6e52a421b654694e3eacc9037a1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/factory/index.js @@ -0,0 +1,54 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var factory_exports = {}; +__export(factory_exports, { + Factory: () => Factory, + createFactory: () => createFactory, + createMiddleware: () => createMiddleware +}); +module.exports = __toCommonJS(factory_exports); +var import_hono = require("../../hono"); +class Factory { + initApp; + #defaultAppOptions; + constructor(init) { + this.initApp = init?.initApp; + this.#defaultAppOptions = init?.defaultAppOptions; + } + createApp = (options) => { + const app = new import_hono.Hono( + options && this.#defaultAppOptions ? { ...this.#defaultAppOptions, ...options } : options ?? this.#defaultAppOptions + ); + if (this.initApp) { + this.initApp(app); + } + return app; + }; + createMiddleware = (middleware) => middleware; + createHandlers = (...handlers) => { + return handlers.filter((handler) => handler !== void 0); + }; +} +const createFactory = (init) => new Factory(init); +const createMiddleware = (middleware) => middleware; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Factory, + createFactory, + createMiddleware +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/html/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/html/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a5b3cc016c6942fc8fdc83c5d81f2470091035ba --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/html/index.js @@ -0,0 +1,64 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var html_exports = {}; +__export(html_exports, { + html: () => html, + raw: () => import_html.raw +}); +module.exports = __toCommonJS(html_exports); +var import_html = require("../../utils/html"); +const html = (strings, ...values) => { + const buffer = [""]; + for (let i = 0, len = strings.length - 1; i < len; i++) { + buffer[0] += strings[i]; + const children = Array.isArray(values[i]) ? values[i].flat(Infinity) : [values[i]]; + for (let i2 = 0, len2 = children.length; i2 < len2; i2++) { + const child = children[i2]; + if (typeof child === "string") { + (0, import_html.escapeToBuffer)(child, buffer); + } else if (typeof child === "number") { + ; + buffer[0] += child; + } else if (typeof child === "boolean" || child === null || child === void 0) { + continue; + } else if (typeof child === "object" && child.isEscaped) { + if (child.callbacks) { + buffer.unshift("", child); + } else { + const tmp = child.toString(); + if (tmp instanceof Promise) { + buffer.unshift("", tmp); + } else { + buffer[0] += tmp; + } + } + } else if (child instanceof Promise) { + buffer.unshift("", child); + } else { + (0, import_html.escapeToBuffer)(child.toString(), buffer); + } + } + } + buffer[0] += strings.at(-1); + return buffer.length === 1 ? "callbacks" in buffer ? (0, import_html.raw)((0, import_html.resolveCallbackSync)((0, import_html.raw)(buffer[0], buffer.callbacks))) : (0, import_html.raw)(buffer[0]) : (0, import_html.stringBufferToString)(buffer, buffer.callbacks); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + html, + raw +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/proxy/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/proxy/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ae3dc8170d203c5d82ca1bec946fa7351d03785b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/proxy/index.js @@ -0,0 +1,115 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var proxy_exports = {}; +__export(proxy_exports, { + proxy: () => proxy +}); +module.exports = __toCommonJS(proxy_exports); +var import_http_exception = require("../../http-exception"); +const hopByHopHeaders = [ + "connection", + "keep-alive", + "proxy-authenticate", + "proxy-authorization", + "te", + "trailer", + "transfer-encoding", + "upgrade" +]; +const ALLOWED_TOKEN_PATTERN = /^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/; +const buildRequestInitFromRequest = (request, strictConnectionProcessing) => { + if (!request) { + return {}; + } + const headers = new Headers(request.headers); + if (strictConnectionProcessing) { + const connectionValue = headers.get("connection"); + if (connectionValue) { + const headerNames = connectionValue.split(",").map((h) => h.trim()); + const invalidHeaders = headerNames.filter((h) => !ALLOWED_TOKEN_PATTERN.test(h)); + if (invalidHeaders.length > 0) { + throw new import_http_exception.HTTPException(400, { + message: `Invalid Connection header value: ${invalidHeaders.join(", ")}` + }); + } + headerNames.forEach((headerName) => { + headers.delete(headerName); + }); + } + } + hopByHopHeaders.forEach((header) => { + headers.delete(header); + }); + return { + method: request.method, + body: request.body, + duplex: request.body ? "half" : void 0, + headers, + signal: request.signal + }; +}; +const preprocessRequestInit = (requestInit) => { + if (!requestInit.headers || Array.isArray(requestInit.headers) || requestInit.headers instanceof Headers) { + return requestInit; + } + const headers = new Headers(); + for (const [key, value] of Object.entries(requestInit.headers)) { + if (value == null) { + headers.delete(key); + } else { + headers.set(key, value); + } + } + requestInit.headers = headers; + return requestInit; +}; +const proxy = async (input, proxyInit) => { + const { + raw, + customFetch, + strictConnectionProcessing = false, + ...requestInit + } = proxyInit instanceof Request ? { raw: proxyInit } : proxyInit ?? {}; + const req = new Request(input, { + ...buildRequestInitFromRequest(raw, strictConnectionProcessing), + ...preprocessRequestInit(requestInit) + }); + req.headers.delete("accept-encoding"); + const res = await (customFetch || fetch)(req); + const resHeaders = new Headers(res.headers); + const connectionValue = resHeaders.get("connection"); + if (connectionValue) { + connectionValue.split(",").map((h) => h.trim()).filter((h) => ALLOWED_TOKEN_PATTERN.test(h)).forEach((h) => resHeaders.delete(h)); + } + hopByHopHeaders.forEach((header) => { + resHeaders.delete(header); + }); + if (resHeaders.has("content-encoding")) { + resHeaders.delete("content-encoding"); + resHeaders.delete("content-length"); + } + return new Response(res.body, { + status: res.status, + statusText: res.statusText, + headers: resHeaders + }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + proxy +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/route/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/route/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5b29e1ee35cb46a0a5321e28d85113512e7c8b55 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/route/index.js @@ -0,0 +1,71 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var route_exports = {}; +__export(route_exports, { + basePath: () => basePath, + baseRoutePath: () => baseRoutePath, + matchedRoutes: () => matchedRoutes, + routePath: () => routePath +}); +module.exports = __toCommonJS(route_exports); +var import_constants = require("../../request/constants"); +var import_url = require("../../utils/url"); +const matchedRoutes = (c) => ( + // @ts-expect-error c.req[GET_MATCH_RESULT] is not typed + c.req[import_constants.GET_MATCH_RESULT][0].map(([[, route]]) => route) +); +const routePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.path ?? ""; +const baseRoutePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.basePath ?? ""; +const basePathCacheMap = /* @__PURE__ */ new WeakMap(); +const basePath = (c, index) => { + index ??= c.req.routeIndex; + const cache = basePathCacheMap.get(c) || []; + if (typeof cache[index] === "string") { + return cache[index]; + } + let result; + const rp = baseRoutePath(c, index); + if (!/[:*]/.test(rp)) { + result = rp; + } else { + const paths = (0, import_url.splitRoutingPath)(rp); + const reqPath = c.req.path; + let basePathLength = 0; + for (let i = 0, len = paths.length; i < len; i++) { + const pattern = (0, import_url.getPattern)(paths[i], paths[i + 1]); + if (pattern) { + const re = pattern[2] === true || pattern === "*" ? /[^\/]+/ : pattern[2]; + basePathLength += reqPath.substring(basePathLength + 1).match(re)?.[0].length || 0; + } else { + basePathLength += paths[i].length; + } + basePathLength += 1; + } + result = reqPath.substring(0, basePathLength); + } + cache[index] = result; + basePathCacheMap.set(c, cache); + return result; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + basePath, + baseRoutePath, + matchedRoutes, + routePath +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/ssg/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a05b5b1192c0907064afae65d5250b97b199774f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/index.js @@ -0,0 +1,43 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ssg_exports = {}; +__export(ssg_exports, { + X_HONO_DISABLE_SSG_HEADER_KEY: () => import_middleware.X_HONO_DISABLE_SSG_HEADER_KEY, + defaultPlugin: () => import_plugins.defaultPlugin, + disableSSG: () => import_middleware.disableSSG, + isSSGContext: () => import_middleware.isSSGContext, + onlySSG: () => import_middleware.onlySSG, + redirectPlugin: () => import_plugins.redirectPlugin, + ssgParams: () => import_middleware.ssgParams +}); +module.exports = __toCommonJS(ssg_exports); +__reExport(ssg_exports, require("./ssg"), module.exports); +var import_middleware = require("./middleware"); +var import_plugins = require("./plugins"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + X_HONO_DISABLE_SSG_HEADER_KEY, + defaultPlugin, + disableSSG, + isSSGContext, + onlySSG, + redirectPlugin, + ssgParams, + ...require("./ssg") +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/ssg/middleware.js b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/middleware.js new file mode 100644 index 0000000000000000000000000000000000000000..acdfe0e9286ea5ab211e5e1a2675f8a6530bf770 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/middleware.js @@ -0,0 +1,73 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var middleware_exports = {}; +__export(middleware_exports, { + SSG_CONTEXT: () => SSG_CONTEXT, + SSG_DISABLED_RESPONSE: () => SSG_DISABLED_RESPONSE, + X_HONO_DISABLE_SSG_HEADER_KEY: () => X_HONO_DISABLE_SSG_HEADER_KEY, + disableSSG: () => disableSSG, + isSSGContext: () => isSSGContext, + onlySSG: () => onlySSG, + ssgParams: () => ssgParams +}); +module.exports = __toCommonJS(middleware_exports); +var import_utils = require("./utils"); +const SSG_CONTEXT = "HONO_SSG_CONTEXT"; +const X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg"; +const SSG_DISABLED_RESPONSE = (() => { + try { + return new Response("SSG is disabled", { + status: 404, + headers: { [X_HONO_DISABLE_SSG_HEADER_KEY]: "true" } + }); + } catch { + return null; + } +})(); +const ssgParams = (params) => async (c, next) => { + if ((0, import_utils.isDynamicRoute)(c.req.path)) { + ; + c.req.raw.ssgParams = Array.isArray(params) ? params : await params(c); + return c.notFound(); + } + await next(); +}; +const isSSGContext = (c) => !!c.env?.[SSG_CONTEXT]; +const disableSSG = () => async function disableSSG2(c, next) { + if (isSSGContext(c)) { + c.header(X_HONO_DISABLE_SSG_HEADER_KEY, "true"); + return c.notFound(); + } + await next(); +}; +const onlySSG = () => async function onlySSG2(c, next) { + if (!isSSGContext(c)) { + return c.notFound(); + } + await next(); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SSG_CONTEXT, + SSG_DISABLED_RESPONSE, + X_HONO_DISABLE_SSG_HEADER_KEY, + disableSSG, + isSSGContext, + onlySSG, + ssgParams +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/ssg/plugins.js b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/plugins.js new file mode 100644 index 0000000000000000000000000000000000000000..44546e9bc54882885d3d0c3cb9cd32a322110ee1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/plugins.js @@ -0,0 +1,70 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var plugins_exports = {}; +__export(plugins_exports, { + defaultPlugin: () => defaultPlugin, + redirectPlugin: () => redirectPlugin +}); +module.exports = __toCommonJS(plugins_exports); +var import_html = require("../html"); +const defaultPlugin = () => { + return { + afterResponseHook: (res) => { + if (res.status !== 200) { + return false; + } + return res; + } + }; +}; +const REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]); +const generateRedirectHtml = (location) => { + const content = import_html.html` +Redirecting to: ${location} + + + + +Redirecting to ${location} + +`; + return content.toString().replace(/\n/g, ""); +}; +const redirectPlugin = () => { + return { + afterResponseHook: (res) => { + if (REDIRECT_STATUS_CODES.has(res.status)) { + const location = res.headers.get("Location"); + if (!location) { + return false; + } + const htmlBody = generateRedirectHtml(location); + return new Response(htmlBody, { + status: 200, + headers: { "Content-Type": "text/html; charset=utf-8" } + }); + } + return res; + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + defaultPlugin, + redirectPlugin +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/ssg/ssg.js b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/ssg.js new file mode 100644 index 0000000000000000000000000000000000000000..08368b3df17ab940cceba23bf2a598a6b8dd324d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/ssg.js @@ -0,0 +1,320 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ssg_exports = {}; +__export(ssg_exports, { + DEFAULT_OUTPUT_DIR: () => DEFAULT_OUTPUT_DIR, + combineAfterGenerateHooks: () => combineAfterGenerateHooks, + combineAfterResponseHooks: () => combineAfterResponseHooks, + combineBeforeRequestHooks: () => combineBeforeRequestHooks, + defaultExtensionMap: () => defaultExtensionMap, + fetchRoutesContent: () => fetchRoutesContent, + saveContentToFile: () => saveContentToFile, + toSSG: () => toSSG +}); +module.exports = __toCommonJS(ssg_exports); +var import_utils = require("../../client/utils"); +var import_concurrent = require("../../utils/concurrent"); +var import_mime = require("../../utils/mime"); +var import_middleware = require("./middleware"); +var import_plugins = require("./plugins"); +var import_utils2 = require("./utils"); +const DEFAULT_CONCURRENCY = 2; +const DEFAULT_CONTENT_TYPE = "text/plain"; +const DEFAULT_OUTPUT_DIR = "./static"; +const generateFilePath = (routePath, outDir, mimeType, extensionMap) => { + const extension = determineExtension(mimeType, extensionMap); + let filePath; + if (routePath.endsWith(`.${extension}`)) { + filePath = (0, import_utils2.joinPaths)(outDir, routePath); + } else if (routePath === "/") { + filePath = (0, import_utils2.joinPaths)(outDir, `index.${extension}`); + } else if (routePath.endsWith("/")) { + filePath = (0, import_utils2.joinPaths)(outDir, routePath, `index.${extension}`); + } else { + filePath = (0, import_utils2.joinPaths)(outDir, `${routePath}.${extension}`); + } + (0, import_utils2.ensureWithinOutDir)(outDir, filePath); + return filePath; +}; +const parseResponseContent = async (response) => { + const contentType = response.headers.get("Content-Type"); + try { + if (contentType?.includes("text") || contentType?.includes("json")) { + return await response.text(); + } else { + return await response.arrayBuffer(); + } + } catch (error) { + throw new Error( + `Error processing response: ${error instanceof Error ? error.message : "Unknown error"}` + ); + } +}; +const defaultExtensionMap = { + "text/html": "html", + "text/xml": "xml", + "application/xml": "xml", + "application/atom+xml": "xml", + "application/rss+xml": "xml", + "application/yaml": "yaml" +}; +const determineExtension = (mimeType, userExtensionMap) => { + const extensionMap = userExtensionMap || defaultExtensionMap; + if (mimeType in extensionMap) { + return extensionMap[mimeType]; + } + return (0, import_mime.getExtension)(mimeType) || "html"; +}; +const combineBeforeRequestHooks = (hooks) => { + if (!Array.isArray(hooks)) { + return hooks; + } + return async (req) => { + let currentReq = req; + for (const hook of hooks) { + const result = await hook(currentReq); + if (result === false) { + return false; + } + if (result instanceof Request) { + currentReq = result; + } + } + return currentReq; + }; +}; +const combineAfterResponseHooks = (hooks) => { + if (!Array.isArray(hooks)) { + return hooks; + } + return async (res) => { + let currentRes = res; + for (const hook of hooks) { + const result = await hook(currentRes); + if (result === false) { + return false; + } + if (result instanceof Response) { + currentRes = result; + } + } + return currentRes; + }; +}; +const combineAfterGenerateHooks = (hooks, fsModule, options) => { + if (!Array.isArray(hooks)) { + return hooks; + } + return async (result) => { + for (const hook of hooks) { + await hook(result, fsModule, options); + } + }; +}; +const fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook, concurrency) { + const baseURL = "http://localhost"; + const pool = (0, import_concurrent.createPool)({ concurrency }); + for (const route of (0, import_utils2.filterStaticGenerateRoutes)(app)) { + const thisRouteBaseURL = new URL(route.path, baseURL).toString(); + let forGetInfoURLRequest = new Request(thisRouteBaseURL); + yield new Promise(async (resolveGetInfo, rejectGetInfo) => { + try { + if (beforeRequestHook) { + const maybeRequest = await beforeRequestHook(forGetInfoURLRequest); + if (!maybeRequest) { + resolveGetInfo(void 0); + return; + } + forGetInfoURLRequest = maybeRequest; + } + await pool.run(() => app.fetch(forGetInfoURLRequest, { [import_middleware.SSG_CONTEXT]: true })); + if (!forGetInfoURLRequest.ssgParams) { + if ((0, import_utils2.isDynamicRoute)(route.path)) { + resolveGetInfo(void 0); + return; + } + forGetInfoURLRequest.ssgParams = [{}]; + } + const requestInit = { + method: forGetInfoURLRequest.method, + headers: forGetInfoURLRequest.headers + }; + resolveGetInfo( + (function* () { + for (const param of forGetInfoURLRequest.ssgParams) { + yield new Promise(async (resolveReq, rejectReq) => { + try { + const replacedUrlParam = (0, import_utils.replaceUrlParam)(route.path, param); + let response = await pool.run( + () => app.request(replacedUrlParam, requestInit, { + [import_middleware.SSG_CONTEXT]: true + }) + ); + if (response.headers.get(import_middleware.X_HONO_DISABLE_SSG_HEADER_KEY)) { + resolveReq(void 0); + return; + } + if (afterResponseHook) { + const maybeResponse = await afterResponseHook(response); + if (!maybeResponse) { + resolveReq(void 0); + return; + } + response = maybeResponse; + } + const mimeType = response.headers.get("Content-Type")?.split(";")[0] || DEFAULT_CONTENT_TYPE; + const content = await parseResponseContent(response); + resolveReq({ + routePath: replacedUrlParam, + mimeType, + content + }); + } catch (error) { + rejectReq(error); + } + }); + } + })() + ); + } catch (error) { + rejectGetInfo(error); + } + }); + } +}; +const createdDirs = /* @__PURE__ */ new Set(); +const saveContentToFile = async (data, fsModule, outDir, extensionMap) => { + const awaitedData = await data; + if (!awaitedData) { + return; + } + const { routePath, content, mimeType } = awaitedData; + const filePath = generateFilePath(routePath, outDir, mimeType, extensionMap); + const dirPath = (0, import_utils2.dirname)(filePath); + if (!createdDirs.has(dirPath)) { + await fsModule.mkdir(dirPath, { recursive: true }); + createdDirs.add(dirPath); + } + if (typeof content === "string") { + await fsModule.writeFile(filePath, content); + } else if (content instanceof ArrayBuffer) { + await fsModule.writeFile(filePath, new Uint8Array(content)); + } + return filePath; +}; +const toSSG = async (app, fs, options) => { + let result; + const getInfoPromises = []; + const savePromises = []; + const plugins = options?.plugins || [(0, import_plugins.defaultPlugin)()]; + const beforeRequestHooks = []; + const afterResponseHooks = []; + const afterGenerateHooks = []; + if (options?.beforeRequestHook) { + beforeRequestHooks.push( + ...Array.isArray(options.beforeRequestHook) ? options.beforeRequestHook : [options.beforeRequestHook] + ); + } + if (options?.afterResponseHook) { + afterResponseHooks.push( + ...Array.isArray(options.afterResponseHook) ? options.afterResponseHook : [options.afterResponseHook] + ); + } + if (options?.afterGenerateHook) { + afterGenerateHooks.push( + ...Array.isArray(options.afterGenerateHook) ? options.afterGenerateHook : [options.afterGenerateHook] + ); + } + for (const plugin of plugins) { + if (plugin.beforeRequestHook) { + beforeRequestHooks.push( + ...Array.isArray(plugin.beforeRequestHook) ? plugin.beforeRequestHook : [plugin.beforeRequestHook] + ); + } + if (plugin.afterResponseHook) { + afterResponseHooks.push( + ...Array.isArray(plugin.afterResponseHook) ? plugin.afterResponseHook : [plugin.afterResponseHook] + ); + } + if (plugin.afterGenerateHook) { + afterGenerateHooks.push( + ...Array.isArray(plugin.afterGenerateHook) ? plugin.afterGenerateHook : [plugin.afterGenerateHook] + ); + } + } + try { + const outputDir = options?.dir ?? DEFAULT_OUTPUT_DIR; + const concurrency = options?.concurrency ?? DEFAULT_CONCURRENCY; + const combinedBeforeRequestHook = combineBeforeRequestHooks( + beforeRequestHooks.length > 0 ? beforeRequestHooks : [(req) => req] + ); + const combinedAfterResponseHook = combineAfterResponseHooks( + afterResponseHooks.length > 0 ? afterResponseHooks : [(req) => req] + ); + const getInfoGen = fetchRoutesContent( + app, + combinedBeforeRequestHook, + combinedAfterResponseHook, + concurrency + ); + for (const getInfo of getInfoGen) { + getInfoPromises.push( + getInfo.then((getContentGen) => { + if (!getContentGen) { + return; + } + for (const content of getContentGen) { + savePromises.push( + saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e) + ); + } + }) + ); + } + await Promise.all(getInfoPromises); + const files = []; + for (const savePromise of savePromises) { + const fileOrError = await savePromise; + if (typeof fileOrError === "string") { + files.push(fileOrError); + } else if (fileOrError) { + throw fileOrError; + } + } + result = { success: true, files }; + } catch (error) { + const errorObj = error instanceof Error ? error : new Error(String(error)); + result = { success: false, files: [], error: errorObj }; + } + if (afterGenerateHooks.length > 0) { + const combinedAfterGenerateHooks = combineAfterGenerateHooks(afterGenerateHooks, fs, options); + await combinedAfterGenerateHooks(result, fs, options); + } + return result; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + DEFAULT_OUTPUT_DIR, + combineAfterGenerateHooks, + combineAfterResponseHooks, + combineBeforeRequestHooks, + defaultExtensionMap, + fetchRoutesContent, + saveContentToFile, + toSSG +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/ssg/utils.js b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..1ce1bfa19eae7c7494e42d4e10deea2bfdaa6929 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/ssg/utils.js @@ -0,0 +1,93 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + dirname: () => dirname, + ensureWithinOutDir: () => ensureWithinOutDir, + filterStaticGenerateRoutes: () => filterStaticGenerateRoutes, + isDynamicRoute: () => isDynamicRoute, + joinPaths: () => joinPaths +}); +module.exports = __toCommonJS(utils_exports); +var import_router = require("../../router"); +var import_handler = require("../../utils/handler"); +const dirname = (path) => { + const separatedPath = path.split(/[\/\\]/); + return separatedPath.slice(0, -1).join("/"); +}; +const normalizePath = (path) => { + return path.replace(/(\\)/g, "/").replace(/\/$/g, ""); +}; +const handleParent = (resultPaths, beforeParentFlag) => { + if (resultPaths.length === 0 || beforeParentFlag) { + resultPaths.push(".."); + } else { + resultPaths.pop(); + } +}; +const handleNonDot = (path, resultPaths) => { + path = path.replace(/^\.(?!.)/, ""); + if (path !== "") { + resultPaths.push(path); + } +}; +const handleSegments = (paths, resultPaths) => { + let beforeParentFlag = false; + for (const path of paths) { + if (path === "..") { + handleParent(resultPaths, beforeParentFlag); + beforeParentFlag = true; + } else { + handleNonDot(path, resultPaths); + beforeParentFlag = false; + } + } +}; +const joinPaths = (...paths) => { + paths = paths.map(normalizePath); + const resultPaths = []; + handleSegments(paths.join("/").split("/"), resultPaths); + return (paths[0][0] === "/" ? "/" : "") + resultPaths.join("/"); +}; +const filterStaticGenerateRoutes = (hono) => { + return hono.routes.reduce((acc, { method, handler, path }) => { + const targetHandler = (0, import_handler.findTargetHandler)(handler); + if (["GET", import_router.METHOD_NAME_ALL].includes(method) && !(0, import_handler.isMiddleware)(targetHandler)) { + acc.push({ path }); + } + return acc; + }, []); +}; +const isDynamicRoute = (path) => { + return path.split("/").some((segment) => segment.startsWith(":") || segment.includes("*")); +}; +const ensureWithinOutDir = (outDir, filePath) => { + const normalizedOutDir = joinPaths("/", outDir); + const normalizedFilePath = joinPaths("/", filePath); + if (normalizedFilePath !== normalizedOutDir && !normalizedFilePath.startsWith(`${normalizedOutDir}/`)) { + throw new Error(`Path traversal detected: "${filePath}" is outside the output directory`); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + dirname, + ensureWithinOutDir, + filterStaticGenerateRoutes, + isDynamicRoute, + joinPaths +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/streaming/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e56a78169292c4e1da7d00e3a54939bb579580c0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/index.js @@ -0,0 +1,35 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var streaming_exports = {}; +__export(streaming_exports, { + SSEStreamingApi: () => import_sse.SSEStreamingApi, + stream: () => import_stream.stream, + streamSSE: () => import_sse.streamSSE, + streamText: () => import_text.streamText +}); +module.exports = __toCommonJS(streaming_exports); +var import_stream = require("./stream"); +var import_sse = require("./sse"); +var import_text = require("./text"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SSEStreamingApi, + stream, + streamSSE, + streamText +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/streaming/sse.js b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/sse.js new file mode 100644 index 0000000000000000000000000000000000000000..a10412c44dd292d767add825dba894cbbfa24fb2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/sse.js @@ -0,0 +1,91 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var sse_exports = {}; +__export(sse_exports, { + SSEStreamingApi: () => SSEStreamingApi, + streamSSE: () => streamSSE +}); +module.exports = __toCommonJS(sse_exports); +var import_html = require("../../utils/html"); +var import_stream = require("../../utils/stream"); +var import_utils = require("./utils"); +class SSEStreamingApi extends import_stream.StreamingApi { + constructor(writable, readable) { + super(writable, readable); + } + async writeSSE(message) { + const data = await (0, import_html.resolveCallback)(message.data, import_html.HtmlEscapedCallbackPhase.Stringify, false, {}); + const dataLines = data.split(/\r\n|\r|\n/).map((line) => { + return `data: ${line}`; + }).join("\n"); + for (const key of ["event", "id"]) { + const value = message[key]; + if (value && /[\r\n]/.test(value)) { + throw new Error(`${key} must not contain "\\r" or "\\n"`); + } + } + const sseData = [ + message.event && `event: ${message.event}`, + dataLines, + message.id !== void 0 && `id: ${message.id}`, + message.retry !== void 0 && `retry: ${message.retry}` + ].filter(Boolean).join("\n") + "\n\n"; + await this.write(sseData); + } +} +const run = async (stream, cb, onError) => { + try { + await cb(stream); + } catch (e) { + if (e instanceof Error && onError) { + await onError(e, stream); + await stream.writeSSE({ + event: "error", + data: e.message + }); + } else { + console.error(e); + } + } finally { + stream.close(); + } +}; +const contextStash = /* @__PURE__ */ new WeakMap(); +const streamSSE = (c, cb, onError) => { + const { readable, writable } = new TransformStream(); + const stream = new SSEStreamingApi(writable, readable); + if ((0, import_utils.isOldBunVersion)()) { + c.req.raw.signal.addEventListener("abort", () => { + if (!stream.closed) { + stream.abort(); + } + }); + } + contextStash.set(stream.responseReadable, c); + c.header("Transfer-Encoding", "chunked"); + c.header("Content-Type", "text/event-stream"); + c.header("Cache-Control", "no-cache"); + c.header("Connection", "keep-alive"); + run(stream, cb, onError); + return c.newResponse(stream.responseReadable); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SSEStreamingApi, + streamSSE +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/streaming/stream.js b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/stream.js new file mode 100644 index 0000000000000000000000000000000000000000..9e8ca2ab353dc31d25f0ae7654f15f632d374278 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/stream.js @@ -0,0 +1,56 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var stream_exports = {}; +__export(stream_exports, { + stream: () => stream +}); +module.exports = __toCommonJS(stream_exports); +var import_stream = require("../../utils/stream"); +var import_utils = require("./utils"); +const contextStash = /* @__PURE__ */ new WeakMap(); +const stream = (c, cb, onError) => { + const { readable, writable } = new TransformStream(); + const stream2 = new import_stream.StreamingApi(writable, readable); + if ((0, import_utils.isOldBunVersion)()) { + c.req.raw.signal.addEventListener("abort", () => { + if (!stream2.closed) { + stream2.abort(); + } + }); + } + contextStash.set(stream2.responseReadable, c); + (async () => { + try { + await cb(stream2); + } catch (e) { + if (e === void 0) { + } else if (e instanceof Error && onError) { + await onError(e, stream2); + } else { + console.error(e); + } + } finally { + stream2.close(); + } + })(); + return c.newResponse(stream2.responseReadable); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + stream +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/streaming/text.js b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/text.js new file mode 100644 index 0000000000000000000000000000000000000000..99354d2aebb695cde8aee1aeda47edc79dd5d3bc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/text.js @@ -0,0 +1,34 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var text_exports = {}; +__export(text_exports, { + streamText: () => streamText +}); +module.exports = __toCommonJS(text_exports); +var import_context = require("../../context"); +var import__ = require("./"); +const streamText = (c, cb, onError) => { + c.header("Content-Type", import_context.TEXT_PLAIN); + c.header("X-Content-Type-Options", "nosniff"); + c.header("Transfer-Encoding", "chunked"); + return (0, import__.stream)(c, cb, onError); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + streamText +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/streaming/utils.js b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..3fb0ee43440b3cd32cb7c778dc30c3ccacfd4400 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/streaming/utils.js @@ -0,0 +1,35 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + isOldBunVersion: () => isOldBunVersion +}); +module.exports = __toCommonJS(utils_exports); +let isOldBunVersion = () => { + const version = typeof Bun !== "undefined" ? Bun.version : void 0; + if (version === void 0) { + return false; + } + const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0."); + isOldBunVersion = () => result; + return result; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + isOldBunVersion +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/testing/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/testing/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1279624d4242898883336a0bca254b58e57cc5d6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/testing/index.js @@ -0,0 +1,33 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var testing_exports = {}; +__export(testing_exports, { + testClient: () => testClient +}); +module.exports = __toCommonJS(testing_exports); +var import_client = require("../../client"); +const testClient = (app, Env, executionCtx, options) => { + const customFetch = (input, init) => { + return app.request(input, init, Env, executionCtx); + }; + return (0, import_client.hc)("http://localhost", { ...options, fetch: customFetch }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + testClient +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/helper/websocket/index.js b/tools/ui/node_modules/hono/dist/cjs/helper/websocket/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f9323687a4acf89894cdc64ca8830909a9495f7d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/helper/websocket/index.js @@ -0,0 +1,81 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var websocket_exports = {}; +__export(websocket_exports, { + WSContext: () => WSContext, + createWSMessageEvent: () => createWSMessageEvent, + defineWebSocketHelper: () => defineWebSocketHelper +}); +module.exports = __toCommonJS(websocket_exports); +class WSContext { + #init; + constructor(init) { + this.#init = init; + this.raw = init.raw; + this.url = init.url ? new URL(init.url) : null; + this.protocol = init.protocol ?? null; + } + send(source, options) { + this.#init.send(source, options ?? {}); + } + raw; + binaryType = "arraybuffer"; + get readyState() { + return this.#init.readyState; + } + url; + protocol; + close(code, reason) { + this.#init.close(code, reason); + } +} +const createWSMessageEvent = (source) => { + return new MessageEvent("message", { + data: source + }); +}; +const defineWebSocketHelper = (handler) => { + return ((...args) => { + if (typeof args[0] === "function") { + const [createEvents, options] = args; + return async function upgradeWebSocket(c, next) { + const events = await createEvents(c); + const result = await handler(c, events, options); + if (result) { + return result; + } + await next(); + }; + } else { + const [c, events, options] = args; + return (async () => { + const upgraded = await handler(c, events, options); + if (!upgraded) { + throw new Error("Failed to upgrade WebSocket"); + } + return upgraded; + })(); + } + }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + WSContext, + createWSMessageEvent, + defineWebSocketHelper +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/hono-base.js b/tools/ui/node_modules/hono/dist/cjs/hono-base.js new file mode 100644 index 0000000000000000000000000000000000000000..baf685398275a693d2f2fcad26b4f4959cbaee0b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/hono-base.js @@ -0,0 +1,406 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var hono_base_exports = {}; +__export(hono_base_exports, { + HonoBase: () => Hono +}); +module.exports = __toCommonJS(hono_base_exports); +var import_compose = require("./compose"); +var import_context = require("./context"); +var import_router = require("./router"); +var import_constants = require("./utils/constants"); +var import_url = require("./utils/url"); +const notFoundHandler = (c) => { + return c.text("404 Not Found", 404); +}; +const errorHandler = (err, c) => { + if ("getResponse" in err) { + const res = err.getResponse(); + return c.newResponse(res.body, res); + } + console.error(err); + return c.text("Internal Server Error", 500); +}; +class Hono { + get; + post; + put; + delete; + options; + patch; + query; + all; + on; + use; + /* + This class is like an abstract class and does not have a router. + To use it, inherit the class and implement router in the constructor. + */ + router; + getPath; + // Cannot use `#` because it requires visibility at JavaScript runtime. + _basePath = "/"; + #path = "/"; + routes = []; + constructor(options = {}) { + const allMethods = [...import_router.METHODS, import_router.METHOD_NAME_ALL_LOWERCASE]; + allMethods.forEach((method) => { + this[method] = (args1, ...args) => { + if (typeof args1 === "string") { + this.#path = args1; + } else { + this.#addRoute(method, this.#path, args1); + } + args.forEach((handler) => { + this.#addRoute(method, this.#path, handler); + }); + return this; + }; + }); + this.on = (method, path, ...handlers) => { + for (const p of [path].flat()) { + this.#path = p; + for (const m of [method].flat()) { + handlers.map((handler) => { + this.#addRoute(m.toUpperCase(), this.#path, handler); + }); + } + } + return this; + }; + this.use = (arg1, ...handlers) => { + if (typeof arg1 === "string") { + this.#path = arg1; + } else { + this.#path = "*"; + handlers.unshift(arg1); + } + handlers.forEach((handler) => { + this.#addRoute(import_router.METHOD_NAME_ALL, this.#path, handler); + }); + return this; + }; + const { strict, ...optionsWithoutStrict } = options; + Object.assign(this, optionsWithoutStrict); + this.getPath = strict ?? true ? options.getPath ?? import_url.getPath : import_url.getPathNoStrict; + } + #clone() { + const clone = new Hono({ + router: this.router, + getPath: this.getPath + }); + clone.errorHandler = this.errorHandler; + clone.#notFoundHandler = this.#notFoundHandler; + clone.routes = this.routes; + return clone; + } + #notFoundHandler = notFoundHandler; + // Cannot use `#` because it requires visibility at JavaScript runtime. + errorHandler = errorHandler; + /** + * `.route()` allows grouping other Hono instance in routes. + * + * @see {@link https://hono.dev/docs/api/routing#grouping} + * + * @param {string} path - base Path + * @param {Hono} app - other Hono instance + * @returns {Hono} routed Hono instance + * + * @example + * ```ts + * const app = new Hono() + * const app2 = new Hono() + * + * app2.get("/user", (c) => c.text("user")) + * app.route("/api", app2) // GET /api/user + * ``` + */ + route(path, app) { + const subApp = this.basePath(path); + app.routes.map((r) => { + let handler; + if (app.errorHandler === errorHandler) { + handler = r.handler; + } else { + handler = async (c, next) => (await (0, import_compose.compose)([], app.errorHandler)(c, () => r.handler(c, next))).res; + handler[import_constants.COMPOSED_HANDLER] = r.handler; + } + subApp.#addRoute(r.method, r.path, handler, r.basePath); + }); + return this; + } + /** + * `.basePath()` allows base paths to be specified. + * + * @see {@link https://hono.dev/docs/api/routing#base-path} + * + * @param {string} path - base Path + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * const api = new Hono().basePath('/api') + * ``` + */ + basePath(path) { + const subApp = this.#clone(); + subApp._basePath = (0, import_url.mergePath)(this._basePath, path); + return subApp; + } + /** + * `.onError()` handles an error and returns a customized Response. + * + * @see {@link https://hono.dev/docs/api/hono#error-handling} + * + * @param {ErrorHandler} handler - request Handler for error + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * app.onError((err, c) => { + * console.error(`${err}`) + * return c.text('Custom Error Message', 500) + * }) + * ``` + */ + onError = (handler) => { + this.errorHandler = handler; + return this; + }; + /** + * `.notFound()` allows you to customize a Not Found Response. + * + * @see {@link https://hono.dev/docs/api/hono#not-found} + * + * @param {NotFoundHandler} handler - request handler for not-found + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * app.notFound((c) => { + * return c.text('Custom 404 Message', 404) + * }) + * ``` + */ + notFound = (handler) => { + this.#notFoundHandler = handler; + return this; + }; + /** + * `.mount()` allows you to mount applications built with other frameworks into your Hono application. + * + * @see {@link https://hono.dev/docs/api/hono#mount} + * + * @param {string} path - base Path + * @param {Function} applicationHandler - other Request Handler + * @param {MountOptions} [options] - options of `.mount()` + * @returns {Hono} mounted Hono instance + * + * @example + * ```ts + * import { Router as IttyRouter } from 'itty-router' + * import { Hono } from 'hono' + * // Create itty-router application + * const ittyRouter = IttyRouter() + * // GET /itty-router/hello + * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) + * + * const app = new Hono() + * app.mount('/itty-router', ittyRouter.handle) + * ``` + * + * @example + * ```ts + * const app = new Hono() + * // Send the request to another application without modification. + * app.mount('/app', anotherApp, { + * replaceRequest: (req) => req, + * }) + * ``` + */ + mount(path, applicationHandler, options) { + let replaceRequest; + let optionHandler; + if (options) { + if (typeof options === "function") { + optionHandler = options; + } else { + optionHandler = options.optionHandler; + if (options.replaceRequest === false) { + replaceRequest = (request) => request; + } else { + replaceRequest = options.replaceRequest; + } + } + } + const getOptions = optionHandler ? (c) => { + const options2 = optionHandler(c); + return Array.isArray(options2) ? options2 : [options2]; + } : (c) => { + let executionContext = void 0; + try { + executionContext = c.executionCtx; + } catch { + } + return [c.env, executionContext]; + }; + replaceRequest ||= (() => { + const mergedPath = (0, import_url.mergePath)(this._basePath, path); + const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; + return (request) => { + const url = new URL(request.url); + url.pathname = this.getPath(request).slice(pathPrefixLength) || "/"; + return new Request(url, request); + }; + })(); + const handler = async (c, next) => { + const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c)); + if (res) { + return res; + } + await next(); + }; + this.#addRoute(import_router.METHOD_NAME_ALL, (0, import_url.mergePath)(path, "*"), handler); + return this; + } + #addRoute(method, path, handler, baseRoutePath) { + method = method.toUpperCase(); + path = (0, import_url.mergePath)(this._basePath, path); + const r = { + basePath: baseRoutePath !== void 0 ? (0, import_url.mergePath)(this._basePath, baseRoutePath) : this._basePath, + path, + method, + handler + }; + this.router.add(method, path, [handler, r]); + this.routes.push(r); + } + #handleError(err, c) { + if (err instanceof Error) { + return this.errorHandler(err, c); + } + throw err; + } + #dispatch(request, executionCtx, env, method) { + if (method === "HEAD") { + return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))(); + } + const path = this.getPath(request, { env }); + const matchResult = this.router.match(method, path); + const c = new import_context.Context(request, { + path, + matchResult, + env, + executionCtx, + notFoundHandler: this.#notFoundHandler + }); + if (matchResult[0].length === 1) { + let res; + try { + res = matchResult[0][0][0][0](c, async () => { + c.res = await this.#notFoundHandler(c); + }); + } catch (err) { + return this.#handleError(err, c); + } + return res instanceof Promise ? res.then( + (resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c)) + ).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c); + } + const composed = (0, import_compose.compose)(matchResult[0], this.errorHandler, this.#notFoundHandler); + return (async () => { + try { + const context = await composed(c); + if (!context.finalized) { + throw new Error( + "Context is not finalized. Did you forget to return a Response object or `await next()`?" + ); + } + return context.res; + } catch (err) { + return this.#handleError(err, c); + } + })(); + } + /** + * `.fetch()` will be entry point of your app. + * + * @see {@link https://hono.dev/docs/api/hono#fetch} + * + * @param {Request} request - request Object of request + * @param {Env} env - env Object + * @param {ExecutionContext} executionCtx - context of execution + * @returns {Response | Promise} response of request + * + */ + fetch = (request, ...rest) => { + return this.#dispatch(request, rest[1], rest[0], request.method); + }; + /** + * `.request()` is a useful method for testing. + * You can pass a URL or pathname to send a GET request. + * app will return a Response object. + * ```ts + * test('GET /hello is ok', async () => { + * const res = await app.request('/hello') + * expect(res.status).toBe(200) + * }) + * ``` + * @see https://hono.dev/docs/api/hono#request + */ + request = (input, requestInit, Env, executionCtx) => { + if (input instanceof Request) { + return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx); + } + input = input.toString(); + return this.fetch( + new Request( + /^https?:\/\//.test(input) ? input : `http://localhost${(0, import_url.mergePath)("/", input)}`, + requestInit + ), + Env, + executionCtx + ); + }; + /** + * `.fire()` automatically adds a global fetch event listener. + * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. + * @deprecated + * Use `fire` from `hono/service-worker` instead. + * ```ts + * import { Hono } from 'hono' + * import { fire } from 'hono/service-worker' + * + * const app = new Hono() + * // ... + * fire(app) + * ``` + * @see https://hono.dev/docs/api/hono#fire + * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API + * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ + */ + fire = () => { + addEventListener("fetch", (event) => { + event.respondWith(this.#dispatch(event.request, event, void 0, event.request.method)); + }); + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HonoBase +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/hono.js b/tools/ui/node_modules/hono/dist/cjs/hono.js new file mode 100644 index 0000000000000000000000000000000000000000..2ec24fffc63eef07a308188d902f07f5d2dea75d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/hono.js @@ -0,0 +1,43 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var hono_exports = {}; +__export(hono_exports, { + Hono: () => Hono +}); +module.exports = __toCommonJS(hono_exports); +var import_hono_base = require("./hono-base"); +var import_reg_exp_router = require("./router/reg-exp-router"); +var import_smart_router = require("./router/smart-router"); +var import_trie_router = require("./router/trie-router"); +class Hono extends import_hono_base.HonoBase { + /** + * Creates an instance of the Hono class. + * + * @param options - Optional configuration options for the Hono instance. + */ + constructor(options = {}) { + super(options); + this.router = options.router ?? new import_smart_router.SmartRouter({ + routers: [new import_reg_exp_router.RegExpRouter(), new import_trie_router.TrieRouter()] + }); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Hono +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/http-exception.js b/tools/ui/node_modules/hono/dist/cjs/http-exception.js new file mode 100644 index 0000000000000000000000000000000000000000..6863e70bcf7a6a1e46d342e5c876ddcc435c59b4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/http-exception.js @@ -0,0 +1,57 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var http_exception_exports = {}; +__export(http_exception_exports, { + HTTPException: () => HTTPException +}); +module.exports = __toCommonJS(http_exception_exports); +class HTTPException extends Error { + res; + status; + /** + * Creates an instance of `HTTPException`. + * @param status - HTTP status code for the exception. Defaults to 500. + * @param options - Additional options for the exception. + */ + constructor(status = 500, options) { + super(options?.message, { cause: options?.cause }); + this.res = options?.res; + this.status = status; + } + /** + * Returns the response object associated with the exception. + * If a response object is not provided, a new response is created with the error message and status code. + * @returns The response object. + */ + getResponse() { + if (this.res) { + const newResponse = new Response(this.res.body, { + status: this.status, + headers: this.res.headers + }); + return newResponse; + } + return new Response(this.message, { + status: this.status + }); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HTTPException +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/index.js b/tools/ui/node_modules/hono/dist/cjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..eaa02355fc5738efa492cc85b708a0e868307605 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/index.js @@ -0,0 +1,30 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var index_exports = {}; +__export(index_exports, { + Context: () => import_context.Context, + Hono: () => import_hono.Hono +}); +module.exports = __toCommonJS(index_exports); +var import_hono = require("./hono"); +var import_context = require("./context"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Context, + Hono +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/base.js b/tools/ui/node_modules/hono/dist/cjs/jsx/base.js new file mode 100644 index 0000000000000000000000000000000000000000..b9214e08df7eaeebf15ce46276c60a6050a9e9e6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/base.js @@ -0,0 +1,378 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var base_exports = {}; +__export(base_exports, { + Fragment: () => Fragment, + JSXFragmentNode: () => JSXFragmentNode, + JSXNode: () => JSXNode, + booleanAttributes: () => booleanAttributes, + cloneElement: () => cloneElement, + getNameSpaceContext: () => getNameSpaceContext, + isValidElement: () => isValidElement, + jsx: () => jsx, + jsxFn: () => jsxFn, + memo: () => memo, + reactAPICompatVersion: () => reactAPICompatVersion, + shallowEqual: () => shallowEqual +}); +module.exports = __toCommonJS(base_exports); +var import_html = require("../helper/html"); +var import_html2 = require("../utils/html"); +var import_constants = require("./constants"); +var import_context = require("./context"); +var import_common = require("./intrinsic-element/common"); +var intrinsicElementTags = __toESM(require("./intrinsic-element/components"), 1); +var import_utils = require("./utils"); +let nameSpaceContext = void 0; +const getNameSpaceContext = () => nameSpaceContext; +const toSVGAttributeName = (key) => /[A-Z]/.test(key) && // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. +// Or other un-deprecated kebab-case attributes. "overline-position", "paint-order", "strikethrough-position", etc. +key.match( + /^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/ +) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; +const emptyTags = [ + "area", + "base", + "br", + "col", + "embed", + "hr", + "img", + "input", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr" +]; +const booleanAttributes = [ + "allowfullscreen", + "async", + "autofocus", + "autoplay", + "checked", + "controls", + "default", + "defer", + "disabled", + "download", + "formnovalidate", + "hidden", + "inert", + "ismap", + "itemscope", + "loop", + "multiple", + "muted", + "nomodule", + "novalidate", + "open", + "playsinline", + "readonly", + "required", + "reversed", + "selected" +]; +const resolveFunctionComponentResult = (result, suspendedContext) => result.then((resolved) => { + if (!Array.isArray(resolved) && !(resolved instanceof JSXNode)) { + return resolved; + } + const children = Array.isArray(resolved) ? resolved : [resolved]; + const render = () => { + const buffer = [""]; + childrenToStringToBuffer(children, buffer); + return buffer.length === 1 ? (0, import_html.raw)(buffer[0], buffer.callbacks) : (0, import_html2.stringBufferToString)(buffer, buffer.callbacks); + }; + return suspendedContext ? suspendedContext(render) : (0, import_context.runWithRenderContext)(render); +}); +const childrenToStringToBuffer = (children, buffer) => { + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if (typeof child === "string") { + (0, import_html2.escapeToBuffer)(child, buffer); + } else if (typeof child === "boolean" || child === null || child === void 0) { + continue; + } else if (child instanceof JSXNode) { + child.toStringToBuffer(buffer); + } else if (typeof child === "number") { + ; + buffer[0] += child; + } else if (child.isEscaped) { + ; + buffer[0] += child; + const callbacks = child.callbacks; + if (callbacks) { + buffer.callbacks ||= []; + buffer.callbacks.push(...callbacks); + } + } else if (child instanceof Promise) { + buffer.unshift("", child); + } else { + childrenToStringToBuffer(child, buffer); + } + } +}; +class JSXNode { + tag; + props; + key; + children; + isEscaped = true; + constructor(tag, props, children) { + if (typeof tag !== "function" && !(0, import_utils.isValidTagName)(tag)) { + throw new Error(`Invalid JSX tag name: ${tag}`); + } + this.tag = tag; + this.props = props; + this.children = children; + } + get type() { + return this.tag; + } + // Added for compatibility with libraries that rely on React's internal structure + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get ref() { + return this.props.ref || null; + } + toString() { + const render = () => { + const buffer = [""]; + this.toStringToBuffer(buffer); + return buffer.length === 1 ? "callbacks" in buffer ? (0, import_html2.resolveCallbackSync)((0, import_html.raw)(buffer[0], buffer.callbacks)).toString() : buffer[0] : (0, import_html2.stringBufferToString)(buffer, buffer.callbacks); + }; + return (0, import_context.runWithRenderContext)(render); + } + toStringToBuffer(buffer) { + const tag = this.tag; + const props = this.props; + let { children } = this; + buffer[0] += `<${tag}`; + const normalizeKey = tag === "svg" || nameSpaceContext && (0, import_context.useContext)(nameSpaceContext) === "svg" ? (key) => toSVGAttributeName((0, import_utils.normalizeIntrinsicElementKey)(key)) : (key) => (0, import_utils.normalizeIntrinsicElementKey)(key); + for (let [key, v] of Object.entries(props)) { + key = normalizeKey(key); + if (!(0, import_utils.isValidAttributeName)(key)) { + continue; + } + if (key === "children") { + } else if (key === "style" && typeof v === "object") { + let styleStr = ""; + (0, import_utils.styleObjectForEach)(v, (property, value) => { + if (value != null) { + styleStr += `${styleStr ? ";" : ""}${property}:${value}`; + } + }); + buffer[0] += ' style="'; + (0, import_html2.escapeToBuffer)(styleStr, buffer); + buffer[0] += '"'; + } else if (typeof v === "string") { + buffer[0] += ` ${key}="`; + (0, import_html2.escapeToBuffer)(v, buffer); + buffer[0] += '"'; + } else if (v === null || v === void 0) { + } else if (typeof v === "number" || v.isEscaped) { + buffer[0] += ` ${key}="${v}"`; + } else if (typeof v === "boolean" && booleanAttributes.includes(key)) { + if (v) { + buffer[0] += ` ${key}=""`; + } + } else if (key === "dangerouslySetInnerHTML") { + if (children.length > 0) { + throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); + } + children = [(0, import_html.raw)(v.__html)]; + } else if (v instanceof Promise) { + buffer[0] += ` ${key}="`; + buffer.unshift('"', v); + } else if (typeof v === "function") { + if (!key.startsWith("on") && key !== "ref") { + throw new Error(`Invalid prop '${key}' of type 'function' supplied to '${tag}'.`); + } + } else { + buffer[0] += ` ${key}="`; + (0, import_html2.escapeToBuffer)(v.toString(), buffer); + buffer[0] += '"'; + } + } + if (emptyTags.includes(tag) && children.length === 0) { + buffer[0] += "/>"; + return; + } + buffer[0] += ">"; + childrenToStringToBuffer(children, buffer); + buffer[0] += ``; + } +} +class JSXFunctionNode extends JSXNode { + toStringToBuffer(buffer) { + const { children } = this; + const props = { ...this.props }; + if (children.length) { + props.children = children.length === 1 ? children[0] : children; + } + const res = this.tag.call(null, props); + if (typeof res === "boolean" || res == null) { + return; + } else if (res instanceof Promise) { + if (import_context.globalContexts.length === 0) { + buffer.unshift("", resolveFunctionComponentResult(res)); + } else { + buffer.unshift("", resolveFunctionComponentResult(res, (0, import_context.captureRenderContext)())); + } + } else if (res instanceof JSXNode) { + res.toStringToBuffer(buffer); + } else if (Array.isArray(res)) { + childrenToStringToBuffer(res, buffer); + } else if (typeof res === "number" || res.isEscaped) { + buffer[0] += res; + if (res.callbacks) { + buffer.callbacks ||= []; + buffer.callbacks.push(...res.callbacks); + } + } else { + (0, import_html2.escapeToBuffer)(res, buffer); + } + } +} +class JSXFragmentNode extends JSXNode { + toStringToBuffer(buffer) { + childrenToStringToBuffer(this.children, buffer); + } +} +const jsx = (tag, props, ...children) => { + props ??= {}; + if (children.length) { + props.children = children.length === 1 ? children[0] : children; + } + const key = props.key; + delete props["key"]; + const node = jsxFn(tag, props, children); + node.key = key; + return node; +}; +let initDomRenderer = false; +const jsxFn = (tag, props, children) => { + if (!initDomRenderer) { + for (const k in import_common.domRenderers) { + ; + intrinsicElementTags[k][import_constants.DOM_RENDERER] = import_common.domRenderers[k]; + } + initDomRenderer = true; + } + if (typeof tag === "function") { + return new JSXFunctionNode(tag, props, children); + } else if (intrinsicElementTags[tag]) { + return new JSXFunctionNode( + intrinsicElementTags[tag], + props, + children + ); + } else if (tag === "svg" || tag === "head") { + nameSpaceContext ||= (0, import_context.createContext)(""); + return new JSXNode(tag, props, [ + new JSXFunctionNode( + nameSpaceContext, + { + value: tag + }, + children + ) + ]); + } else { + return new JSXNode(tag, props, children); + } +}; +const shallowEqual = (a, b) => { + if (a === b) { + return true; + } + const aKeys = Object.keys(a).sort(); + const bKeys = Object.keys(b).sort(); + if (aKeys.length !== bKeys.length) { + return false; + } + for (let i = 0, len = aKeys.length; i < len; i++) { + if (aKeys[i] === "children" && bKeys[i] === "children" && !a.children?.length && !b.children?.length) { + continue; + } else if (a[aKeys[i]] !== b[aKeys[i]]) { + return false; + } + } + return true; +}; +const memo = (component, propsAreEqual = shallowEqual) => { + const wrapper = ((props) => component(props)); + wrapper[import_constants.DOM_MEMO] = propsAreEqual; + wrapper[import_constants.DOM_RENDERER] = component; + return wrapper; +}; +const Fragment = ({ + children +}) => { + return new JSXFragmentNode( + "", + { + children + }, + Array.isArray(children) ? children : children ? [children] : [] + ); +}; +const isValidElement = (element) => { + return !!(element && typeof element === "object" && "tag" in element && "props" in element); +}; +const cloneElement = (element, props, ...children) => { + let childrenToClone; + if (children.length > 0) { + childrenToClone = children; + } else { + const c = element.props.children; + childrenToClone = Array.isArray(c) ? c : [c]; + } + return jsx( + element.tag, + { ...element.props, ...props }, + ...childrenToClone + ); +}; +const reactAPICompatVersion = "19.0.0-hono-jsx"; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Fragment, + JSXFragmentNode, + JSXNode, + booleanAttributes, + cloneElement, + getNameSpaceContext, + isValidElement, + jsx, + jsxFn, + memo, + reactAPICompatVersion, + shallowEqual +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/children.js b/tools/ui/node_modules/hono/dist/cjs/jsx/children.js new file mode 100644 index 0000000000000000000000000000000000000000..a11110734eeb4a7a224a428e84af75d62be0f9e1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/children.js @@ -0,0 +1,44 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var children_exports = {}; +__export(children_exports, { + Children: () => Children, + toArray: () => toArray +}); +module.exports = __toCommonJS(children_exports); +const toArray = (children) => Array.isArray(children) ? children : [children]; +const Children = { + map: (children, fn) => toArray(children).map(fn), + forEach: (children, fn) => { + toArray(children).forEach(fn); + }, + count: (children) => toArray(children).length, + only: (_children) => { + const children = toArray(_children); + if (children.length !== 1) { + throw new Error("Children.only() expects only one child"); + } + return children[0]; + }, + toArray +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Children, + toArray +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/components.js b/tools/ui/node_modules/hono/dist/cjs/jsx/components.js new file mode 100644 index 0000000000000000000000000000000000000000..42863af90b7152d73b60d453ae11f899f67b4dcf --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/components.js @@ -0,0 +1,221 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var components_exports = {}; +__export(components_exports, { + ErrorBoundary: () => ErrorBoundary, + childrenToString: () => childrenToString +}); +module.exports = __toCommonJS(components_exports); +var import_html = require("../helper/html"); +var import_html2 = require("../utils/html"); +var import_base = require("./base"); +var import_constants = require("./constants"); +var import_context = require("./context"); +var import_components = require("./dom/components"); +var import_streaming = require("./streaming"); +let errorBoundaryCounter = 0; +const childrenToString = async (children) => { + try { + return children.flat().map((c) => c == null || typeof c === "boolean" ? "" : c.toString()); + } catch (e) { + if (e instanceof Promise) { + const resume = (0, import_context.captureRenderContext)(); + await e; + return resume(() => childrenToString(children)); + } else { + throw e; + } + } +}; +const resolveChildEarly = (c) => { + if (c == null || typeof c === "boolean") { + return ""; + } else if (typeof c === "string") { + return c; + } else { + const str = c.toString(); + if (!(str instanceof Promise)) { + return (0, import_html.raw)(str); + } else { + return str; + } + } +}; +const ErrorBoundary = async ({ children, fallback, fallbackRender, onError }) => { + if (!children) { + return (0, import_html.raw)(""); + } + if (!Array.isArray(children)) { + children = [children]; + } + const nonce = (0, import_context.useContext)(import_streaming.StreamingContext)?.scriptNonce; + let resume; + const getResume = () => resume ||= (0, import_context.captureRenderContext)(); + let fallbackStrPromise; + const resolveFallbackStr = () => fallbackStrPromise ||= (async () => { + const awaitedFallback = await fallback; + if (typeof awaitedFallback === "string") { + return awaitedFallback; + } else { + const fallbackResult = await getResume()(() => awaitedFallback?.toString()); + if (typeof fallbackResult === "string") { + return (0, import_html.raw)( + fallbackResult, + fallbackResult.callbacks || awaitedFallback?.callbacks + ); + } + } + })(); + const renderFallback = async (error) => { + const fallbackStr = await resolveFallbackStr(); + return getResume()(async () => { + onError?.(error); + const fallbackRes = fallbackStr !== void 0 ? fallbackStr : fallbackRender && (0, import_base.jsx)(import_base.Fragment, {}, fallbackRender(error)) || ""; + const fallbackResString = await (0, import_base.Fragment)({ + children: fallbackRes + }).toString(); + return (0, import_html.raw)( + fallbackResString, + fallbackResString.callbacks || fallbackRes.callbacks + ); + }); + }; + let resArray = []; + try { + resArray = children.map(resolveChildEarly); + } catch (e) { + const resume2 = getResume(); + if (e instanceof Promise) { + resArray = [ + e.then(() => resume2(() => childrenToString(children))).catch((e2) => renderFallback(e2)) + ]; + } else { + resArray = [await renderFallback(e)]; + } + } + if (resArray.some((res) => res instanceof Promise)) { + getResume(); + const index = errorBoundaryCounter++; + const replaceRe = RegExp(`(.*?)(.*?)()`); + let caught = false; + const catchCallback = async ({ error: error2, buffer }) => { + if (caught) { + return ""; + } + caught = true; + const fallbackResString = await renderFallback(error2); + const fallbackCallbacks = fallbackResString.callbacks; + if (buffer) { + buffer[0] = buffer[0].replace(replaceRe, fallbackResString); + return fallbackCallbacks?.length ? (0, import_html.raw)("", fallbackCallbacks) : ""; + } + return (0, import_html.raw)( + ``, + fallbackCallbacks + ); + }; + let error; + const promiseAll = Promise.all(resArray).catch((e) => error = e); + return (0, import_html.raw)(``, [ + ({ phase, buffer, context }) => { + if (phase === import_html2.HtmlEscapedCallbackPhase.BeforeStream) { + return; + } + return promiseAll.then(async (htmlArray) => { + if (error) { + throw error; + } + htmlArray = htmlArray.flat(); + const content = htmlArray.join(""); + let html = buffer ? "" : ` +((d,c) => { +c=d.currentScript.previousSibling +d=d.getElementById('E:${index}') +if(!d)return +d.parentElement.insertBefore(c.content,d.nextSibling) +})(document) +`; + if (htmlArray.every((html2) => !html2.callbacks?.length)) { + if (buffer) { + buffer[0] = buffer[0].replace(replaceRe, content); + } + return html; + } + if (buffer) { + buffer[0] = buffer[0].replace( + replaceRe, + (_all, pre, _, post) => `${pre}${content}${post}` + ); + } + const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); + if (phase === import_html2.HtmlEscapedCallbackPhase.Stream) { + html = await (0, import_html2.resolveCallback)( + html, + import_html2.HtmlEscapedCallbackPhase.BeforeStream, + true, + context + ); + } + let resolvedCount = 0; + const promises = callbacks.map( + (c) => (...args) => c(...args)?.then((content2) => { + resolvedCount++; + if (buffer) { + if (resolvedCount === callbacks.length) { + buffer[0] = buffer[0].replace(replaceRe, (_all, _pre, content3) => content3); + } + buffer[0] += content2; + return (0, import_html.raw)("", content2.callbacks); + } + return (0, import_html.raw)( + content2 + (resolvedCount !== callbacks.length ? "" : ``), + content2.callbacks + ); + }).catch((error2) => catchCallback({ error: error2, buffer })) + ); + return (0, import_html.raw)(html, promises); + }).catch((error2) => catchCallback({ error: error2, buffer })); + } + ]); + } else { + return (0, import_base.Fragment)({ children: resArray }); + } +}; +ErrorBoundary[import_constants.DOM_RENDERER] = import_components.ErrorBoundary; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ErrorBoundary, + childrenToString +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/constants.js b/tools/ui/node_modules/hono/dist/cjs/jsx/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..86d57a8d209171afc81e8fd39c65ff6496ee4d79 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/constants.js @@ -0,0 +1,42 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var constants_exports = {}; +__export(constants_exports, { + DOM_ERROR_HANDLER: () => DOM_ERROR_HANDLER, + DOM_INTERNAL_TAG: () => DOM_INTERNAL_TAG, + DOM_MEMO: () => DOM_MEMO, + DOM_RENDERER: () => DOM_RENDERER, + DOM_STASH: () => DOM_STASH, + PERMALINK: () => PERMALINK +}); +module.exports = __toCommonJS(constants_exports); +const DOM_RENDERER = /* @__PURE__ */ Symbol("RENDERER"); +const DOM_ERROR_HANDLER = /* @__PURE__ */ Symbol("ERROR_HANDLER"); +const DOM_STASH = /* @__PURE__ */ Symbol("STASH"); +const DOM_INTERNAL_TAG = /* @__PURE__ */ Symbol("INTERNAL"); +const DOM_MEMO = /* @__PURE__ */ Symbol("MEMO"); +const PERMALINK = /* @__PURE__ */ Symbol("PERMALINK"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + DOM_ERROR_HANDLER, + DOM_INTERNAL_TAG, + DOM_MEMO, + DOM_RENDERER, + DOM_STASH, + PERMALINK +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/context.js b/tools/ui/node_modules/hono/dist/cjs/jsx/context.js new file mode 100644 index 0000000000000000000000000000000000000000..a8d060d45fc46574a9aece2e7de41145d6df09a1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/context.js @@ -0,0 +1,188 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var context_exports = {}; +__export(context_exports, { + captureRenderContext: () => captureRenderContext, + createContext: () => createContext, + globalContexts: () => globalContexts, + runWithRenderContext: () => runWithRenderContext, + useContext: () => useContext +}); +module.exports = __toCommonJS(context_exports); +var import_html = require("../helper/html"); +var import_base = require("./base"); +var import_constants = require("./constants"); +var import_context = require("./dom/context"); +const globalContexts = []; +let alsProbed = false; +let asyncLocalStorage; +let fallbackStore; +let fallbackRendersInFlight = 0; +let warnedFallbackDefault = false; +const loadAsyncLocalStorage = () => { + if (alsProbed) { + return asyncLocalStorage; + } + alsProbed = true; + const global = globalThis; + let AsyncLocalStorage; + for (const probe of [ + // Node.js >= 20.16, Deno, Bun, Cloudflare Workers (nodejs_compat). Property + // access only, so bundlers don't statically resolve `node:async_hooks`. + () => global.process?.getBuiltinModule?.("node:async_hooks")?.AsyncLocalStorage, + // Node.js < 20.16 has no `process.getBuiltinModule`, but a CJS entrypoint + // exposes the main module's `require` here. + () => global.process?.mainModule?.require?.("node:async_hooks")?.AsyncLocalStorage + ]) { + try { + AsyncLocalStorage = probe(); + } catch { + } + if (AsyncLocalStorage) { + break; + } + } + if (AsyncLocalStorage) { + asyncLocalStorage = new AsyncLocalStorage(); + } + return asyncLocalStorage; +}; +const getCurrentStore = () => { + return loadAsyncLocalStorage()?.getStore() || fallbackStore; +}; +const warnIfStorelessAccess = () => { + if (fallbackRendersInFlight > 0 && !warnedFallbackDefault) { + warnedFallbackDefault = true; + console.warn( + "hono/jsx: AsyncLocalStorage is unavailable in this runtime, so useContext() after an await in an async component falls back to the context default value during server-side rendering. To get provided values across await boundaries, use a runtime with AsyncLocalStorage (Node.js >= 20.16, Deno, Bun, or Cloudflare Workers with the nodejs_compat flag)." + ); + } +}; +const getContextValuesIn = (store, context) => { + if (!store) { + warnIfStorelessAccess(); + return context.values; + } + let values = store.get(context); + if (!values) { + values = [context.values[0]]; + store.set(context, values); + } + return values; +}; +const readContextValueIn = (store, context) => { + if (!store) { + warnIfStorelessAccess(); + return context.values.at(-1); + } + const values = store.get(context); + return values?.length ? values.at(-1) : context.values[0]; +}; +const captureContextValues = (store) => (store ? globalContexts.filter((c) => store.has(c)) : globalContexts).map((c) => [ + c, + readContextValueIn(store, c) +]); +const resumeWithContextValues = (callback, store, contexts) => runWithRenderContext(() => { + const currentStore = getCurrentStore(); + const valuesPerContext = contexts.map(([context, value]) => { + const values = getContextValuesIn(currentStore, context); + values.push(value); + return values; + }); + const popContextValues = () => { + valuesPerContext.forEach((values) => { + values.pop(); + }); + }; + try { + const result = callback(); + if (result instanceof Promise) { + return result.finally(popContextValues); + } + popContextValues(); + return result; + } catch (e) { + popContextValues(); + throw e; + } +}, store); +const runWithRenderContext = (callback, resumeStore) => { + if (getCurrentStore()) { + return callback(); + } + const store = resumeStore ?? /* @__PURE__ */ new WeakMap(); + const storage = loadAsyncLocalStorage(); + if (storage) { + return storage.run(store, callback); + } + fallbackStore = store; + let result; + try { + result = callback(); + } finally { + fallbackStore = void 0; + } + if (!warnedFallbackDefault && result instanceof Promise) { + fallbackRendersInFlight++; + result = result.finally(() => { + fallbackRendersInFlight--; + }); + } + return result; +}; +const captureRenderContext = () => { + const store = getCurrentStore(); + const contexts = captureContextValues(store); + return (callback) => resumeWithContextValues(callback, store, contexts); +}; +const createContext = (defaultValue) => { + const values = [defaultValue]; + const context = ((props) => { + const contextValues = getContextValuesIn(getCurrentStore(), context); + contextValues.push(props.value); + let string; + try { + string = props.children ? (Array.isArray(props.children) ? new import_base.JSXFragmentNode("", {}, props.children) : props.children).toString() : ""; + } catch (e) { + contextValues.pop(); + throw e; + } + if (string instanceof Promise) { + return string.finally(() => contextValues.pop()).then((resString) => (0, import_html.raw)(resString, resString.callbacks)); + } else { + contextValues.pop(); + return (0, import_html.raw)(string); + } + }); + context.values = values; + context.Provider = context; + context[import_constants.DOM_RENDERER] = (0, import_context.createContextProviderFunction)(values); + globalContexts.push(context); + return context; +}; +const useContext = (context) => { + return readContextValueIn(getCurrentStore(), context); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + captureRenderContext, + createContext, + globalContexts, + runWithRenderContext, + useContext +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/client.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/client.js new file mode 100644 index 0000000000000000000000000000000000000000..9fa7d04862aa346d0c8fcab9b374d27016402151 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/client.js @@ -0,0 +1,76 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var client_exports = {}; +__export(client_exports, { + createRoot: () => createRoot, + default: () => client_default, + hydrateRoot: () => hydrateRoot +}); +module.exports = __toCommonJS(client_exports); +var import_hooks = require("../hooks"); +var import_render = require("./render"); +const createRoot = (element, options = {}) => { + let setJsxNode = ( + // unmounted + void 0 + ); + if (Object.keys(options).length > 0) { + console.warn("createRoot options are not supported yet"); + } + return { + render(jsxNode) { + if (setJsxNode === null) { + throw new Error("Cannot update an unmounted root"); + } + if (setJsxNode) { + setJsxNode(jsxNode); + } else { + (0, import_render.renderNode)( + (0, import_render.buildNode)({ + tag: () => { + const [_jsxNode, _setJsxNode] = (0, import_hooks.useState)(jsxNode); + setJsxNode = _setJsxNode; + return _jsxNode; + }, + props: {} + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }), + element + ); + } + }, + unmount() { + setJsxNode?.(null); + setJsxNode = null; + } + }; +}; +const hydrateRoot = (element, reactNode, options = {}) => { + const root = createRoot(element, options); + root.render(reactNode); + return root; +}; +var client_default = { + createRoot, + hydrateRoot +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createRoot, + hydrateRoot +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/components.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/components.js new file mode 100644 index 0000000000000000000000000000000000000000..6e902280cb0bc8ed847bfd8348ed05ecfd34b1e4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/components.js @@ -0,0 +1,55 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var components_exports = {}; +__export(components_exports, { + ErrorBoundary: () => ErrorBoundary, + Suspense: () => Suspense +}); +module.exports = __toCommonJS(components_exports); +var import_constants = require("../constants"); +var import_jsx_runtime = require("./jsx-runtime"); +const ErrorBoundary = (({ children, fallback, fallbackRender, onError }) => { + const res = (0, import_jsx_runtime.Fragment)({ children }); + res[import_constants.DOM_ERROR_HANDLER] = (err) => { + if (err instanceof Promise) { + throw err; + } + onError?.(err); + return fallbackRender?.(err) || fallback; + }; + return res; +}); +const Suspense = (({ + children, + fallback +}) => { + const res = (0, import_jsx_runtime.Fragment)({ children }); + res[import_constants.DOM_ERROR_HANDLER] = (err, retry) => { + if (!(err instanceof Promise)) { + throw err; + } + err.finally(retry); + return fallback; + }; + return res; +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ErrorBoundary, + Suspense +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/context.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/context.js new file mode 100644 index 0000000000000000000000000000000000000000..079266fe30aed9a74a6ea982d70b2be5ec726b2f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/context.js @@ -0,0 +1,71 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var context_exports = {}; +__export(context_exports, { + createContext: () => createContext, + createContextProviderFunction: () => createContextProviderFunction +}); +module.exports = __toCommonJS(context_exports); +var import_constants = require("../constants"); +var import_context = require("../context"); +var import_utils = require("./utils"); +const createContextProviderFunction = (values) => ({ value, children }) => { + if (!children) { + return void 0; + } + const props = { + children: [ + { + tag: (0, import_utils.setInternalTagFlag)(() => { + values.push(value); + }), + props: {} + } + ] + }; + if (Array.isArray(children)) { + props.children.push(...children.flat()); + } else { + props.children.push(children); + } + props.children.push({ + tag: (0, import_utils.setInternalTagFlag)(() => { + values.pop(); + }), + props: {} + }); + const res = { tag: "", props, type: "" }; + res[import_constants.DOM_ERROR_HANDLER] = (err) => { + values.pop(); + throw err; + }; + return res; +}; +const createContext = (defaultValue) => { + const values = [defaultValue]; + const context = createContextProviderFunction(values); + context.values = values; + context.Provider = context; + import_context.globalContexts.push(context); + return context; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createContext, + createContextProviderFunction +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/css.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/css.js new file mode 100644 index 0000000000000000000000000000000000000000..f58c215a5eedf0cadaab4549c10c7c7fdc805ad7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/css.js @@ -0,0 +1,168 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var css_exports = {}; +__export(css_exports, { + Style: () => Style, + createCssContext: () => createCssContext, + createCssJsxDomObjects: () => createCssJsxDomObjects, + css: () => css, + cx: () => cx, + keyframes: () => keyframes, + rawCssString: () => import_common2.rawCssString, + viewTransition: () => viewTransition +}); +module.exports = __toCommonJS(css_exports); +var import_common = require("../../helper/css/common"); +var import_common2 = require("../../helper/css/common"); +const splitRule = (rule) => { + const result = []; + let startPos = 0; + let depth = 0; + for (let i = 0, len = rule.length; i < len; i++) { + const char = rule[i]; + if (char === "'" || char === '"') { + const quote = char; + i++; + for (; i < len; i++) { + if (rule[i] === "\\") { + i++; + continue; + } + if (rule[i] === quote) { + break; + } + } + continue; + } + if (char === "{") { + depth++; + continue; + } + if (char === "}") { + depth--; + if (depth === 0) { + result.push(rule.slice(startPos, i + 1)); + startPos = i + 1; + } + continue; + } + } + return result; +}; +const createCssJsxDomObjects = ({ id }) => { + let styleSheet = void 0; + const findStyleSheet = () => { + if (!styleSheet) { + styleSheet = document.querySelector(`style#${id}`)?.sheet; + if (styleSheet) { + ; + styleSheet.addedStyles = /* @__PURE__ */ new Set(); + } + } + return styleSheet ? [styleSheet, styleSheet.addedStyles] : []; + }; + const insertRule = (className, styleString) => { + const [sheet, addedStyles] = findStyleSheet(); + if (!sheet || !addedStyles) { + Promise.resolve().then(() => { + if (!findStyleSheet()[0]) { + throw new Error("style sheet not found"); + } + insertRule(className, styleString); + }); + return; + } + if (!addedStyles.has(className)) { + addedStyles.add(className); + (className.startsWith(import_common.PSEUDO_GLOBAL_SELECTOR) ? splitRule(styleString) : [`${className[0] === "@" ? "" : "."}${className}{${styleString}}`]).forEach((rule) => { + sheet.insertRule(rule, sheet.cssRules.length); + }); + } + }; + const cssObject = { + toString() { + const selector = this[import_common.SELECTOR]; + insertRule(selector, this[import_common.STYLE_STRING]); + this[import_common.SELECTORS].forEach(({ [import_common.CLASS_NAME]: className, [import_common.STYLE_STRING]: styleString }) => { + insertRule(className, styleString); + }); + return this[import_common.CLASS_NAME]; + } + }; + const Style2 = ({ children, nonce }) => ({ + tag: "style", + props: { + id, + nonce, + children: children && (Array.isArray(children) ? children : [children]).map( + (c) => c[import_common.STYLE_STRING] + ) + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }); + return [cssObject, Style2]; +}; +const createCssContext = ({ + id, + classNameSlug, + onInvalidSlug +}) => { + const [cssObject, Style2] = createCssJsxDomObjects({ id }); + const newCssClassNameObject = (cssClassName) => { + cssClassName.toString = cssObject.toString; + return cssClassName; + }; + const css2 = (strings, ...values) => { + return newCssClassNameObject((0, import_common.cssCommon)(strings, values, classNameSlug, onInvalidSlug)); + }; + const cx2 = (...args) => { + args = (0, import_common.cxCommon)(args); + return css2(Array(args.length).fill(""), ...args); + }; + const keyframes2 = (strings, ...values) => (0, import_common.keyframesCommon)(strings, values, classNameSlug, onInvalidSlug); + const viewTransition2 = ((strings, ...values) => { + return newCssClassNameObject( + (0, import_common.viewTransitionCommon)(strings, values, classNameSlug, onInvalidSlug) + // eslint-disable-line @typescript-eslint/no-explicit-any + ); + }); + return { + css: css2, + cx: cx2, + keyframes: keyframes2, + viewTransition: viewTransition2, + Style: Style2 + }; +}; +const defaultContext = createCssContext({ id: import_common.DEFAULT_STYLE_ID }); +const css = defaultContext.css; +const cx = defaultContext.cx; +const keyframes = defaultContext.keyframes; +const viewTransition = defaultContext.viewTransition; +const Style = defaultContext.Style; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Style, + createCssContext, + createCssJsxDomObjects, + css, + cx, + keyframes, + rawCssString, + viewTransition +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js new file mode 100644 index 0000000000000000000000000000000000000000..96c2f449cd3bbcda7c06ba6ff8b21d0a23bbabb1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js @@ -0,0 +1,74 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var hooks_exports = {}; +__export(hooks_exports, { + FormContext: () => FormContext, + registerAction: () => registerAction, + useActionState: () => useActionState, + useFormStatus: () => useFormStatus, + useOptimistic: () => useOptimistic +}); +module.exports = __toCommonJS(hooks_exports); +var import_constants = require("../../constants"); +var import_context = require("../../context"); +var import_hooks = require("../../hooks"); +var import_context2 = require("../context"); +const FormContext = (0, import_context2.createContext)({ + pending: false, + data: null, + method: null, + action: null +}); +const actions = /* @__PURE__ */ new Set(); +const registerAction = (action) => { + actions.add(action); + action.finally(() => actions.delete(action)); +}; +const useFormStatus = () => { + return (0, import_context.useContext)(FormContext); +}; +const useOptimistic = (state, updateState) => { + const [optimisticState, setOptimisticState] = (0, import_hooks.useState)(state); + if (actions.size > 0) { + Promise.all(actions).finally(() => { + setOptimisticState(state); + }); + } else { + setOptimisticState(state); + } + const cb = (0, import_hooks.useCallback)((newData) => { + setOptimisticState((currentState) => updateState(currentState, newData)); + }, []); + return [optimisticState, cb]; +}; +const useActionState = (fn, initialState, permalink) => { + const [state, setState] = (0, import_hooks.useState)(initialState); + const actionState = async (data) => { + setState(await fn(state, data)); + }; + actionState[import_constants.PERMALINK] = permalink; + return [state, actionState]; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + FormContext, + registerAction, + useActionState, + useFormStatus, + useOptimistic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/index.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/index.js new file mode 100644 index 0000000000000000000000000000000000000000..67dfc1d60197004b9767e938f12d643615bd1f06 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/index.js @@ -0,0 +1,181 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var dom_exports = {}; +__export(dom_exports, { + Children: () => import_children.Children, + ErrorBoundary: () => import_components.ErrorBoundary, + Fragment: () => import_jsx_runtime.Fragment, + StrictMode: () => import_jsx_runtime.Fragment, + Suspense: () => import_components.Suspense, + cloneElement: () => cloneElement, + createContext: () => import_context2.createContext, + createElement: () => createElement, + createPortal: () => import_render.createPortal, + createRef: () => import_hooks.createRef, + default: () => dom_default, + flushSync: () => import_render.flushSync, + forwardRef: () => import_hooks.forwardRef, + isValidElement: () => import_base.isValidElement, + jsx: () => createElement, + memo: () => memo, + render: () => import_render2.render, + startTransition: () => import_hooks.startTransition, + startViewTransition: () => import_hooks.startViewTransition, + use: () => import_hooks.use, + useActionState: () => import_hooks2.useActionState, + useCallback: () => import_hooks.useCallback, + useContext: () => import_context.useContext, + useDebugValue: () => import_hooks.useDebugValue, + useDeferredValue: () => import_hooks.useDeferredValue, + useEffect: () => import_hooks.useEffect, + useFormStatus: () => import_hooks2.useFormStatus, + useId: () => import_hooks.useId, + useImperativeHandle: () => import_hooks.useImperativeHandle, + useInsertionEffect: () => import_hooks.useInsertionEffect, + useLayoutEffect: () => import_hooks.useLayoutEffect, + useMemo: () => import_hooks.useMemo, + useOptimistic: () => import_hooks2.useOptimistic, + useReducer: () => import_hooks.useReducer, + useRef: () => import_hooks.useRef, + useState: () => import_hooks.useState, + useSyncExternalStore: () => import_hooks.useSyncExternalStore, + useTransition: () => import_hooks.useTransition, + useViewTransition: () => import_hooks.useViewTransition, + version: () => import_base.reactAPICompatVersion +}); +module.exports = __toCommonJS(dom_exports); +var import_base = require("../base"); +var import_children = require("../children"); +var import_constants = require("../constants"); +var import_context = require("../context"); +var import_hooks = require("../hooks"); +var import_components = require("./components"); +var import_context2 = require("./context"); +var import_hooks2 = require("./hooks"); +var import_jsx_runtime = require("./jsx-runtime"); +var import_render = require("./render"); +var import_render2 = require("./render"); +const createElement = (tag, props, ...children) => { + const jsxProps = props ? { ...props } : {}; + if (children.length) { + jsxProps.children = children.length === 1 ? children[0] : children; + } + let key = void 0; + if ("key" in jsxProps) { + key = jsxProps.key; + delete jsxProps.key; + } + return (0, import_jsx_runtime.jsx)(tag, jsxProps, key); +}; +const cloneElement = (element, props, ...children) => { + return (0, import_jsx_runtime.jsx)( + element.tag, + { + ...element.props, + ...props, + children: children.length ? children : element.props.children + }, + element.key + ); +}; +const memo = (component, propsAreEqual = import_base.shallowEqual) => { + const wrapper = ((props) => component(props)); + wrapper[import_constants.DOM_MEMO] = propsAreEqual; + return wrapper; +}; +var dom_default = { + version: import_base.reactAPICompatVersion, + useState: import_hooks.useState, + useEffect: import_hooks.useEffect, + useRef: import_hooks.useRef, + useCallback: import_hooks.useCallback, + use: import_hooks.use, + startTransition: import_hooks.startTransition, + useTransition: import_hooks.useTransition, + useDeferredValue: import_hooks.useDeferredValue, + startViewTransition: import_hooks.startViewTransition, + useViewTransition: import_hooks.useViewTransition, + useMemo: import_hooks.useMemo, + useLayoutEffect: import_hooks.useLayoutEffect, + useInsertionEffect: import_hooks.useInsertionEffect, + useReducer: import_hooks.useReducer, + useId: import_hooks.useId, + useDebugValue: import_hooks.useDebugValue, + createRef: import_hooks.createRef, + forwardRef: import_hooks.forwardRef, + useImperativeHandle: import_hooks.useImperativeHandle, + useSyncExternalStore: import_hooks.useSyncExternalStore, + useFormStatus: import_hooks2.useFormStatus, + useActionState: import_hooks2.useActionState, + useOptimistic: import_hooks2.useOptimistic, + Suspense: import_components.Suspense, + ErrorBoundary: import_components.ErrorBoundary, + createContext: import_context2.createContext, + useContext: import_context.useContext, + memo, + isValidElement: import_base.isValidElement, + createElement, + cloneElement, + Children: import_children.Children, + Fragment: import_jsx_runtime.Fragment, + StrictMode: import_jsx_runtime.Fragment, + flushSync: import_render.flushSync, + createPortal: import_render.createPortal +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Children, + ErrorBoundary, + Fragment, + StrictMode, + Suspense, + cloneElement, + createContext, + createElement, + createPortal, + createRef, + flushSync, + forwardRef, + isValidElement, + jsx, + memo, + render, + startTransition, + startViewTransition, + use, + useActionState, + useCallback, + useContext, + useDebugValue, + useDeferredValue, + useEffect, + useFormStatus, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useOptimistic, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition, + version +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js new file mode 100644 index 0000000000000000000000000000000000000000..9bee9275dd52ba5e7dfa9c69bfdc4b65fe975a62 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js @@ -0,0 +1,399 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var components_exports = {}; +__export(components_exports, { + button: () => button, + clearCache: () => clearCache, + composeRef: () => composeRef, + form: () => form, + input: () => input, + link: () => link, + meta: () => meta, + script: () => script, + style: () => style, + title: () => title +}); +module.exports = __toCommonJS(components_exports); +var import_context = require("../../context"); +var import_hooks = require("../../hooks"); +var import_common = require("../../intrinsic-element/common"); +var import_hooks2 = require("../hooks"); +var import_render = require("../render"); +const clearCache = () => { + blockingPromiseMap = /* @__PURE__ */ Object.create(null); + createdElements = /* @__PURE__ */ Object.create(null); +}; +const composeRef = (ref, cb) => { + return (0, import_hooks.useMemo)( + () => (e) => { + let refCleanup; + if (ref) { + if (typeof ref === "function") { + refCleanup = ref(e) || (() => { + ref(null); + }); + } else if (ref && "current" in ref) { + ref.current = e; + refCleanup = () => { + ref.current = null; + }; + } + } + const cbCleanup = cb(e); + return () => { + cbCleanup?.(); + refCleanup?.(); + }; + }, + [ref] + ); +}; +let blockingPromiseMap = /* @__PURE__ */ Object.create(null); +let createdElements = /* @__PURE__ */ Object.create(null); +const documentMetadataTag = (tag, props, preserveNodeType, supportSort, supportBlocking) => { + if (props?.itemProp) { + return { + tag, + props, + type: tag, + ref: props.ref + }; + } + const head = document.head; + let { onLoad, onError, precedence, blocking, ...restProps } = props; + let element = null; + let created = false; + const deDupeKeys = import_common.deDupeKeyMap[tag]; + const deDupeByKey = (0, import_common.shouldDeDupeByKey)(tag, supportSort); + const isDeDupeCandidateLink = (e) => e.getAttribute("rel") === "stylesheet" && e.getAttribute(import_common.dataPrecedenceAttr) !== null; + let existingElements = void 0; + if (deDupeByKey) { + const tags = head.querySelectorAll(tag); + LOOP: for (const e of tags) { + if (tag === "link" && !isDeDupeCandidateLink(e)) { + continue; + } + for (const key of deDupeKeys) { + if (e.getAttribute(key) === props[key]) { + element = e; + break LOOP; + } + } + } + if (!element) { + const cacheKey = deDupeKeys.reduce( + (acc, key) => props[key] === void 0 ? acc : `${acc}-${key}-${props[key]}`, + tag + ); + created = !createdElements[cacheKey]; + element = createdElements[cacheKey] ||= (() => { + const e = document.createElement(tag); + for (const key of deDupeKeys) { + if (props[key] !== void 0) { + e.setAttribute(key, props[key]); + } + } + if (props.rel) { + e.setAttribute("rel", props.rel); + } + return e; + })(); + } + } else { + existingElements = head.querySelectorAll(tag); + } + precedence = supportSort ? precedence ?? "" : void 0; + if (supportSort) { + restProps[import_common.dataPrecedenceAttr] = precedence; + } + const insert = (0, import_hooks.useCallback)( + (e) => { + if (deDupeByKey) { + if (tag === "link" && precedence !== void 0) { + let found2 = false; + for (const existingElement of head.querySelectorAll(tag)) { + const existingPrecedence = existingElement.getAttribute(import_common.dataPrecedenceAttr); + if (existingPrecedence === null) { + head.insertBefore(e, existingElement); + return; + } + if (found2 && existingPrecedence !== precedence) { + head.insertBefore(e, existingElement); + return; + } + if (existingPrecedence === precedence) { + found2 = true; + } + } + head.appendChild(e); + return; + } + let found = false; + for (const existingElement of head.querySelectorAll(tag)) { + if (found && existingElement.getAttribute(import_common.dataPrecedenceAttr) !== precedence) { + head.insertBefore(e, existingElement); + return; + } + if (existingElement.getAttribute(import_common.dataPrecedenceAttr) === precedence) { + found = true; + } + } + head.appendChild(e); + } else if (tag === "link") { + if (!head.contains(e)) { + head.appendChild(e); + } + } else if (existingElements) { + let found = false; + for (const existingElement of existingElements) { + if (existingElement === e) { + found = true; + break; + } + } + if (!found) { + head.insertBefore( + e, + head.contains(existingElements[0]) ? existingElements[0] : head.querySelector(tag) + ); + } + existingElements = void 0; + } + }, + [deDupeByKey, precedence, tag] + ); + const ref = composeRef(props.ref, (e) => { + const key = deDupeKeys[0]; + if (preserveNodeType === 2) { + e.innerHTML = ""; + } + if (created || existingElements) { + insert(e); + } + if (!onError && !onLoad) { + return; + } + if (!key) { + return; + } + let promise = blockingPromiseMap[e.getAttribute(key)] ||= new Promise( + (resolve, reject) => { + e.addEventListener("load", resolve); + e.addEventListener("error", reject); + } + ); + if (onLoad) { + promise = promise.then(onLoad); + } + if (onError) { + promise = promise.catch(onError); + } + promise.catch(() => { + }); + }); + if (supportBlocking && blocking === "render") { + const key = import_common.deDupeKeyMap[tag][0]; + if (key && props[key]) { + const value = props[key]; + const promise = blockingPromiseMap[value] ||= new Promise((resolve, reject) => { + insert(element); + element.addEventListener("load", resolve); + element.addEventListener("error", reject); + }); + (0, import_hooks.use)(promise); + } + } + const jsxNode = { + tag, + type: tag, + props: { + ...restProps, + ref + }, + ref + }; + jsxNode.p = preserveNodeType; + if (element) { + jsxNode.e = element; + } + return (0, import_render.createPortal)( + jsxNode, + head + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ); +}; +const title = (props) => { + const nameSpaceContext = (0, import_render.getNameSpaceContext)(); + const ns = nameSpaceContext && (0, import_context.useContext)(nameSpaceContext); + if (ns?.endsWith("svg")) { + return { + tag: "title", + props, + type: "title", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ref: props.ref + }; + } + return documentMetadataTag("title", props, void 0, false, false); +}; +const script = (props) => { + if (!props || ["src", "async"].some((k) => !props[k])) { + return { + tag: "script", + props, + type: "script", + ref: props.ref + }; + } + return documentMetadataTag("script", props, 1, false, true); +}; +const style = (props) => { + if (!props || !["href", "precedence"].every((k) => k in props)) { + return { + tag: "style", + props, + type: "style", + ref: props.ref + }; + } + props["data-href"] = props.href; + delete props.href; + return documentMetadataTag("style", props, 2, true, true); +}; +const link = (props) => { + if (!props || ["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { + return { + tag: "link", + props, + type: "link", + ref: props.ref + }; + } + return documentMetadataTag("link", props, 1, (0, import_common.isStylesheetLinkWithPrecedence)(props), true); +}; +const meta = (props) => { + return documentMetadataTag("meta", props, void 0, false, false); +}; +const customEventFormAction = /* @__PURE__ */ Symbol(); +const form = (props) => { + const { action, ...restProps } = props; + if (typeof action !== "function") { + ; + restProps.action = action; + } + const [state, setState] = (0, import_hooks.useState)([null, false]); + const onSubmit = (0, import_hooks.useCallback)( + async (ev) => { + const currentAction = ev.isTrusted ? action : ev.detail[customEventFormAction]; + if (typeof currentAction !== "function") { + return; + } + ev.preventDefault(); + const formData = new FormData(ev.target); + setState([formData, true]); + const actionRes = currentAction(formData); + if (actionRes instanceof Promise) { + (0, import_hooks2.registerAction)(actionRes); + await actionRes; + } + setState([null, true]); + }, + [] + ); + const ref = composeRef(props.ref, (el) => { + el.addEventListener("submit", onSubmit); + return () => { + el.removeEventListener("submit", onSubmit); + }; + }); + const [data, isDirty] = state; + state[1] = false; + return { + tag: import_hooks2.FormContext, + props: { + value: { + pending: data !== null, + data, + method: data ? "post" : null, + action: data ? action : null + }, + children: { + tag: "form", + props: { + ...restProps, + ref + }, + type: "form", + ref + } + }, + f: isDirty + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }; +}; +const formActionableElement = (tag, { + formAction, + ...props +}) => { + if (typeof formAction === "function") { + const onClick = (0, import_hooks.useCallback)((ev) => { + ev.preventDefault(); + ev.currentTarget.form.dispatchEvent( + new CustomEvent("submit", { detail: { [customEventFormAction]: formAction } }) + ); + }, []); + props.ref = composeRef(props.ref, (el) => { + el.addEventListener("click", onClick); + return () => { + el.removeEventListener("click", onClick); + }; + }); + } + return { + tag, + props, + type: tag, + ref: props.ref + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }; +}; +const input = (props) => formActionableElement("input", props); +const button = (props) => formActionableElement("button", props); +Object.assign(import_common.domRenderers, { + title, + script, + style, + link, + meta, + form, + input, + button +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + button, + clearCache, + composeRef, + form, + input, + link, + meta, + script, + style, + title +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..304fabdd67ec0fd4e92fa33b58b397c10b9464c3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js @@ -0,0 +1,52 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jsx_dev_runtime_exports = {}; +__export(jsx_dev_runtime_exports, { + Fragment: () => Fragment, + jsxDEV: () => jsxDEV +}); +module.exports = __toCommonJS(jsx_dev_runtime_exports); +var intrinsicElementTags = __toESM(require("./intrinsic-element/components"), 1); +const jsxDEV = (tag, props, key) => { + if (typeof tag === "string" && intrinsicElementTags[tag]) { + tag = intrinsicElementTags[tag]; + } + return { + tag, + type: tag, + props, + key, + ref: props.ref + }; +}; +const Fragment = (props) => jsxDEV("", props, void 0); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Fragment, + jsxDEV +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..96b96cfc8829fad272c701bf46a13636862b9f78 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js @@ -0,0 +1,32 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jsx_runtime_exports = {}; +__export(jsx_runtime_exports, { + Fragment: () => import_jsx_dev_runtime.Fragment, + jsx: () => import_jsx_dev_runtime.jsxDEV, + jsxs: () => import_jsx_dev_runtime2.jsxDEV +}); +module.exports = __toCommonJS(jsx_runtime_exports); +var import_jsx_dev_runtime = require("./jsx-dev-runtime"); +var import_jsx_dev_runtime2 = require("./jsx-dev-runtime"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Fragment, + jsx, + jsxs +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/render.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/render.js new file mode 100644 index 0000000000000000000000000000000000000000..91b0c54876a4c8081ed9eec349e96dd1c492747c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/render.js @@ -0,0 +1,641 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var render_exports = {}; +__export(render_exports, { + build: () => build, + buildDataStack: () => buildDataStack, + buildNode: () => buildNode, + createPortal: () => createPortal, + flushSync: () => flushSync, + getNameSpaceContext: () => getNameSpaceContext, + render: () => render, + renderNode: () => renderNode, + update: () => update +}); +module.exports = __toCommonJS(render_exports); +var import_children = require("../children"); +var import_constants = require("../constants"); +var import_context = require("../context"); +var import_hooks = require("../hooks"); +var import_utils = require("../utils"); +var import_context2 = require("./context"); +const HONO_PORTAL_ELEMENT = "_hp"; +const eventAliasMap = { + Change: "Input", + DoubleClick: "DblClick" +}; +const nameSpaceMap = { + svg: "2000/svg", + math: "1998/Math/MathML" +}; +const buildDataStack = []; +const refCleanupMap = /* @__PURE__ */ new WeakMap(); +let nameSpaceContext = void 0; +const getNameSpaceContext = () => nameSpaceContext; +const isNodeString = (node) => "t" in node; +const eventCache = { + // pre-define events that are used very frequently + onClick: ["click", false] +}; +const getEventSpec = (key) => { + if (!key.startsWith("on")) { + return void 0; + } + if (eventCache[key]) { + return eventCache[key]; + } + const match = key.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/); + if (match) { + const [, eventName, capture] = match; + return eventCache[key] = [(eventAliasMap[eventName] || eventName).toLowerCase(), !!capture]; + } + return void 0; +}; +const toAttributeName = (element, key) => nameSpaceContext && element instanceof SVGElement && /[A-Z]/.test(key) && (key in element.style || // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. +key.match(/^(?:o|pai|str|u|ve)/)) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; +const normalizeFormValue = (value) => value === null || value === void 0 || value === false ? null : value; +const applySelectValue = (select, props) => { + if (!("value" in props)) { + return; + } + select.value = normalizeFormValue(props["value"]); + if (!select.multiple && select.selectedIndex === -1) { + select.selectedIndex = 0; + } +}; +const isIgnorableAttributeError = (error) => error instanceof DOMException && error.name === "InvalidCharacterError"; +const applyProps = (container, attributes, oldAttributes) => { + attributes ||= {}; + for (let key in attributes) { + const value = attributes[key]; + if (key !== "children" && (!oldAttributes || oldAttributes[key] !== value)) { + key = (0, import_utils.normalizeIntrinsicElementKey)(key); + const eventSpec = getEventSpec(key); + if (eventSpec) { + if (oldAttributes?.[key] !== value) { + if (oldAttributes) { + container.removeEventListener(eventSpec[0], oldAttributes[key], eventSpec[1]); + } + if (value != null) { + if (typeof value !== "function") { + throw new Error(`Event handler for "${key}" is not a function`); + } + container.addEventListener(eventSpec[0], value, eventSpec[1]); + } + } + } else if (key === "dangerouslySetInnerHTML" && value) { + container.innerHTML = value.__html; + } else if (key === "ref") { + let cleanup; + if (typeof value === "function") { + cleanup = value(container) || (() => value(null)); + } else if (value && "current" in value) { + value.current = container; + cleanup = () => value.current = null; + } + refCleanupMap.set(container, cleanup); + } else if (key === "style") { + const style = container.style; + if (typeof value === "string") { + style.cssText = value; + } else { + style.cssText = ""; + if (value != null) { + (0, import_utils.styleObjectForEach)(value, style.setProperty.bind(style)); + } + } + } else { + if (key === "value") { + const nodeName = container.nodeName; + if (nodeName === "SELECT") { + continue; + } else if (nodeName === "INPUT" || nodeName === "TEXTAREA") { + ; + container.value = normalizeFormValue(value); + if (nodeName === "TEXTAREA") { + container.textContent = value; + continue; + } + } + } else if (key === "checked" && container.nodeName === "INPUT" || key === "selected" && container.nodeName === "OPTION") { + ; + container[key] = value; + } + const k = toAttributeName(container, key); + try { + if (value === null || value === void 0 || value === false) { + container.removeAttribute(k); + } else if (value === true) { + container.setAttribute(k, ""); + } else if (typeof value === "string" || typeof value === "number") { + container.setAttribute(k, value); + } else { + container.setAttribute(k, value.toString()); + } + } catch (e) { + if (!isIgnorableAttributeError(e)) { + throw e; + } + } + } + } + } + if (oldAttributes) { + for (let key in oldAttributes) { + const value = oldAttributes[key]; + if (key !== "children" && !(key in attributes)) { + key = (0, import_utils.normalizeIntrinsicElementKey)(key); + const eventSpec = getEventSpec(key); + if (eventSpec) { + container.removeEventListener(eventSpec[0], value, eventSpec[1]); + } else if (key === "ref") { + refCleanupMap.get(container)?.(); + } else { + try { + container.removeAttribute(toAttributeName(container, key)); + } catch (e) { + if (!isIgnorableAttributeError(e)) { + throw e; + } + } + } + } + } + } +}; +const invokeTag = (context, node) => { + node[import_constants.DOM_STASH][0] = 0; + buildDataStack.push([context, node]); + const func = node.tag[import_constants.DOM_RENDERER] || node.tag; + const props = func.defaultProps ? { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...func.defaultProps, + ...node.props + } : node.props; + try { + return [func.call(null, props)]; + } finally { + buildDataStack.pop(); + } +}; +const getNextChildren = (node, container, nextChildren, childrenToRemove, callbacks) => { + if (node.vR?.length) { + childrenToRemove.push(...node.vR); + delete node.vR; + } + if (typeof node.tag === "function") { + node[import_constants.DOM_STASH][1][import_hooks.STASH_EFFECT]?.forEach((data) => callbacks.push(data)); + } + node.vC.forEach((child) => { + if (isNodeString(child)) { + nextChildren.push(child); + } else { + if (typeof child.tag === "function" || child.tag === "") { + child.c = container; + const currentNextChildrenIndex = nextChildren.length; + getNextChildren(child, container, nextChildren, childrenToRemove, callbacks); + if (child.s) { + for (let i = currentNextChildrenIndex; i < nextChildren.length; i++) { + nextChildren[i].s = true; + } + child.s = false; + } + } else { + nextChildren.push(child); + if (child.vR?.length) { + childrenToRemove.push(...child.vR); + delete child.vR; + } + } + } + }); +}; +const findInsertBefore = (node) => { + while (node && (node.tag === HONO_PORTAL_ELEMENT || !node.e)) { + node = node.tag === HONO_PORTAL_ELEMENT || !node.vC?.[0] ? node.nN : node.vC[0]; + } + return node?.e; +}; +const removeNode = (node) => { + if (!isNodeString(node)) { + node[import_constants.DOM_STASH]?.[1][import_hooks.STASH_EFFECT]?.forEach((data) => data[2]?.()); + refCleanupMap.get(node.e)?.(); + if (node.p === 2) { + node.vC?.forEach((n) => n.p = 2); + } + node.vC?.forEach(removeNode); + } + if (!node.p) { + node.e?.remove(); + delete node.e; + } + if (typeof node.tag === "function") { + updateMap.delete(node); + fallbackUpdateFnArrayMap.delete(node); + delete node[import_constants.DOM_STASH][3]; + node.a = true; + } +}; +const apply = (node, container, isNew) => { + node.c = container; + applyNodeObject(node, container, isNew); +}; +const findChildNodeIndex = (childNodes, child) => { + if (!child) { + return; + } + for (let i = 0, len = childNodes.length; i < len; i++) { + if (childNodes[i] === child) { + return i; + } + } + return; +}; +const cancelBuild = /* @__PURE__ */ Symbol(); +const applyNodeObject = (node, container, isNew) => { + const next = []; + const remove = []; + const callbacks = []; + getNextChildren(node, container, next, remove, callbacks); + remove.forEach(removeNode); + const childNodes = isNew ? void 0 : container.childNodes; + let offset; + let insertBeforeNode = null; + if (isNew) { + offset = -1; + } else if (!childNodes.length) { + offset = 0; + } else { + const offsetByNextNode = findChildNodeIndex(childNodes, findInsertBefore(node.nN)); + if (offsetByNextNode !== void 0) { + insertBeforeNode = childNodes[offsetByNextNode]; + offset = offsetByNextNode; + } else { + offset = findChildNodeIndex(childNodes, next.find((n) => n.tag !== HONO_PORTAL_ELEMENT && n.e)?.e) ?? -1; + } + if (offset === -1) { + isNew = true; + } + } + for (let i = 0, len = next.length; i < len; i++, offset++) { + const child = next[i]; + let el; + if (child.s && child.e) { + el = child.e; + child.s = false; + } else { + const isNewLocal = isNew || !child.e; + if (isNodeString(child)) { + if (child.e && child.d) { + child.e.textContent = child.t; + } + child.d = false; + el = child.e ||= document.createTextNode(child.t); + } else { + el = child.e ||= child.n ? document.createElementNS(child.n, child.tag) : document.createElement(child.tag); + applyProps(el, child.props, child.pP); + applyNodeObject(child, el, isNewLocal); + if (child.tag === "select") { + applySelectValue(el, child.props); + } + } + } + if (child.tag === HONO_PORTAL_ELEMENT) { + offset--; + } else if (isNew) { + if (!el.parentNode) { + container.appendChild(el); + } + } else if (childNodes[offset] !== el && childNodes[offset - 1] !== el) { + if (childNodes[offset + 1] === el) { + container.appendChild(childNodes[offset]); + } else { + container.insertBefore(el, insertBeforeNode || childNodes[offset] || null); + } + } + } + if (node.pP) { + node.pP = void 0; + } + if (callbacks.length) { + const useLayoutEffectCbs = []; + const useEffectCbs = []; + callbacks.forEach(([, useLayoutEffectCb, , useEffectCb, useInsertionEffectCb]) => { + if (useLayoutEffectCb) { + useLayoutEffectCbs.push(useLayoutEffectCb); + } + if (useEffectCb) { + useEffectCbs.push(useEffectCb); + } + useInsertionEffectCb?.(); + }); + useLayoutEffectCbs.forEach((cb) => cb()); + if (useEffectCbs.length) { + requestAnimationFrame(() => { + useEffectCbs.forEach((cb) => cb()); + }); + } + } +}; +const isSameContext = (oldContexts, newContexts) => !!(oldContexts && oldContexts.length === newContexts.length && oldContexts.every((ctx, i) => ctx[1] === newContexts[i][1])); +const fallbackUpdateFnArrayMap = /* @__PURE__ */ new WeakMap(); +const build = (context, node, children) => { + const buildWithPreviousChildren = !children && node.pC; + if (children) { + node.pC ||= node.vC; + } + let foundErrorHandler; + try { + children ||= typeof node.tag == "function" ? invokeTag(context, node) : (0, import_children.toArray)(node.props.children); + if (children[0]?.tag === "" && children[0][import_constants.DOM_ERROR_HANDLER]) { + foundErrorHandler = children[0][import_constants.DOM_ERROR_HANDLER]; + context[5].push([context, foundErrorHandler, node]); + } + const oldVChildren = buildWithPreviousChildren ? [...node.pC] : node.vC ? [...node.vC] : void 0; + const vChildren = []; + let prevNode; + for (let i = 0; i < children.length; i++) { + if (Array.isArray(children[i])) { + children.splice(i, 1, ...children[i].flat(Infinity)); + i--; + continue; + } + let child = buildNode(children[i]); + if (child) { + if (typeof child.tag === "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any + !child.tag[import_constants.DOM_INTERNAL_TAG]) { + if (import_context.globalContexts.length > 0) { + child[import_constants.DOM_STASH][2] = import_context.globalContexts.map((c) => [c, c.values.at(-1)]); + } + if (context[5]?.length) { + child[import_constants.DOM_STASH][3] = context[5].at(-1); + } + } + let oldChild; + if (oldVChildren && oldVChildren.length) { + const i2 = oldVChildren.findIndex( + isNodeString(child) ? (c) => isNodeString(c) : child.key !== void 0 ? (c) => c.key === child.key && c.tag === child.tag : (c) => c.tag === child.tag + ); + if (i2 !== -1) { + oldChild = oldVChildren[i2]; + oldVChildren.splice(i2, 1); + } + } + if (oldChild) { + if (isNodeString(child)) { + if (oldChild.t !== child.t) { + ; + oldChild.t = child.t; + oldChild.d = true; + } + child = oldChild; + } else { + const pP = oldChild.pP = oldChild.props; + oldChild.props = child.props; + oldChild.f ||= child.f || node.f; + if (typeof child.tag === "function") { + const oldContexts = oldChild[import_constants.DOM_STASH][2]; + oldChild[import_constants.DOM_STASH][2] = child[import_constants.DOM_STASH][2] || []; + oldChild[import_constants.DOM_STASH][3] = child[import_constants.DOM_STASH][3]; + if (!oldChild.f && ((oldChild.o || oldChild) === child.o || // The code generated by the react compiler is memoized under this condition. + oldChild.tag[import_constants.DOM_MEMO]?.(pP, oldChild.props)) && // The `memo` function is memoized under this condition. + isSameContext(oldContexts, oldChild[import_constants.DOM_STASH][2])) { + oldChild.s = true; + } + } + child = oldChild; + } + } else if (!isNodeString(child) && nameSpaceContext) { + const ns = (0, import_context.useContext)(nameSpaceContext); + if (ns) { + child.n = ns; + } + } + if (!isNodeString(child) && !child.s) { + build(context, child); + delete child.f; + } + vChildren.push(child); + if (prevNode && !prevNode.s && !child.s) { + for (let p = prevNode; p && !isNodeString(p); p = p.vC?.at(-1)) { + p.nN = child; + } + } + prevNode = child; + } + } + node.vR = buildWithPreviousChildren ? [...node.vC, ...oldVChildren || []] : oldVChildren || []; + node.vC = vChildren; + if (buildWithPreviousChildren) { + delete node.pC; + } + } catch (e) { + node.f = true; + if (e === cancelBuild) { + if (foundErrorHandler) { + return; + } else { + throw e; + } + } + const [errorHandlerContext, errorHandler, errorHandlerNode] = node[import_constants.DOM_STASH]?.[3] || []; + if (errorHandler) { + const fallbackUpdateFn = () => update([0, false, context[2]], errorHandlerNode); + const fallbackUpdateFnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode) || []; + fallbackUpdateFnArray.push(fallbackUpdateFn); + fallbackUpdateFnArrayMap.set(errorHandlerNode, fallbackUpdateFnArray); + const fallback = errorHandler(e, () => { + const fnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode); + if (fnArray) { + const i = fnArray.indexOf(fallbackUpdateFn); + if (i !== -1) { + fnArray.splice(i, 1); + return fallbackUpdateFn(); + } + } + }); + if (fallback) { + if (context[0] === 1) { + context[1] = true; + } else { + build(context, errorHandlerNode, [fallback]); + if ((errorHandler.length === 1 || context !== errorHandlerContext) && errorHandlerNode.c) { + apply(errorHandlerNode, errorHandlerNode.c, false); + return; + } + } + throw cancelBuild; + } + } + throw e; + } finally { + if (foundErrorHandler) { + context[5].pop(); + } + } +}; +const buildNode = (node) => { + if (node === void 0 || node === null || typeof node === "boolean") { + return void 0; + } else if (typeof node === "string" || typeof node === "number") { + return { t: node.toString(), d: true }; + } else { + if ("vR" in node) { + node = { + tag: node.tag, + props: node.props, + key: node.key, + f: node.f, + type: node.tag, + ref: node.props.ref, + o: node.o || node + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }; + } + if (typeof node.tag === "function") { + ; + node[import_constants.DOM_STASH] = [0, []]; + } else { + const ns = nameSpaceMap[node.tag]; + if (ns) { + nameSpaceContext ||= (0, import_context2.createContext)(""); + node.props.children = [ + { + tag: nameSpaceContext, + props: { + value: node.n = `http://www.w3.org/${ns}`, + children: node.props.children + } + } + ]; + } + } + return node; + } +}; +const replaceContainer = (node, from, to) => { + if (node.c === from) { + node.c = to; + node.vC.forEach((child) => replaceContainer(child, from, to)); + } +}; +const updateSync = (context, node) => { + node[import_constants.DOM_STASH][2]?.forEach(([c, v]) => { + c.values.push(v); + }); + try { + build(context, node, void 0); + } catch { + return; + } + if (node.a) { + delete node.a; + return; + } + node[import_constants.DOM_STASH][2]?.forEach(([c]) => { + c.values.pop(); + }); + if (context[0] !== 1 || !context[1]) { + apply(node, node.c, false); + } +}; +const updateMap = /* @__PURE__ */ new WeakMap(); +const currentUpdateSets = []; +const update = async (context, node) => { + context[5] ||= []; + const existing = updateMap.get(node); + if (existing) { + existing[0](void 0); + } + let resolve; + const promise = new Promise((r) => resolve = r); + updateMap.set(node, [ + resolve, + () => { + if (context[2]) { + context[2](context, node, (context2) => { + updateSync(context2, node); + }).then(() => resolve(node)); + } else { + updateSync(context, node); + resolve(node); + } + } + ]); + if (currentUpdateSets.length) { + ; + currentUpdateSets.at(-1).add(node); + } else { + await Promise.resolve(); + const latest = updateMap.get(node); + if (latest) { + updateMap.delete(node); + latest[1](); + } + } + return promise; +}; +const renderNode = (node, container) => { + const context = []; + context[5] = []; + context[4] = true; + build(context, node, void 0); + context[4] = false; + const fragment = document.createDocumentFragment(); + apply(node, fragment, true); + replaceContainer(node, fragment, container); + container.replaceChildren(fragment); +}; +const render = (jsxNode, container) => { + renderNode(buildNode({ tag: "", props: { children: jsxNode } }), container); +}; +const flushSync = (callback) => { + const set = /* @__PURE__ */ new Set(); + currentUpdateSets.push(set); + callback(); + set.forEach((node) => { + const latest = updateMap.get(node); + if (latest) { + updateMap.delete(node); + latest[1](); + } + }); + currentUpdateSets.pop(); +}; +const createPortal = (children, container, key) => ({ + tag: HONO_PORTAL_ELEMENT, + props: { + children + }, + key, + e: container, + p: 1 + // eslint-disable-next-line @typescript-eslint/no-explicit-any +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + build, + buildDataStack, + buildNode, + createPortal, + flushSync, + getNameSpaceContext, + render, + renderNode, + update +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/server.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/server.js new file mode 100644 index 0000000000000000000000000000000000000000..73203cc39541a5abbca99425f9039b5c50a802c3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/server.js @@ -0,0 +1,67 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var server_exports = {}; +__export(server_exports, { + default: () => server_default, + renderToReadableStream: () => renderToReadableStream, + renderToString: () => renderToString, + version: () => import__.default +}); +module.exports = __toCommonJS(server_exports); +var import_streaming = require("../streaming"); +var import__ = __toESM(require("./"), 1); +const renderToString = (element, options = {}) => { + if (Object.keys(options).length > 0) { + console.warn("options are not supported yet"); + } + const res = element?.toString() ?? ""; + if (typeof res !== "string") { + throw new Error("Async component is not supported in renderToString"); + } + return res; +}; +const renderToReadableStream = async (element, options = {}) => { + if (Object.keys(options).some((key) => key !== "onError")) { + console.warn("options are not supported yet, except onError"); + } + if (!element || typeof element !== "object") { + element = element?.toString() ?? ""; + } + return (0, import_streaming.renderToReadableStream)(element, options.onError); +}; +var server_default = { + renderToString, + renderToReadableStream, + version: import__.default +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + renderToReadableStream, + renderToString, + version +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/dom/utils.js b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..64f411816c56e423db61b78b1acf073a7365fba4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/dom/utils.js @@ -0,0 +1,32 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + setInternalTagFlag: () => setInternalTagFlag +}); +module.exports = __toCommonJS(utils_exports); +var import_constants = require("../constants"); +const setInternalTagFlag = (fn) => { + ; + fn[import_constants.DOM_INTERNAL_TAG] = true; + return fn; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + setInternalTagFlag +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/hooks/index.js b/tools/ui/node_modules/hono/dist/cjs/jsx/hooks/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3d6ffb6835f6ca997622f71469e9490c76652cd8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/hooks/index.js @@ -0,0 +1,373 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var hooks_exports = {}; +__export(hooks_exports, { + STASH_EFFECT: () => STASH_EFFECT, + createRef: () => createRef, + forwardRef: () => forwardRef, + startTransition: () => startTransition, + startViewTransition: () => startViewTransition, + use: () => use, + useCallback: () => useCallback, + useDebugValue: () => useDebugValue, + useDeferredValue: () => useDeferredValue, + useEffect: () => useEffect, + useId: () => useId, + useImperativeHandle: () => useImperativeHandle, + useInsertionEffect: () => useInsertionEffect, + useLayoutEffect: () => useLayoutEffect, + useMemo: () => useMemo, + useReducer: () => useReducer, + useRef: () => useRef, + useState: () => useState, + useSyncExternalStore: () => useSyncExternalStore, + useTransition: () => useTransition, + useViewTransition: () => useViewTransition +}); +module.exports = __toCommonJS(hooks_exports); +var import_constants = require("../constants"); +var import_render = require("../dom/render"); +const STASH_SATE = 0; +const STASH_EFFECT = 1; +const STASH_CALLBACK = 2; +const STASH_MEMO = 3; +const STASH_REF = 4; +const resolvedPromiseValueMap = /* @__PURE__ */ new WeakMap(); +const isDepsChanged = (prevDeps, deps) => !prevDeps || !deps || prevDeps.length !== deps.length || deps.some((dep, i) => dep !== prevDeps[i]); +let viewTransitionState = void 0; +const documentStartViewTransition = (cb) => { + if (document?.startViewTransition) { + return document.startViewTransition(cb); + } else { + cb(); + return { finished: Promise.resolve() }; + } +}; +let updateHook = void 0; +const viewTransitionHook = (context, node, cb) => { + const state = [true, false]; + let lastVC = node.vC; + return documentStartViewTransition(() => { + if (lastVC === node.vC) { + viewTransitionState = state; + cb(context); + viewTransitionState = void 0; + lastVC = node.vC; + } + }).finished.then(() => { + if (state[1] && lastVC === node.vC) { + state[0] = false; + viewTransitionState = state; + cb(context); + viewTransitionState = void 0; + } + }); +}; +const startViewTransition = (callback) => { + updateHook = viewTransitionHook; + try { + callback(); + } finally { + updateHook = void 0; + } +}; +const useViewTransition = () => { + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + return [false, () => { + }]; + } + if (viewTransitionState) { + viewTransitionState[1] = true; + } + return [!!viewTransitionState?.[0], startViewTransition]; +}; +const pendingStack = []; +const runCallback = (type, callback) => { + let resolve; + const promise = new Promise((r) => resolve = r); + pendingStack.push([type, promise]); + try { + const res = callback(); + if (res instanceof Promise) { + res.then(resolve, resolve); + } else { + resolve(); + } + } finally { + pendingStack.pop(); + } +}; +const startTransition = (callback) => { + runCallback(1, callback); +}; +const startTransitionHook = (callback) => { + runCallback(2, callback); +}; +const useTransition = () => { + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + return [false, () => { + }]; + } + const [error, setError] = useState(); + const [state, updateState] = useState(); + if (error) { + throw error[0]; + } + const startTransitionLocalHook = useCallback( + (callback) => { + startTransitionHook(() => { + updateState((state2) => !state2); + let res = callback(); + if (res instanceof Promise) { + res = res.catch((e) => { + setError([e]); + }); + } + return res; + }); + }, + [state] + ); + const [context] = buildData; + return [context[0] === 2, startTransitionLocalHook]; +}; +const useDeferredValue = (value, ...rest) => { + const [values, setValues] = useState( + rest.length ? [rest[0], rest[0]] : [value, value] + ); + if (Object.is(values[1], value)) { + return values[1]; + } + pendingStack.push([3, Promise.resolve()]); + updateHook = async (context, _, cb) => { + cb(context); + values[0] = value; + }; + setValues([values[0], value]); + updateHook = void 0; + pendingStack.pop(); + return values[0]; +}; +const useState = (initialState) => { + const resolveInitialState = () => typeof initialState === "function" ? initialState() : initialState; + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + return [resolveInitialState(), () => { + }]; + } + const [, node] = buildData; + const stateArray = node[import_constants.DOM_STASH][1][STASH_SATE] ||= []; + const hookIndex = node[import_constants.DOM_STASH][0]++; + return stateArray[hookIndex] ||= [ + resolveInitialState(), + (newState) => { + const localUpdateHook = updateHook; + const stateData = stateArray[hookIndex]; + if (typeof newState === "function") { + newState = newState(stateData[0]); + } + if (!Object.is(newState, stateData[0])) { + stateData[0] = newState; + if (pendingStack.length) { + const [pendingType, pendingPromise] = pendingStack.at(-1); + Promise.all([ + pendingType === 3 ? node : (0, import_render.update)([pendingType, false, localUpdateHook], node), + pendingPromise + ]).then(([node2]) => { + if (!node2 || !(pendingType === 2 || pendingType === 3)) { + return; + } + const lastVC = node2.vC; + const addUpdateTask = () => { + setTimeout(() => { + if (lastVC !== node2.vC) { + return; + } + (0, import_render.update)([pendingType === 3 ? 1 : 0, false, localUpdateHook], node2); + }); + }; + requestAnimationFrame(addUpdateTask); + }); + } else { + (0, import_render.update)([0, false, localUpdateHook], node); + } + } + } + ]; +}; +const useReducer = (reducer, initialArg, init) => { + const handler = useCallback( + (action) => { + setState((state2) => reducer(state2, action)); + }, + [reducer] + ); + const [state, setState] = useState(() => init ? init(initialArg) : initialArg); + return [state, handler]; +}; +const useEffectCommon = (index, effect, deps) => { + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + return; + } + const [, node] = buildData; + const effectDepsArray = node[import_constants.DOM_STASH][1][STASH_EFFECT] ||= []; + const hookIndex = node[import_constants.DOM_STASH][0]++; + const [prevDeps, , prevCleanup] = effectDepsArray[hookIndex] ||= []; + if (isDepsChanged(prevDeps, deps)) { + if (prevCleanup) { + prevCleanup(); + } + const runner = () => { + data[index] = void 0; + data[2] = effect(); + }; + const data = [deps, void 0, void 0, void 0, void 0]; + data[index] = runner; + effectDepsArray[hookIndex] = data; + } +}; +const useEffect = (effect, deps) => useEffectCommon(3, effect, deps); +const useLayoutEffect = (effect, deps) => useEffectCommon(1, effect, deps); +const useInsertionEffect = (effect, deps) => useEffectCommon(4, effect, deps); +const useCallback = (callback, deps) => { + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + return callback; + } + const [, node] = buildData; + const callbackArray = node[import_constants.DOM_STASH][1][STASH_CALLBACK] ||= []; + const hookIndex = node[import_constants.DOM_STASH][0]++; + const prevDeps = callbackArray[hookIndex]; + if (isDepsChanged(prevDeps?.[1], deps)) { + callbackArray[hookIndex] = [callback, deps]; + } else { + callback = callbackArray[hookIndex][0]; + } + return callback; +}; +function useRef(initialValue) { + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + return { current: initialValue }; + } + const [, node] = buildData; + const refArray = node[import_constants.DOM_STASH][1][STASH_REF] ||= []; + const hookIndex = node[import_constants.DOM_STASH][0]++; + return refArray[hookIndex] ||= { current: initialValue }; +} +const use = (promise) => { + const cachedRes = resolvedPromiseValueMap.get(promise); + if (cachedRes) { + if (cachedRes.length === 2) { + throw cachedRes[1]; + } + return cachedRes[0]; + } + promise.then( + (res) => resolvedPromiseValueMap.set(promise, [res]), + (e) => resolvedPromiseValueMap.set(promise, [void 0, e]) + ); + throw promise; +}; +const useMemo = (factory, deps) => { + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + return factory(); + } + const [, node] = buildData; + const memoArray = node[import_constants.DOM_STASH][1][STASH_MEMO] ||= []; + const hookIndex = node[import_constants.DOM_STASH][0]++; + const prevDeps = memoArray[hookIndex]; + if (isDepsChanged(prevDeps?.[1], deps)) { + memoArray[hookIndex] = [factory(), deps]; + } + return memoArray[hookIndex][0]; +}; +let idCounter = 0; +const useId = () => useMemo(() => `:r${(idCounter++).toString(32)}:`, []); +const useDebugValue = (_value, _formatter) => { +}; +const createRef = () => { + return { current: null }; +}; +const forwardRef = (Component) => { + return (props) => { + const { ref, ...rest } = props; + return Component(rest, ref); + }; +}; +const useImperativeHandle = (ref, createHandle, deps) => { + useEffect(() => { + ref.current = createHandle(); + return () => { + ref.current = null; + }; + }, deps); +}; +const useSyncExternalStore = (subscribe, getSnapshot, getServerSnapshot) => { + const buildData = import_render.buildDataStack.at(-1); + if (!buildData) { + if (!getServerSnapshot) { + throw new Error("getServerSnapshot is required for server side rendering"); + } + return getServerSnapshot(); + } + const snapshot = buildData[0][4] && getServerSnapshot ? getServerSnapshot() : getSnapshot(); + const [, setVersion] = useState(0); + const latestSnapshot = useRef([snapshot, getSnapshot]); + latestSnapshot.current = [snapshot, getSnapshot]; + const unsubscribeRef = useRef(null); + useEffect(() => { + const update2 = () => setVersion((version) => version + 1); + unsubscribeRef.current?.(); + unsubscribeRef.current = subscribe(update2); + const [snapshot2, getSnapshot2] = latestSnapshot.current; + if (!Object.is(snapshot2, getSnapshot2())) { + update2(); + } + }, [subscribe]); + useEffect(() => () => unsubscribeRef.current?.(), []); + return snapshot; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + STASH_EFFECT, + createRef, + forwardRef, + startTransition, + startViewTransition, + use, + useCallback, + useDebugValue, + useDeferredValue, + useEffect, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/index.js b/tools/ui/node_modules/hono/dist/cjs/jsx/index.js new file mode 100644 index 0000000000000000000000000000000000000000..09e8eca567159a2697e5d7cb82c16f94e48467ed --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/index.js @@ -0,0 +1,138 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jsx_exports = {}; +__export(jsx_exports, { + Children: () => import_children.Children, + ErrorBoundary: () => import_components.ErrorBoundary, + Fragment: () => import_base.Fragment, + StrictMode: () => import_base.Fragment, + Suspense: () => import_streaming.Suspense, + cloneElement: () => import_base.cloneElement, + createContext: () => import_context.createContext, + createElement: () => import_base.jsx, + createRef: () => import_hooks2.createRef, + default: () => jsx_default, + forwardRef: () => import_hooks2.forwardRef, + isValidElement: () => import_base.isValidElement, + jsx: () => import_base.jsx, + memo: () => import_base.memo, + startTransition: () => import_hooks2.startTransition, + startViewTransition: () => import_hooks2.startViewTransition, + use: () => import_hooks2.use, + useActionState: () => import_hooks.useActionState, + useCallback: () => import_hooks2.useCallback, + useContext: () => import_context.useContext, + useDebugValue: () => import_hooks2.useDebugValue, + useDeferredValue: () => import_hooks2.useDeferredValue, + useEffect: () => import_hooks2.useEffect, + useId: () => import_hooks2.useId, + useImperativeHandle: () => import_hooks2.useImperativeHandle, + useInsertionEffect: () => import_hooks2.useInsertionEffect, + useLayoutEffect: () => import_hooks2.useLayoutEffect, + useMemo: () => import_hooks2.useMemo, + useOptimistic: () => import_hooks.useOptimistic, + useReducer: () => import_hooks2.useReducer, + useRef: () => import_hooks2.useRef, + useState: () => import_hooks2.useState, + useSyncExternalStore: () => import_hooks2.useSyncExternalStore, + useTransition: () => import_hooks2.useTransition, + useViewTransition: () => import_hooks2.useViewTransition, + version: () => import_base.reactAPICompatVersion +}); +module.exports = __toCommonJS(jsx_exports); +var import_base = require("./base"); +var import_children = require("./children"); +var import_components = require("./components"); +var import_context = require("./context"); +var import_hooks = require("./dom/hooks"); +var import_hooks2 = require("./hooks"); +var import_streaming = require("./streaming"); +var jsx_default = { + version: import_base.reactAPICompatVersion, + memo: import_base.memo, + Fragment: import_base.Fragment, + StrictMode: import_base.Fragment, + isValidElement: import_base.isValidElement, + createElement: import_base.jsx, + cloneElement: import_base.cloneElement, + ErrorBoundary: import_components.ErrorBoundary, + createContext: import_context.createContext, + useContext: import_context.useContext, + useState: import_hooks2.useState, + useEffect: import_hooks2.useEffect, + useRef: import_hooks2.useRef, + useCallback: import_hooks2.useCallback, + useReducer: import_hooks2.useReducer, + useId: import_hooks2.useId, + useDebugValue: import_hooks2.useDebugValue, + use: import_hooks2.use, + startTransition: import_hooks2.startTransition, + useTransition: import_hooks2.useTransition, + useDeferredValue: import_hooks2.useDeferredValue, + startViewTransition: import_hooks2.startViewTransition, + useViewTransition: import_hooks2.useViewTransition, + useMemo: import_hooks2.useMemo, + useLayoutEffect: import_hooks2.useLayoutEffect, + useInsertionEffect: import_hooks2.useInsertionEffect, + createRef: import_hooks2.createRef, + forwardRef: import_hooks2.forwardRef, + useImperativeHandle: import_hooks2.useImperativeHandle, + useSyncExternalStore: import_hooks2.useSyncExternalStore, + useActionState: import_hooks.useActionState, + useOptimistic: import_hooks.useOptimistic, + Suspense: import_streaming.Suspense, + Children: import_children.Children +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Children, + ErrorBoundary, + Fragment, + StrictMode, + Suspense, + cloneElement, + createContext, + createElement, + createRef, + forwardRef, + isValidElement, + jsx, + memo, + startTransition, + startViewTransition, + use, + useActionState, + useCallback, + useContext, + useDebugValue, + useDeferredValue, + useEffect, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useOptimistic, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition, + version +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js b/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js new file mode 100644 index 0000000000000000000000000000000000000000..555a9a60d4ca7a7f3bfc20fb04a2587d61748450 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js @@ -0,0 +1,50 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var common_exports = {}; +__export(common_exports, { + dataPrecedenceAttr: () => dataPrecedenceAttr, + deDupeKeyMap: () => deDupeKeyMap, + domRenderers: () => domRenderers, + isStylesheetLinkWithPrecedence: () => isStylesheetLinkWithPrecedence, + shouldDeDupeByKey: () => shouldDeDupeByKey +}); +module.exports = __toCommonJS(common_exports); +const deDupeKeyMap = { + title: [], + script: ["src"], + style: ["data-href"], + link: ["href"], + meta: ["name", "httpEquiv", "charset", "itemProp"] +}; +const domRenderers = {}; +const dataPrecedenceAttr = "data-precedence"; +const isStylesheetLinkWithPrecedence = (props) => props.rel === "stylesheet" && "precedence" in props; +const shouldDeDupeByKey = (tagName, supportSort) => { + if (tagName === "link") { + return supportSort; + } + return deDupeKeyMap[tagName].length > 0; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + dataPrecedenceAttr, + deDupeKeyMap, + domRenderers, + isStylesheetLinkWithPrecedence, + shouldDeDupeByKey +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js b/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js new file mode 100644 index 0000000000000000000000000000000000000000..dc9d25f87980f87b60150448fb47bb5f63822a16 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js @@ -0,0 +1,189 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var components_exports = {}; +__export(components_exports, { + button: () => button, + form: () => form, + input: () => input, + link: () => link, + meta: () => meta, + script: () => script, + style: () => style, + title: () => title +}); +module.exports = __toCommonJS(components_exports); +var import_html = require("../../helper/html"); +var import_base = require("../base"); +var import_children = require("../children"); +var import_constants = require("../constants"); +var import_context = require("../context"); +var import_common = require("./common"); +const metaTagMap = /* @__PURE__ */ new WeakMap(); +const insertIntoHead = (tagName, tag, props, precedence) => ({ buffer, context }) => { + if (!buffer) { + return; + } + const map = metaTagMap.get(context) || {}; + metaTagMap.set(context, map); + const tags = map[tagName] ||= []; + let duped = false; + const deDupeKeys = import_common.deDupeKeyMap[tagName]; + const deDupeByKey = (0, import_common.shouldDeDupeByKey)(tagName, precedence !== void 0); + if (deDupeByKey) { + LOOP: for (const [, tagProps] of tags) { + if (tagName === "link" && !(tagProps.rel === "stylesheet" && tagProps[import_common.dataPrecedenceAttr] !== void 0)) { + continue; + } + for (const key of deDupeKeys) { + if ((tagProps?.[key] ?? null) === props?.[key]) { + duped = true; + break LOOP; + } + } + } + } + if (duped) { + buffer[0] = buffer[0].replaceAll(tag, ""); + } else if (deDupeByKey || tagName === "link") { + tags.push([tag, props, precedence]); + } else { + tags.unshift([tag, props, precedence]); + } + if (buffer[0].indexOf("") !== -1) { + let insertTags; + if (tagName === "link" || precedence !== void 0) { + const precedences = []; + insertTags = tags.map(([tag2, , tagPrecedence], index) => { + if (tagPrecedence === void 0) { + return [tag2, Number.MAX_SAFE_INTEGER, index]; + } + let order = precedences.indexOf(tagPrecedence); + if (order === -1) { + precedences.push(tagPrecedence); + order = precedences.length - 1; + } + return [tag2, order, index]; + }).sort((a, b) => a[1] - b[1] || a[2] - b[2]).map(([tag2]) => tag2); + } else { + insertTags = tags.map(([tag2]) => tag2); + } + insertTags.forEach((tag2) => { + buffer[0] = buffer[0].replaceAll(tag2, ""); + }); + buffer[0] = buffer[0].replace(/(?=<\/head>)/, insertTags.join("")); + } +}; +const returnWithoutSpecialBehavior = (tag, children, props) => (0, import_html.raw)(new import_base.JSXNode(tag, props, (0, import_children.toArray)(children ?? [])).toString()); +const documentMetadataTag = (tag, children, props, sort) => { + if ("itemProp" in props) { + return returnWithoutSpecialBehavior(tag, children, props); + } + let { precedence, blocking, ...restProps } = props; + precedence = sort ? precedence ?? "" : void 0; + if (sort) { + restProps[import_common.dataPrecedenceAttr] = precedence; + } + const string = new import_base.JSXNode(tag, restProps, (0, import_children.toArray)(children || [])).toString(); + if (string instanceof Promise) { + return string.then( + (resString) => (0, import_html.raw)(string, [ + ...resString.callbacks || [], + insertIntoHead(tag, resString, restProps, precedence) + ]) + ); + } else { + return (0, import_html.raw)(string, [insertIntoHead(tag, string, restProps, precedence)]); + } +}; +const title = ({ children, ...props }) => { + const nameSpaceContext = (0, import_base.getNameSpaceContext)(); + if (nameSpaceContext) { + const context = (0, import_context.useContext)(nameSpaceContext); + if (context === "svg" || context === "head") { + return new import_base.JSXNode( + "title", + props, + (0, import_children.toArray)(children ?? []) + ); + } + } + return documentMetadataTag("title", children, props, false); +}; +const script = ({ + children, + ...props +}) => { + const nameSpaceContext = (0, import_base.getNameSpaceContext)(); + if (["src", "async"].some((k) => !props[k]) || nameSpaceContext && (0, import_context.useContext)(nameSpaceContext) === "head") { + return returnWithoutSpecialBehavior("script", children, props); + } + return documentMetadataTag("script", children, props, false); +}; +const style = ({ + children, + ...props +}) => { + if (!["href", "precedence"].every((k) => k in props)) { + return returnWithoutSpecialBehavior("style", children, props); + } + props["data-href"] = props.href; + delete props.href; + return documentMetadataTag("style", children, props, true); +}; +const link = ({ children, ...props }) => { + if (["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { + return returnWithoutSpecialBehavior("link", children, props); + } + return documentMetadataTag("link", children, props, (0, import_common.isStylesheetLinkWithPrecedence)(props)); +}; +const meta = ({ children, ...props }) => { + const nameSpaceContext = (0, import_base.getNameSpaceContext)(); + if (nameSpaceContext && (0, import_context.useContext)(nameSpaceContext) === "head") { + return returnWithoutSpecialBehavior("meta", children, props); + } + return documentMetadataTag("meta", children, props, false); +}; +const newJSXNode = (tag, { children, ...props }) => ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + new import_base.JSXNode(tag, props, (0, import_children.toArray)(children ?? [])) +); +const form = (props) => { + if (typeof props.action === "function") { + props.action = import_constants.PERMALINK in props.action ? props.action[import_constants.PERMALINK] : void 0; + } + return newJSXNode("form", props); +}; +const formActionableElement = (tag, props) => { + if (typeof props.formAction === "function") { + props.formAction = import_constants.PERMALINK in props.formAction ? props.formAction[import_constants.PERMALINK] : void 0; + } + return newJSXNode(tag, props); +}; +const input = (props) => formActionableElement("input", props); +const button = (props) => formActionableElement("button", props); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + button, + form, + input, + link, + meta, + script, + style, + title +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js b/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js new file mode 100644 index 0000000000000000000000000000000000000000..02b274796630a1d6ba0c44ba04e60512d18634a8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var intrinsic_elements_exports = {}; +module.exports = __toCommonJS(intrinsic_elements_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js b/tools/ui/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..ad1d083e0b65a750c437b060b283b3024ac79767 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js @@ -0,0 +1,41 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jsx_dev_runtime_exports = {}; +__export(jsx_dev_runtime_exports, { + Fragment: () => import_base2.Fragment, + jsxDEV: () => jsxDEV +}); +module.exports = __toCommonJS(jsx_dev_runtime_exports); +var import_base = require("./base"); +var import_base2 = require("./base"); +function jsxDEV(tag, props, key) { + let node; + if (!props || !("children" in props)) { + node = (0, import_base.jsxFn)(tag, props, []); + } else { + const children = props.children; + node = Array.isArray(children) ? (0, import_base.jsxFn)(tag, props, children) : (0, import_base.jsxFn)(tag, props, [children]); + } + node.key = key; + return node; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Fragment, + jsxDEV +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/jsx-runtime.js b/tools/ui/node_modules/hono/dist/cjs/jsx/jsx-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..73523f17a4b18921c55efa794a430933c0274da2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/jsx-runtime.js @@ -0,0 +1,71 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jsx_runtime_exports = {}; +__export(jsx_runtime_exports, { + Fragment: () => import_jsx_dev_runtime.Fragment, + jsx: () => import_jsx_dev_runtime.jsxDEV, + jsxAttr: () => jsxAttr, + jsxEscape: () => jsxEscape, + jsxTemplate: () => import_html.html, + jsxs: () => import_jsx_dev_runtime2.jsxDEV +}); +module.exports = __toCommonJS(jsx_runtime_exports); +var import_jsx_dev_runtime = require("./jsx-dev-runtime"); +var import_jsx_dev_runtime2 = require("./jsx-dev-runtime"); +var import_html = require("../helper/html"); +var import_html2 = require("../utils/html"); +var import_utils = require("./utils"); +const jsxAttr = (key, v) => { + if (!(0, import_utils.isValidAttributeName)(key)) { + return (0, import_html.raw)(""); + } + const buffer = [`${key}="`]; + if (key === "style" && typeof v === "object") { + let styleStr = ""; + (0, import_utils.styleObjectForEach)(v, (property, value) => { + if (value != null) { + styleStr += `${styleStr ? ";" : ""}${property}:${value}`; + } + }); + (0, import_html2.escapeToBuffer)(styleStr, buffer); + buffer[0] += '"'; + } else if (typeof v === "string") { + (0, import_html2.escapeToBuffer)(v, buffer); + buffer[0] += '"'; + } else if (v === null || v === void 0) { + return (0, import_html.raw)(""); + } else if (typeof v === "number" || v.isEscaped) { + buffer[0] += `${v}"`; + } else if (v instanceof Promise) { + buffer.unshift('"', v); + } else { + (0, import_html2.escapeToBuffer)(v.toString(), buffer); + buffer[0] += '"'; + } + return buffer.length === 1 ? (0, import_html.raw)(buffer[0]) : (0, import_html2.stringBufferToString)(buffer, void 0); +}; +const jsxEscape = (value) => value; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Fragment, + jsx, + jsxAttr, + jsxEscape, + jsxTemplate, + jsxs +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/streaming.js b/tools/ui/node_modules/hono/dist/cjs/jsx/streaming.js new file mode 100644 index 0000000000000000000000000000000000000000..a4f175f0dad36f58b4f3de12f0246fbd6d06a86c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/streaming.js @@ -0,0 +1,179 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var streaming_exports = {}; +__export(streaming_exports, { + StreamingContext: () => StreamingContext, + Suspense: () => Suspense, + renderToReadableStream: () => renderToReadableStream +}); +module.exports = __toCommonJS(streaming_exports); +var import_html = require("../helper/html"); +var import_html2 = require("../utils/html"); +var import_base = require("./base"); +var import_components = require("./components"); +var import_constants = require("./constants"); +var import_context = require("./context"); +var import_components2 = require("./dom/components"); +var import_render = require("./dom/render"); +const StreamingContext = (0, import_context.createContext)(null); +let suspenseCounter = 0; +const Suspense = async ({ + children, + fallback +}) => { + if (!Array.isArray(children)) { + children = [children]; + } + const nonce = (0, import_context.useContext)(StreamingContext)?.scriptNonce; + let resArray = []; + const stackNode = { [import_constants.DOM_STASH]: [0, []] }; + const popNodeStack = () => { + import_render.buildDataStack.pop(); + }; + try { + stackNode[import_constants.DOM_STASH][0] = 0; + import_render.buildDataStack.push([[], stackNode]); + resArray = children.map( + (c) => c == null || typeof c === "boolean" ? "" : c.toString() + ); + } catch (e) { + if (e instanceof Promise) { + const resume = (0, import_context.captureRenderContext)(); + resArray = [ + e.then( + () => resume(() => { + stackNode[import_constants.DOM_STASH][0] = 0; + import_render.buildDataStack.push([[], stackNode]); + return (0, import_components.childrenToString)(children).finally(popNodeStack); + }) + ) + ]; + } else { + throw e; + } + } finally { + popNodeStack(); + } + if (resArray.some((res) => res instanceof Promise)) { + const index = suspenseCounter++; + const fallbackStr = await fallback.toString(); + return (0, import_html.raw)(`${fallbackStr}`, [ + ...fallbackStr.callbacks || [], + ({ phase, buffer, context }) => { + if (phase === import_html2.HtmlEscapedCallbackPhase.BeforeStream) { + return; + } + return Promise.all(resArray).then(async (htmlArray) => { + htmlArray = htmlArray.flat(); + const content = htmlArray.join(""); + if (buffer) { + buffer[0] = buffer[0].replace( + new RegExp(`.*?`), + content + ); + } + let html = buffer ? "" : ` +((d,c,n) => { +c=d.currentScript.previousSibling +d=d.getElementById('H:${index}') +if(!d)return +do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='/$') +d.replaceWith(c.content) +})(document) +`; + const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); + if (!callbacks.length) { + return html; + } + if (phase === import_html2.HtmlEscapedCallbackPhase.Stream) { + html = await (0, import_html2.resolveCallback)(html, import_html2.HtmlEscapedCallbackPhase.BeforeStream, true, context); + } + return (0, import_html.raw)(html, callbacks); + }); + } + ]); + } else { + return (0, import_html.raw)(resArray.join("")); + } +}; +Suspense[import_constants.DOM_RENDERER] = import_components2.Suspense; +const textEncoder = new TextEncoder(); +const renderToReadableStream = (content, onError = console.trace) => { + let cancelled = false; + const reader = new ReadableStream({ + async start(controller) { + try { + if (content instanceof import_base.JSXNode) { + content = content.toString(); + } + const context = typeof content === "object" ? content : {}; + const resolved = await (0, import_html2.resolveCallback)( + content, + import_html2.HtmlEscapedCallbackPhase.BeforeStream, + true, + context + ); + if (!cancelled) { + controller.enqueue(textEncoder.encode(resolved)); + } + let resolvedCount = 0; + const callbacks = []; + const then = (promise) => { + callbacks.push( + promise.catch((err) => { + console.log(err); + onError(err); + return ""; + }).then(async (res) => { + res = await (0, import_html2.resolveCallback)( + res, + import_html2.HtmlEscapedCallbackPhase.BeforeStream, + true, + context + ); + res.callbacks?.map((c) => c({ phase: import_html2.HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); + resolvedCount++; + if (!cancelled) { + controller.enqueue(textEncoder.encode(res)); + } + }) + ); + }; + resolved.callbacks?.map((c) => c({ phase: import_html2.HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); + while (resolvedCount !== callbacks.length) { + await Promise.all(callbacks); + } + } catch (e) { + onError(e); + } + if (!cancelled) { + controller.close(); + } + }, + cancel() { + cancelled = true; + } + }); + return reader; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + StreamingContext, + Suspense, + renderToReadableStream +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/types.js b/tools/ui/node_modules/hono/dist/cjs/jsx/types.js new file mode 100644 index 0000000000000000000000000000000000000000..81f4408be55bf33a4b69221862e2856a0c1dfa05 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/types.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/jsx/utils.js b/tools/ui/node_modules/hono/dist/cjs/jsx/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..f0f576192b05ab41801c65c2f03ef77181932dc0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/jsx/utils.js @@ -0,0 +1,200 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + isValidAttributeName: () => isValidAttributeName, + isValidTagName: () => isValidTagName, + normalizeIntrinsicElementKey: () => normalizeIntrinsicElementKey, + styleObjectForEach: () => styleObjectForEach +}); +module.exports = __toCommonJS(utils_exports); +const normalizeElementKeyMap = /* @__PURE__ */ new Map([ + ["className", "class"], + ["htmlFor", "for"], + ["crossOrigin", "crossorigin"], + ["httpEquiv", "http-equiv"], + ["itemProp", "itemprop"], + ["fetchPriority", "fetchpriority"], + ["noModule", "nomodule"], + ["formAction", "formaction"] +]); +const normalizeIntrinsicElementKey = (key) => normalizeElementKeyMap.get(key) || key; +const invalidAttributeNameCharRe = /[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/; +const validAttributeNameCache = /* @__PURE__ */ new Set(); +const validAttributeNameCacheMax = 1024; +const invalidTagNameCharRe = /^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/; +const validTagNameCache = /* @__PURE__ */ new Set(); +const validTagNameCacheMax = 256; +const cacheValidName = (cache, max, name) => { + if (cache.size >= max) { + cache.clear(); + } + cache.add(name); +}; +const isValidTagName = (name) => { + if (validTagNameCache.has(name)) { + return true; + } + if (typeof name !== "string") { + return false; + } + if (name.length === 0) { + return true; + } + if (invalidTagNameCharRe.test(name)) { + return false; + } + cacheValidName(validTagNameCache, validTagNameCacheMax, name); + return true; +}; +const isValidAttributeName = (name) => { + if (validAttributeNameCache.has(name)) { + return true; + } + const len = name.length; + if (len === 0) { + return false; + } + for (let i = 0; i < len; i++) { + const c = name.charCodeAt(i); + if (!(c >= 97 && c <= 122 || // a-z + c >= 65 && c <= 90 || // A-Z + c >= 48 && c <= 57 || // 0-9 + c === 45 || // - + c === 95 || // _ + c === 46 || // . + c === 58)) { + if (!invalidAttributeNameCharRe.test(name)) { + cacheValidName(validAttributeNameCache, validAttributeNameCacheMax, name); + return true; + } else { + return false; + } + } + } + cacheValidName(validAttributeNameCache, validAttributeNameCacheMax, name); + return true; +}; +const invalidStylePropertyNameCharRe = /[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/; +const validStylePropertyNameCache = /* @__PURE__ */ new Set(); +const validStylePropertyNameCacheMax = 1024; +const isValidStylePropertyName = (name) => { + if (validStylePropertyNameCache.has(name)) { + return true; + } + const len = name.length; + if (len === 0) { + return false; + } + for (let i = 0; i < len; i++) { + const c = name.charCodeAt(i); + if (!(c >= 97 && c <= 122 || // a-z + c >= 65 && c <= 90 || // A-Z + c >= 48 && c <= 57 || // 0-9 + c === 45 || // - + c === 95)) { + if (!invalidStylePropertyNameCharRe.test(name)) { + cacheValidName(validStylePropertyNameCache, validStylePropertyNameCacheMax, name); + return true; + } else { + return false; + } + } + } + cacheValidName(validStylePropertyNameCache, validStylePropertyNameCacheMax, name); + return true; +}; +const unsafeStyleValueCharRe = /[;"'\\/\[\](){}]/; +const hasUnsafeStyleValue = (value) => { + if (!unsafeStyleValueCharRe.test(value)) { + return false; + } + let quote = 0; + const blockStack = []; + for (let i = 0, len = value.length; i < len; i++) { + const c = value.charCodeAt(i); + if (c === 92) { + if (i === len - 1) { + return true; + } + i++; + } else if (quote !== 0) { + if (c === 10 || c === 12 || c === 13) { + return true; + } + if (c === quote) { + quote = 0; + } + } else if (c === 47 && value.charCodeAt(i + 1) === 42) { + const end = value.indexOf("*/", i + 2); + if (end === -1) { + return true; + } + i = end + 1; + } else if (c === 34 || c === 39) { + quote = c; + } else if (c === 40) { + blockStack.push(41); + } else if (c === 91) { + blockStack.push(93); + } else if (c === 123 || c === 125) { + return true; + } else if (c === 41 || c === 93) { + if (blockStack[blockStack.length - 1] !== c) { + return true; + } + blockStack.pop(); + } else if (c === 59 && blockStack.length === 0) { + return true; + } + } + return quote !== 0 || blockStack.length !== 0; +}; +const styleObjectForEach = (style, fn) => { + for (const [k, v] of Object.entries(style)) { + const key = k[0] === "-" || !/[A-Z]/.test(k) ? k : k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`); + if (!isValidStylePropertyName(key)) { + continue; + } + if (v == null) { + fn(key, null); + continue; + } + let value; + if (typeof v === "number") { + value = !key.match( + /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/ + ) ? `${v}px` : `${v}`; + } else if (typeof v === "string") { + if (hasUnsafeStyleValue(v)) { + continue; + } + value = v; + } else { + continue; + } + fn(key, value); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + isValidAttributeName, + isValidTagName, + normalizeIntrinsicElementKey, + styleObjectForEach +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/basic-auth/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/basic-auth/index.js new file mode 100644 index 0000000000000000000000000000000000000000..eb7ad4a35796c2b4cf77c906940aba4e973aeabb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/basic-auth/index.js @@ -0,0 +1,88 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var basic_auth_exports = {}; +__export(basic_auth_exports, { + basicAuth: () => basicAuth +}); +module.exports = __toCommonJS(basic_auth_exports); +var import_http_exception = require("../../http-exception"); +var import_basic_auth = require("../../utils/basic-auth"); +var import_buffer = require("../../utils/buffer"); +const basicAuth = (options, ...users) => { + const usernamePasswordInOptions = "username" in options && "password" in options; + const verifyUserInOptions = "verifyUser" in options; + if (!(usernamePasswordInOptions || verifyUserInOptions)) { + throw new Error( + 'basic auth middleware requires options for "username and password" or "verifyUser"' + ); + } + if (!options.realm) { + options.realm = "Secure Area"; + } + if (!options.invalidUserMessage) { + options.invalidUserMessage = "Unauthorized"; + } + if (usernamePasswordInOptions) { + users.unshift({ username: options.username, password: options.password }); + } + return async function basicAuth2(ctx, next) { + const requestUser = (0, import_basic_auth.auth)(ctx.req.raw); + if (requestUser) { + if (verifyUserInOptions) { + if (await options.verifyUser(requestUser.username, requestUser.password, ctx)) { + if (options.onAuthSuccess) { + await options.onAuthSuccess(ctx, requestUser.username); + } + await next(); + return; + } + } else { + for (const user of users) { + const [usernameEqual, passwordEqual] = await Promise.all([ + (0, import_buffer.timingSafeEqual)(user.username, requestUser.username, options.hashFunction), + (0, import_buffer.timingSafeEqual)(user.password, requestUser.password, options.hashFunction) + ]); + if (usernameEqual && passwordEqual) { + if (options.onAuthSuccess) { + await options.onAuthSuccess(ctx, requestUser.username); + } + await next(); + return; + } + } + } + } + const status = 401; + const headers = { + "WWW-Authenticate": 'Basic realm="' + options.realm?.replace(/"/g, '\\"') + '"' + }; + const responseMessage = typeof options.invalidUserMessage === "function" ? await options.invalidUserMessage(ctx) : options.invalidUserMessage; + const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { + status, + headers: { + ...headers, + "content-type": "application/json" + } + }); + throw new import_http_exception.HTTPException(status, { res }); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + basicAuth +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f386c3f92b0863bd3ae984848328aecb6f729818 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js @@ -0,0 +1,114 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var bearer_auth_exports = {}; +__export(bearer_auth_exports, { + bearerAuth: () => bearerAuth +}); +module.exports = __toCommonJS(bearer_auth_exports); +var import_http_exception = require("../../http-exception"); +var import_buffer = require("../../utils/buffer"); +const TOKEN_STRINGS = "[A-Za-z0-9._~+/-]+=*"; +const PREFIX = "Bearer"; +const HEADER = "Authorization"; +const bearerAuth = (options) => { + if (!("token" in options || "verifyToken" in options)) { + throw new Error('bearer auth middleware requires options for "token" or "verifyToken"'); + } + if (!options.realm) { + options.realm = ""; + } + if (options.prefix === void 0) { + options.prefix = PREFIX; + } + const realm = options.realm?.replace(/"/g, '\\"'); + const prefix = options.prefix; + const tokenRegexp = new RegExp(`^${TOKEN_STRINGS}$`); + const wwwAuthenticatePrefix = prefix === "" ? "" : `${prefix} `; + const throwHTTPException = async (c, status, wwwAuthenticateHeader, messageOption) => { + const wwwAuthenticateHeaderValue = typeof wwwAuthenticateHeader === "function" ? await wwwAuthenticateHeader(c) : wwwAuthenticateHeader; + const headers = { + "WWW-Authenticate": typeof wwwAuthenticateHeaderValue === "string" ? wwwAuthenticateHeaderValue : `${wwwAuthenticatePrefix}${Object.entries(wwwAuthenticateHeaderValue).map(([key, value]) => `${key}="${value}"`).join(",")}` + }; + const responseMessage = typeof messageOption === "function" ? await messageOption(c) : messageOption; + const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { + status, + headers: { + ...headers, + "content-type": "application/json" + } + }); + throw new import_http_exception.HTTPException(status, { res }); + }; + return async function bearerAuth2(c, next) { + const headerToken = c.req.header(options.headerName || HEADER); + if (!headerToken) { + await throwHTTPException( + c, + 401, + options.noAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}realm="${realm}"`, + options.noAuthenticationHeader?.message || options.noAuthenticationHeaderMessage || "Unauthorized" + ); + } else { + let tokenValue; + if (prefix === "") { + tokenValue = headerToken; + } else { + const headerLower = headerToken.toLowerCase(); + const prefixLower = prefix.toLowerCase(); + if (headerLower.startsWith(prefixLower) && headerToken[prefix.length] === " ") { + tokenValue = headerToken.slice(prefix.length).trimStart(); + } + } + if (!tokenValue || !tokenRegexp.test(tokenValue)) { + await throwHTTPException( + c, + 400, + options.invalidAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_request"`, + options.invalidAuthenticationHeader?.message || options.invalidAuthenticationHeaderMessage || "Bad Request" + ); + } else { + let equal = false; + if ("verifyToken" in options) { + equal = await options.verifyToken(tokenValue, c); + } else if (typeof options.token === "string") { + equal = await (0, import_buffer.timingSafeEqual)(options.token, tokenValue, options.hashFunction); + } else if (Array.isArray(options.token) && options.token.length > 0) { + for (const token of options.token) { + if (await (0, import_buffer.timingSafeEqual)(token, tokenValue, options.hashFunction)) { + equal = true; + break; + } + } + } + if (!equal) { + await throwHTTPException( + c, + 401, + options.invalidToken?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_token"`, + options.invalidToken?.message || options.invalidTokenMessage || "Unauthorized" + ); + } + } + } + await next(); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + bearerAuth +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/body-limit/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/body-limit/index.js new file mode 100644 index 0000000000000000000000000000000000000000..60fabefa5249a52c11bbdc55de6115f56851ba6e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/body-limit/index.js @@ -0,0 +1,75 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var body_limit_exports = {}; +__export(body_limit_exports, { + bodyLimit: () => bodyLimit +}); +module.exports = __toCommonJS(body_limit_exports); +var import_http_exception = require("../../http-exception"); +const ERROR_MESSAGE = "Payload Too Large"; +const bodyLimit = (options) => { + const onError = options.onError || (() => { + const res = new Response(ERROR_MESSAGE, { + status: 413 + }); + throw new import_http_exception.HTTPException(413, { res }); + }); + const maxSize = options.maxSize; + return async function bodyLimit2(c, next) { + if (!c.req.raw.body) { + return next(); + } + const hasTransferEncoding = c.req.raw.headers.has("transfer-encoding"); + const hasContentLength = c.req.raw.headers.has("content-length"); + if (hasContentLength && !hasTransferEncoding) { + const contentLength = parseInt(c.req.raw.headers.get("content-length") || "0", 10); + return contentLength > maxSize ? onError(c) : next(); + } + let size = 0; + const chunks = []; + const rawReader = c.req.raw.body.getReader(); + for (; ; ) { + const { done, value } = await rawReader.read(); + if (done) { + break; + } + size += value.length; + if (size > maxSize) { + return onError(c); + } + chunks.push(value); + } + const requestInit = { + body: new ReadableStream({ + start(controller) { + for (const chunk of chunks) { + controller.enqueue(chunk); + } + controller.close(); + } + }), + duplex: "half" + }; + c.req.raw = new Request(c.req.raw, requestInit); + return next(); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + bodyLimit +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/cache/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/cache/index.js new file mode 100644 index 0000000000000000000000000000000000000000..98cda25a30a8024a3e41327989922fef095903a6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/cache/index.js @@ -0,0 +1,219 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var cache_exports = {}; +__export(cache_exports, { + cache: () => cache +}); +module.exports = __toCommonJS(cache_exports); +var import_request = require("../../request"); +var import_crypto = require("../../utils/crypto"); +const defaultCacheableStatusCodes = [200]; +const defaultMaxQueryBodySize = 64 * 1024; +const cacheKeyPath = "/.hono/cache"; +const cacheKeyParameter = "__hono_cache_key"; +const cacheMethodKeyParameter = "__hono_cache_method"; +const queryDigestKeyParameter = "__hono_query_digest"; +const cacheVaryKeyParameter = "__hono_cache_vary"; +const queryRepresentationMetadataHeaders = [ + "content-type", + "content-encoding", + "content-language", + "content-location" +]; +const shouldSkipCacheControl = (cacheControl) => !!cacheControl && /(?:^|,\s*)(?:private|no-(?:store|cache))(?:\s*(?:=|,|$))/i.test(cacheControl); +const parseVaryDirectives = (vary) => { + if (vary == null) { + return []; + } + return (Array.isArray(vary) ? vary : vary.split(",")).map((directive) => directive.trim().toLowerCase()).filter(Boolean); +}; +const createCacheKey = (key, requestUrl, request, varyHeaders) => { + const url = new URL(cacheKeyPath, requestUrl); + url.searchParams.append(cacheKeyParameter, key.split("#", 1)[0]); + url.searchParams.append(cacheMethodKeyParameter, request.method); + if (request.method === "QUERY") { + url.searchParams.append(queryDigestKeyParameter, request.digest); + } + for (const header of varyHeaders) { + url.searchParams.append(cacheVaryKeyParameter, JSON.stringify(header)); + } + return url.href; +}; +const shouldSkipCache = (res, optionsVaryDirectives, responseVary) => responseVary.length && (!optionsVaryDirectives || responseVary.some((name) => !optionsVaryDirectives.has(name))) || shouldSkipCacheControl(res.headers.get("Cache-Control")) || res.headers.has("Set-Cookie"); +const reportCacheNotAvailable = (onCacheNotAvailable, reason) => { + if (onCacheNotAvailable === false) { + } else if (onCacheNotAvailable) { + onCacheNotAvailable(reason); + } else { + console.log(reason); + } +}; +const createQueryDigest = async (c, maxQueryBodySize) => { + if (!globalThis.crypto?.subtle) { + return void 0; + } + if (c.req.raw.bodyUsed && Object.keys(c.req.bodyCache)[0] === "formData") { + return void 0; + } + try { + const requestHeaders = c.req.raw.headers; + const metadata = new TextEncoder().encode( + JSON.stringify( + queryRepresentationMetadataHeaders.map((header) => [header, requestHeaders.get(header)]) + ) + ); + const body = (await (0, import_request.cloneRawRequest)(c.req)).body; + const chunks = []; + let bodySize = 0; + if (body) { + const reader = body.getReader(); + for (; ; ) { + const { done, value } = await reader.read(); + if (done) { + break; + } + bodySize += value.byteLength; + if (bodySize > maxQueryBodySize) { + void reader.cancel().catch(() => { + }); + return void 0; + } + chunks.push(value); + } + } + const data = new Uint8Array(metadata.byteLength + bodySize); + data.set(metadata); + let offset = metadata.byteLength; + for (const chunk of chunks) { + data.set(chunk, offset); + offset += chunk.byteLength; + } + return await (0, import_crypto.sha256)(data) ?? void 0; + } catch { + return void 0; + } +}; +const cache = (options) => { + if (!globalThis.caches) { + reportCacheNotAvailable( + options.onCacheNotAvailable, + "Cache Middleware is not enabled because caches is not defined." + ); + return async (_c, next) => await next(); + } + if (!globalThis.crypto?.subtle) { + reportCacheNotAvailable( + options.onCacheNotAvailable, + "Cache Middleware cannot cache QUERY requests because Web Crypto is not available." + ); + } + if (options.wait === void 0) { + options.wait = false; + } + const cacheControlDirectives = options.cacheControl?.split(",").map((directive) => directive.toLowerCase()); + const optionsVaryList = parseVaryDirectives(options.vary); + const varyDirectives = optionsVaryList.length ? new Set(optionsVaryList) : void 0; + if (varyDirectives?.has("*")) { + throw new Error( + 'Middleware vary configuration cannot include "*", as it disallows effective caching.' + ); + } + const cacheableStatusCodes = new Set( + options.cacheableStatusCodes ?? defaultCacheableStatusCodes + ); + const maxQueryBodySize = options.maxQueryBodySize ?? defaultMaxQueryBodySize; + const addHeader = (c, responseVary) => { + if (cacheControlDirectives) { + const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0].toLowerCase()) ?? []; + for (const directive of cacheControlDirectives) { + let [name, value] = directive.trim().split("=", 2); + name = name.toLowerCase(); + if (!existingDirectives.includes(name)) { + c.header("Cache-Control", `${name}${value ? `=${value}` : ""}`, { append: true }); + } + } + } + if (varyDirectives) { + if (responseVary.length === 0) { + c.header("Vary", Array.from(varyDirectives).join(", ")); + } else { + const merged = new Set(varyDirectives); + for (const directive of responseVary) { + merged.add(directive); + } + if (merged.has("*")) { + c.header("Vary", "*"); + } else { + c.header("Vary", Array.from(merged).join(", ")); + } + } + } + }; + return async function cache2(c, next) { + if (c.req.method !== "GET" && c.req.method !== "QUERY" || c.req.raw.headers.has("Authorization")) { + await next(); + return; + } + let cacheKeyRequest = { method: "GET" }; + if (c.req.method === "QUERY") { + const digest = await createQueryDigest(c, maxQueryBodySize); + if (digest === void 0) { + await next(); + return; + } + cacheKeyRequest = { method: "QUERY", digest }; + } + let key = c.req.url; + if (options.keyGenerator) { + key = await options.keyGenerator(c); + } + const varyHeaders = []; + if (varyDirectives) { + for (const directive of varyDirectives) { + const value = c.req.raw.headers.get(directive) ?? ""; + varyHeaders.push([directive, value]); + } + } + key = createCacheKey(key, c.req.url, cacheKeyRequest, varyHeaders); + const cacheName = typeof options.cacheName === "function" ? await options.cacheName(c) : options.cacheName; + const cache3 = await caches.open(cacheName); + const response = await cache3.match(key); + if (response) { + return new Response(response.body, response); + } + await next(); + if (!cacheableStatusCodes.has(c.res.status)) { + return; + } + const responseVary = parseVaryDirectives(c.res.headers.get("Vary")); + addHeader(c, responseVary); + if (shouldSkipCache(c.res, varyDirectives, responseVary)) { + return; + } + const res = c.res.clone(); + if (options.wait) { + await cache3.put(key, res); + } else { + c.executionCtx.waitUntil(cache3.put(key, res)); + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + cache +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/combine/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/combine/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a674cb05b1cdd62e4a4ab1e48d41b892f0ff27da --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/combine/index.js @@ -0,0 +1,101 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except2, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except2) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var combine_exports = {}; +__export(combine_exports, { + every: () => every, + except: () => except, + some: () => some +}); +module.exports = __toCommonJS(combine_exports); +var import_compose = require("../../compose"); +var import_router = require("../../router"); +var import_trie_router = require("../../router/trie-router"); +const some = (...middleware) => { + return async function some2(c, next) { + let isNextCalled = false; + const wrappedNext = () => { + isNextCalled = true; + return next(); + }; + let lastError; + for (const handler of middleware) { + try { + const result = await handler(c, wrappedNext); + if (result === true && !c.finalized) { + await wrappedNext(); + } else if (result === false) { + lastError = new Error("No successful middleware found"); + continue; + } + lastError = void 0; + break; + } catch (error) { + lastError = error; + if (isNextCalled) { + break; + } + } + } + if (lastError) { + throw lastError; + } + }; +}; +const every = (...middleware) => { + return async function every2(c, next) { + const currentRouteIndex = c.req.routeIndex; + await (0, import_compose.compose)( + middleware.map((m) => [ + [ + async (c2, next2) => { + c2.req.routeIndex = currentRouteIndex; + const res = await m(c2, next2); + if (res === false) { + throw new Error("Unmet condition"); + } + return res; + } + ] + ]) + )(c, next); + }; +}; +const except = (condition, ...middleware) => { + let router = void 0; + const conditions = (Array.isArray(condition) ? condition : [condition]).map((condition2) => { + if (typeof condition2 === "string") { + router ||= new import_trie_router.TrieRouter(); + router.add(import_router.METHOD_NAME_ALL, condition2, true); + } else { + return condition2; + } + }).filter(Boolean); + if (router) { + conditions.unshift((c) => !!router?.match(import_router.METHOD_NAME_ALL, c.req.path)?.[0]?.[0]?.[0]); + } + const handler = some((c) => conditions.some((cond) => cond(c)), every(...middleware)); + return async function except2(c, next) { + await handler(c, next); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + every, + except, + some +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/compress/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/compress/index.js new file mode 100644 index 0000000000000000000000000000000000000000..98c251d7854f9ec0fe87ce20824c445bc004679c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/compress/index.js @@ -0,0 +1,97 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var compress_exports = {}; +__export(compress_exports, { + COMPRESSIBLE_CONTENT_TYPE_REGEX: () => import_compress.COMPRESSIBLE_CONTENT_TYPE_REGEX, + compress: () => compress +}); +module.exports = __toCommonJS(compress_exports); +var import_accept = require("../../utils/accept"); +var import_compress = require("../../utils/compress"); +const ENCODING_TYPES = ["gzip", "deflate"]; +const cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/i; +const selectEncoding = (header, candidates) => { + if (header === void 0) { + return void 0; + } + const accepts = (0, import_accept.parseAccept)(header); + const wildcardQ = accepts.find((a) => a.type === "*")?.q; + let best; + for (const enc of candidates) { + const explicit = accepts.find((a) => a.type.toLowerCase() === enc); + const q = explicit ? explicit.q : wildcardQ ?? 0; + if (q === 1) { + return enc; + } else if (q > 0 && (!best || q > best.q)) { + best = { encoding: enc, q }; + } + } + return best?.encoding; +}; +const varyAcceptEncodingRegExp = /(?:^|,)\s*accept-encoding\s*(?:,|$)/i; +const compress = (options) => { + const threshold = options?.threshold ?? 1024; + const candidates = options?.encoding ? [options.encoding] : ENCODING_TYPES; + const contentTypeFilter = options?.contentTypeFilter ?? import_compress.COMPRESSIBLE_CONTENT_TYPE_REGEX; + const shouldCompress = typeof contentTypeFilter === "function" ? (res) => { + const type = res.headers.get("Content-Type"); + return type && contentTypeFilter(type); + } : (res) => { + const type = res.headers.get("Content-Type"); + return type && contentTypeFilter.test(type); + }; + return async function compress2(ctx, next) { + await next(); + const contentLength = ctx.res.headers.get("Content-Length"); + if (ctx.res.status === 206 || // partial content, Content-Range refers to the uncompressed bytes + ctx.res.headers.has("Content-Encoding") || // already encoded + ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked + ctx.req.method === "HEAD" || // HEAD request + contentLength && Number(contentLength) < threshold || // content-length below threshold + !shouldCompress(ctx.res) || // not compressible type + !shouldTransform(ctx.res)) { + return; + } + const current = ctx.res.headers.get("Vary"); + if (current !== "*" && !(current && varyAcceptEncodingRegExp.test(current))) { + ctx.header("Vary", current ? `${current}, Accept-Encoding` : "Accept-Encoding"); + } + const accepted = ctx.req.header("Accept-Encoding"); + const encoding = selectEncoding(accepted, candidates); + if (!encoding || !ctx.res.body) { + return; + } + const stream = new CompressionStream(encoding); + ctx.res = new Response(ctx.res.body.pipeThrough(stream), ctx.res); + ctx.res.headers.delete("Content-Length"); + ctx.res.headers.set("Content-Encoding", encoding); + const etag = ctx.res.headers.get("ETag"); + if (etag && !etag.startsWith("W/")) { + ctx.res.headers.set("ETag", `W/${etag}`); + } + }; +}; +const shouldTransform = (res) => { + const cacheControl = res.headers.get("Cache-Control"); + return !cacheControl || !cacheControlNoTransformRegExp.test(cacheControl); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + COMPRESSIBLE_CONTENT_TYPE_REGEX, + compress +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/context-storage/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/context-storage/index.js new file mode 100644 index 0000000000000000000000000000000000000000..69635cdd444f79a28e7de1a4b2039078033b1b52 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/context-storage/index.js @@ -0,0 +1,47 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var context_storage_exports = {}; +__export(context_storage_exports, { + contextStorage: () => contextStorage, + getContext: () => getContext, + tryGetContext: () => tryGetContext +}); +module.exports = __toCommonJS(context_storage_exports); +var import_node_async_hooks = require("node:async_hooks"); +const asyncLocalStorage = new import_node_async_hooks.AsyncLocalStorage(); +const contextStorage = () => { + return async function contextStorage2(c, next) { + await asyncLocalStorage.run(c, next); + }; +}; +const tryGetContext = () => { + return asyncLocalStorage.getStore(); +}; +const getContext = () => { + const context = tryGetContext(); + if (!context) { + throw new Error("Context is not available"); + } + return context; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + contextStorage, + getContext, + tryGetContext +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/cors/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/cors/index.js new file mode 100644 index 0000000000000000000000000000000000000000..28c9608d76bfbc606d1e0c6f8343e099bc4d9cc9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/cors/index.js @@ -0,0 +1,106 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var cors_exports = {}; +__export(cors_exports, { + cors: () => cors +}); +module.exports = __toCommonJS(cors_exports); +const cors = (options) => { + const opts = { + origin: "*", + allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH", "QUERY"], + allowHeaders: [], + exposeHeaders: [], + ...options + }; + const findAllowOrigin = ((optsOrigin) => { + if (typeof optsOrigin === "string") { + if (optsOrigin === "*") { + return () => optsOrigin; + } else { + return (origin) => optsOrigin === origin ? origin : null; + } + } else if (typeof optsOrigin === "function") { + return optsOrigin; + } else { + return (origin) => optsOrigin.includes(origin) ? origin : null; + } + })(opts.origin); + const findAllowMethods = ((optsAllowMethods) => { + if (typeof optsAllowMethods === "function") { + return optsAllowMethods; + } else if (Array.isArray(optsAllowMethods)) { + return () => optsAllowMethods; + } else { + return () => []; + } + })(opts.allowMethods); + return async function cors2(c, next) { + function set(key, value) { + c.res.headers.set(key, value); + } + const allowOrigin = await findAllowOrigin(c.req.header("origin") || "", c); + if (allowOrigin) { + set("Access-Control-Allow-Origin", allowOrigin); + } + if (opts.credentials) { + set("Access-Control-Allow-Credentials", "true"); + } + if (opts.exposeHeaders?.length) { + set("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); + } + if (c.req.method === "OPTIONS") { + if (opts.origin !== "*") { + set("Vary", "Origin"); + } + if (opts.maxAge != null) { + set("Access-Control-Max-Age", opts.maxAge.toString()); + } + const allowMethods = await findAllowMethods(c.req.header("origin") || "", c); + if (allowMethods.length) { + set("Access-Control-Allow-Methods", allowMethods.join(",")); + } + let headers = opts.allowHeaders; + if (!headers?.length) { + const requestHeaders = c.req.header("Access-Control-Request-Headers"); + if (requestHeaders) { + headers = requestHeaders.split(",").map((h) => h.trim()); + } + } + if (headers?.length) { + set("Access-Control-Allow-Headers", headers.join(",")); + c.res.headers.append("Vary", "Access-Control-Request-Headers"); + } + c.res.headers.delete("Content-Length"); + c.res.headers.delete("Content-Type"); + return new Response(null, { + headers: c.res.headers, + status: 204, + statusText: "No Content" + }); + } + await next(); + if (opts.origin !== "*") { + c.header("Vary", "Origin", { append: true }); + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + cors +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/csrf/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/csrf/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e06178853b11d4a8985f1bab72427e79e0f2d6f6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/csrf/index.js @@ -0,0 +1,77 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var csrf_exports = {}; +__export(csrf_exports, { + csrf: () => csrf +}); +module.exports = __toCommonJS(csrf_exports); +var import_http_exception = require("../../http-exception"); +const secFetchSiteValues = ["same-origin", "same-site", "none", "cross-site"]; +const isSecFetchSite = (value) => secFetchSiteValues.includes(value); +const isSafeMethodRe = /^(GET|HEAD)$/; +const isRequestedByFormElementRe = /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)\b/i; +const csrf = (options) => { + const originHandler = ((optsOrigin) => { + if (!optsOrigin) { + return (origin, c) => origin === new URL(c.req.url).origin; + } else if (typeof optsOrigin === "string") { + return (origin) => origin === optsOrigin; + } else if (typeof optsOrigin === "function") { + return optsOrigin; + } else { + return (origin) => optsOrigin.includes(origin); + } + })(options?.origin); + const isAllowedOrigin = async (origin, c) => { + if (origin === void 0) { + return false; + } + return await originHandler(origin, c); + }; + const secFetchSiteHandler = ((optsSecFetchSite) => { + if (!optsSecFetchSite) { + return (secFetchSite) => secFetchSite === "same-origin"; + } else if (typeof optsSecFetchSite === "string") { + return (secFetchSite) => secFetchSite === optsSecFetchSite; + } else if (typeof optsSecFetchSite === "function") { + return optsSecFetchSite; + } else { + return (secFetchSite) => optsSecFetchSite.includes(secFetchSite); + } + })(options?.secFetchSite); + const isAllowedSecFetchSite = async (secFetchSite, c) => { + if (secFetchSite === void 0) { + return false; + } + if (!isSecFetchSite(secFetchSite)) { + return false; + } + return await secFetchSiteHandler(secFetchSite, c); + }; + return async function csrf2(c, next) { + if (!isSafeMethodRe.test(c.req.method) && isRequestedByFormElementRe.test(c.req.header("content-type") || "text/plain") && !await isAllowedSecFetchSite(c.req.header("sec-fetch-site"), c) && !await isAllowedOrigin(c.req.header("origin"), c)) { + const res = new Response("Forbidden", { status: 403 }); + throw new import_http_exception.HTTPException(403, { res }); + } + await next(); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + csrf +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/etag/digest.js b/tools/ui/node_modules/hono/dist/cjs/middleware/etag/digest.js new file mode 100644 index 0000000000000000000000000000000000000000..dfc33cedc2ca62cc14d7bb32d0adc03b6e442bf7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/etag/digest.js @@ -0,0 +1,55 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var digest_exports = {}; +__export(digest_exports, { + generateDigest: () => generateDigest +}); +module.exports = __toCommonJS(digest_exports); +const mergeBuffers = (buffer1, buffer2) => { + if (!buffer1) { + return buffer2; + } + const merged = new Uint8Array( + new ArrayBuffer(buffer1.byteLength + buffer2.byteLength) + ); + merged.set(new Uint8Array(buffer1), 0); + merged.set(buffer2, buffer1.byteLength); + return merged; +}; +const generateDigest = async (stream, generator) => { + if (!stream) { + return null; + } + let result = void 0; + const reader = stream.getReader(); + for (; ; ) { + const { value, done } = await reader.read(); + if (done) { + break; + } + result = await generator(mergeBuffers(result, value)); + } + if (!result) { + return null; + } + return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join(""); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + generateDigest +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/etag/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/etag/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3291dea11adb71905bfc1b81fa8821460b52c201 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/etag/index.js @@ -0,0 +1,96 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var etag_exports = {}; +__export(etag_exports, { + RETAINED_304_HEADERS: () => RETAINED_304_HEADERS, + etag: () => etag +}); +module.exports = __toCommonJS(etag_exports); +var import_digest = require("./digest"); +const RETAINED_304_HEADERS = [ + "cache-control", + "content-location", + "date", + "etag", + "expires", + "vary" +]; +const stripWeak = (tag) => tag.replace(/^W\//, ""); +function etagMatches(etag2, ifNoneMatch) { + return ifNoneMatch != null && ifNoneMatch.split(/,\s*/).some((t) => stripWeak(t) === stripWeak(etag2)); +} +function initializeGenerator(generator) { + if (!generator) { + if (crypto && crypto.subtle) { + generator = (body) => crypto.subtle.digest( + { + name: "SHA-1" + }, + body + ); + } + } + return generator; +} +const etag = (options) => { + const retainedHeaders = options?.retainedHeaders ?? RETAINED_304_HEADERS; + const weak = options?.weak ?? false; + const generator = initializeGenerator(options?.generateDigest); + return async function etag2(c, next) { + const ifNoneMatch = c.req.header("If-None-Match") ?? null; + await next(); + const res = c.res; + let etag3 = res.headers.get("ETag"); + if (!etag3) { + if (!generator) { + return; + } + const hash = await (0, import_digest.generateDigest)( + // This type casing avoids the type error for `deno publish` + res.clone().body, + generator + ); + if (hash === null) { + return; + } + etag3 = weak ? `W/"${hash}"` : `"${hash}"`; + } + const matched = ifNoneMatch === "*" ? (c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") && res.ok : etagMatches(etag3, ifNoneMatch); + if (matched) { + c.res = new Response(null, { + status: 304, + statusText: "Not Modified", + headers: { + ETag: etag3 + } + }); + c.res.headers.forEach((_, key) => { + if (retainedHeaders.indexOf(key.toLowerCase()) === -1) { + c.res.headers.delete(key); + } + }); + } else { + c.res.headers.set("ETag", etag3); + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + RETAINED_304_HEADERS, + etag +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3e82c40859e617f8aa86cee75767e333ca97aa93 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js @@ -0,0 +1,176 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ip_restriction_exports = {}; +__export(ip_restriction_exports, { + ipRestriction: () => ipRestriction +}); +module.exports = __toCommonJS(ip_restriction_exports); +var import_http_exception = require("../../http-exception"); +var import_ipaddr = require("../../utils/ipaddr"); +const IS_CIDR_NOTATION_REGEX = /\/[^/]*$/; +const parseCidrPrefix = (rule, prefix, max) => { + if (!/^[0-9]{1,3}$/.test(prefix)) { + throw new TypeError(`Invalid rule: ${rule}`); + } + const parsedPrefix = parseInt(prefix); + if (parsedPrefix > max) { + throw new TypeError(`Invalid rule: ${rule}`); + } + return parsedPrefix; +}; +const buildMatcher = (rules) => { + const functionRules = []; + const staticRules = /* @__PURE__ */ new Set(); + const staticIPv4Rules = /* @__PURE__ */ new Set(); + const staticIPv6Rules = /* @__PURE__ */ new Set(); + const cidrRules = []; + const registerStaticRule = (rule) => { + const type = (0, import_ipaddr.distinctRemoteAddr)(rule); + if (type === void 0) { + throw new TypeError(`Invalid rule: ${rule}`); + } + if (type === "IPv4") { + const ipv4binary = (0, import_ipaddr.convertIPv4ToBinary)(rule); + staticRules.add(rule); + staticRules.add(`::ffff:${rule}`); + staticIPv4Rules.add(ipv4binary); + staticIPv6Rules.add(0xffffn << 32n | ipv4binary); + } else { + const ipv6binary = (0, import_ipaddr.convertIPv6ToBinary)(rule); + const ipv6Addr = (0, import_ipaddr.convertIPv6BinaryToString)(ipv6binary); + staticRules.add(ipv6Addr); + staticIPv6Rules.add(ipv6binary); + if ((0, import_ipaddr.isIPv4MappedIPv6)(ipv6binary)) { + staticRules.add(ipv6Addr.substring(7)); + staticIPv4Rules.add((0, import_ipaddr.convertIPv4MappedIPv6ToIPv4)(ipv6binary)); + } + } + }; + for (let rule of rules) { + if (rule === "*") { + return () => true; + } else if (typeof rule === "function") { + functionRules.push(rule); + } else { + if (IS_CIDR_NOTATION_REGEX.test(rule)) { + const separatedRule = rule.split("/"); + const addrStr = separatedRule[0]; + const type = (0, import_ipaddr.distinctRemoteAddr)(addrStr); + if (type === void 0) { + throw new TypeError(`Invalid rule: ${rule}`); + } + let isIPv4 = type === "IPv4"; + let prefix = parseCidrPrefix(rule, separatedRule[1], isIPv4 ? 32 : 128); + if (isIPv4 ? prefix === 32 : prefix === 128) { + rule = addrStr; + } else { + let addr = (isIPv4 ? import_ipaddr.convertIPv4ToBinary : import_ipaddr.convertIPv6ToBinary)(addrStr); + if (type === "IPv6" && (0, import_ipaddr.isIPv4MappedIPv6)(addr) && prefix >= 96) { + isIPv4 = true; + addr = (0, import_ipaddr.convertIPv4MappedIPv6ToIPv4)(addr); + prefix -= 96; + } + const mask = (1n << BigInt(prefix)) - 1n << BigInt((isIPv4 ? 32 : 128) - prefix); + cidrRules.push([isIPv4, addr & mask, mask]); + continue; + } + } + registerStaticRule(rule); + } + } + return (remote) => { + if (staticRules.has(remote.addr)) { + return true; + } + const remoteAddr = remote.binaryAddr ||= (remote.isIPv4 ? import_ipaddr.convertIPv4ToBinary : import_ipaddr.convertIPv6ToBinary)(remote.addr); + const remoteIPv4Addr = remote.isIPv4 || (0, import_ipaddr.isIPv4MappedIPv6)(remoteAddr) ? remote.isIPv4 ? remoteAddr : (0, import_ipaddr.convertIPv4MappedIPv6ToIPv4)(remoteAddr) : void 0; + if ((remote.isIPv4 ? staticIPv4Rules : staticIPv6Rules).has(remoteAddr)) { + return true; + } + for (const [isIPv4, addr, mask] of cidrRules) { + if (isIPv4) { + if (remoteIPv4Addr === void 0) { + continue; + } + if ((remoteIPv4Addr & mask) === addr) { + return true; + } + continue; + } + if (remote.isIPv4) { + continue; + } + if ((remoteAddr & mask) === addr) { + return true; + } + } + for (const rule of functionRules) { + if (rule({ addr: remote.addr, type: remote.type })) { + return true; + } + } + return false; + }; +}; +const ipRestriction = (getIP, { denyList = [], allowList = [] }, onError) => { + const allowLength = allowList.length; + const denyMatcher = buildMatcher(denyList); + const allowMatcher = buildMatcher(allowList); + const blockError = (c) => new import_http_exception.HTTPException(403, { + res: c.text("Forbidden", { + status: 403 + }) + }); + return async function ipRestriction2(c, next) { + const connInfo = getIP(c); + const addr = typeof connInfo === "string" ? connInfo : connInfo.remote.address; + if (!addr) { + throw blockError(c); + } + const type = typeof connInfo !== "string" && connInfo.remote.addressType || (0, import_ipaddr.distinctRemoteAddr)(addr); + const remoteData = { addr, type, isIPv4: type === "IPv4" }; + try { + if (denyMatcher(remoteData)) { + if (onError) { + return onError({ addr, type }, c); + } + throw blockError(c); + } + if (allowMatcher(remoteData)) { + return await next(); + } + } catch (e) { + if (e instanceof TypeError && e.code === import_ipaddr.INVALID_IP_ADDRESS_ERROR_CODE) { + throw blockError(c); + } + throw e; + } + if (allowLength === 0) { + return await next(); + } else { + if (onError) { + return await onError({ addr, type }, c); + } + throw blockError(c); + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ipRestriction +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4a047802f3be3dc9fcc3e8ed55450a7f00e63cbf --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js @@ -0,0 +1,82 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jsx_renderer_exports = {}; +__export(jsx_renderer_exports, { + RequestContext: () => RequestContext, + jsxRenderer: () => jsxRenderer, + useRequestContext: () => useRequestContext +}); +module.exports = __toCommonJS(jsx_renderer_exports); +var import_html = require("../../helper/html"); +var import_jsx = require("../../jsx"); +var import_streaming = require("../../jsx/streaming"); +const RequestContext = (0, import_jsx.createContext)(null); +const createRenderer = (c, Layout, component, options) => (children, props) => { + options = typeof options === "function" ? options(c) : options; + const docType = typeof options?.docType === "string" ? options.docType : options?.docType === false ? "" : ""; + const currentLayout = component ? (0, import_jsx.jsx)( + (props2) => component(props2, c), + { + Layout, + ...props + }, + children + ) : children; + const body = import_html.html`${(0, import_html.raw)(docType)}${(0, import_jsx.jsx)( + RequestContext.Provider, + { value: c }, + currentLayout + )}`; + if (options?.stream) { + if (options.stream === true) { + c.header("Transfer-Encoding", "chunked"); + c.header("Content-Type", "text/html; charset=UTF-8"); + c.header("Content-Encoding", "Identity"); + } else { + for (const [key, value] of Object.entries(options.stream)) { + c.header(key, value); + } + } + return c.body((0, import_streaming.renderToReadableStream)(body)); + } else { + return c.html(body); + } +}; +const jsxRenderer = (component, options) => function jsxRenderer2(c, next) { + const Layout = c.getLayout() ?? import_jsx.Fragment; + if (component) { + c.setLayout((props) => { + return component({ ...props, Layout }, c); + }); + } + c.setRenderer(createRenderer(c, Layout, component, options)); + return next(); +}; +const useRequestContext = () => { + const c = (0, import_jsx.useContext)(RequestContext); + if (!c) { + throw new Error("RequestContext is not provided."); + } + return c; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + RequestContext, + jsxRenderer, + useRequestContext +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/jwk/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/jwk/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a0684b5a84ad74185e575e5583df936683be4d2e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/jwk/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jwk_exports = {}; +__export(jwk_exports, { + jwk: () => import_jwk.jwk +}); +module.exports = __toCommonJS(jwk_exports); +var import_jwk = require("./jwk"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + jwk +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/jwk/jwk.js b/tools/ui/node_modules/hono/dist/cjs/middleware/jwk/jwk.js new file mode 100644 index 0000000000000000000000000000000000000000..d262cac69aa7526d9a4d644929e95830d93daefe --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/jwk/jwk.js @@ -0,0 +1,139 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jwk_exports = {}; +__export(jwk_exports, { + jwk: () => jwk +}); +module.exports = __toCommonJS(jwk_exports); +var import_cookie = require("../../helper/cookie"); +var import_http_exception = require("../../http-exception"); +var import_jwt = require("../../utils/jwt"); +var import_context = require("../../context"); +const jwk = (options, init) => { + const verifyOpts = options.verification || {}; + if (!options || !(options.keys || options.jwks_uri)) { + throw new Error('JWK auth middleware requires options for either "keys" or "jwks_uri" or both'); + } + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWK auth middleware requires it."); + } + return async function jwk2(ctx, next) { + const headerName = options.headerName || "Authorization"; + const credentials = ctx.req.raw.headers.get(headerName); + let token; + if (credentials) { + const parts = credentials.split(/\s+/); + if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") { + const errDescription = "invalid credentials structure"; + throw new import_http_exception.HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } else { + token = parts[1]; + } + } else if (options.cookie) { + if (typeof options.cookie == "string") { + token = (0, import_cookie.getCookie)(ctx, options.cookie); + } else if (options.cookie.secret) { + if (options.cookie.prefixOptions) { + token = await (0, import_cookie.getSignedCookie)( + ctx, + options.cookie.secret, + options.cookie.key, + options.cookie.prefixOptions + ); + } else { + token = await (0, import_cookie.getSignedCookie)(ctx, options.cookie.secret, options.cookie.key); + } + } else { + if (options.cookie.prefixOptions) { + token = (0, import_cookie.getCookie)(ctx, options.cookie.key, options.cookie.prefixOptions); + } else { + token = (0, import_cookie.getCookie)(ctx, options.cookie.key); + } + } + } + if (!token) { + if (options.allow_anon) { + return next(); + } + const errDescription = "no authorization included in request"; + throw new import_http_exception.HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } + let payload; + let cause; + try { + const keys = typeof options.keys === "function" ? await options.keys(ctx) : options.keys; + const jwks_uri = typeof options.jwks_uri === "function" ? await options.jwks_uri(ctx) : options.jwks_uri; + payload = await import_jwt.Jwt.verifyWithJwks( + token, + { keys, jwks_uri, verification: verifyOpts, allowedAlgorithms: options.alg }, + init + ); + } catch (e) { + cause = e; + } + if (!payload) { + if (cause instanceof Error && cause.constructor === Error) { + throw cause; + } + throw new import_http_exception.HTTPException(401, { + message: "Unauthorized", + res: unauthorizedResponse({ + ctx, + error: "invalid_token", + statusText: "Unauthorized", + errDescription: "token verification failure", + realm: options.realm + }), + cause + }); + } + ctx.set("jwtPayload", payload); + await next(); + }; +}; +function unauthorizedResponse(opts) { + const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, '\\"'); + const errDescription = opts.errDescription.replace(/"/g, '\\"'); + return new Response("Unauthorized", { + status: 401, + statusText: opts.statusText, + headers: { + "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` + } + }); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + jwk +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/jwt/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/jwt/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b7d106dfd75cb4676b95e730ec981f2c3d784ef6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/jwt/index.js @@ -0,0 +1,38 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jwt_exports = {}; +__export(jwt_exports, { + AlgorithmTypes: () => import_jwa.AlgorithmTypes, + decode: () => import_jwt.decode, + jwt: () => import_jwt.jwt, + sign: () => import_jwt.sign, + verify: () => import_jwt.verify, + verifyWithJwks: () => import_jwt.verifyWithJwks +}); +module.exports = __toCommonJS(jwt_exports); +var import_jwt = require("./jwt"); +var import_jwa = require("../../utils/jwt/jwa"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + AlgorithmTypes, + decode, + jwt, + sign, + verify, + verifyWithJwks +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/jwt/jwt.js b/tools/ui/node_modules/hono/dist/cjs/middleware/jwt/jwt.js new file mode 100644 index 0000000000000000000000000000000000000000..b7e9636647d9a7b42e213682b7629389c2f104ae --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/jwt/jwt.js @@ -0,0 +1,145 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jwt_exports = {}; +__export(jwt_exports, { + decode: () => decode, + jwt: () => jwt, + sign: () => sign, + verify: () => verify, + verifyWithJwks: () => verifyWithJwks +}); +module.exports = __toCommonJS(jwt_exports); +var import_cookie = require("../../helper/cookie"); +var import_http_exception = require("../../http-exception"); +var import_jwt = require("../../utils/jwt"); +var import_context = require("../../context"); +const jwt = (options) => { + const verifyOpts = options.verification || {}; + if (!options || !options.secret) { + throw new Error('JWT auth middleware requires options for "secret"'); + } + if (!options.alg) { + throw new Error('JWT auth middleware requires options for "alg"'); + } + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); + } + return async function jwt2(ctx, next) { + const headerName = options.headerName || "Authorization"; + const credentials = ctx.req.raw.headers.get(headerName); + let token; + if (credentials) { + const parts = credentials.split(/\s+/); + if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") { + const errDescription = "invalid credentials structure"; + throw new import_http_exception.HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } else { + token = parts[1]; + } + } else if (options.cookie) { + if (typeof options.cookie == "string") { + token = (0, import_cookie.getCookie)(ctx, options.cookie); + } else if (options.cookie.secret) { + if (options.cookie.prefixOptions) { + token = await (0, import_cookie.getSignedCookie)( + ctx, + options.cookie.secret, + options.cookie.key, + options.cookie.prefixOptions + ); + } else { + token = await (0, import_cookie.getSignedCookie)(ctx, options.cookie.secret, options.cookie.key); + } + } else { + if (options.cookie.prefixOptions) { + token = (0, import_cookie.getCookie)(ctx, options.cookie.key, options.cookie.prefixOptions); + } else { + token = (0, import_cookie.getCookie)(ctx, options.cookie.key); + } + } + } + if (!token) { + const errDescription = "no authorization included in request"; + throw new import_http_exception.HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } + let payload; + let cause; + try { + payload = await import_jwt.Jwt.verify(token, options.secret, { + alg: options.alg, + ...verifyOpts + }); + } catch (e) { + cause = e; + } + if (!payload) { + throw new import_http_exception.HTTPException(401, { + message: "Unauthorized", + res: unauthorizedResponse({ + ctx, + error: "invalid_token", + statusText: "Unauthorized", + errDescription: "token verification failure", + realm: options.realm + }), + cause + }); + } + ctx.set("jwtPayload", payload); + await next(); + }; +}; +function unauthorizedResponse(opts) { + const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, '\\"'); + const errDescription = opts.errDescription.replace(/"/g, '\\"'); + return new Response("Unauthorized", { + status: 401, + statusText: opts.statusText, + headers: { + "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` + } + }); +} +const verifyWithJwks = import_jwt.Jwt.verifyWithJwks; +const verify = import_jwt.Jwt.verify; +const decode = import_jwt.Jwt.decode; +const sign = import_jwt.Jwt.sign; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + decode, + jwt, + sign, + verify, + verifyWithJwks +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/language/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/language/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1441607efc343733085c7d153fb152081f1c89a1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/language/index.js @@ -0,0 +1,35 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var language_exports = {}; +__export(language_exports, { + detectFromCookie: () => import_language.detectFromCookie, + detectFromHeader: () => import_language.detectFromHeader, + detectFromPath: () => import_language.detectFromPath, + detectFromQuery: () => import_language.detectFromQuery, + languageDetector: () => import_language.languageDetector +}); +module.exports = __toCommonJS(language_exports); +var import_language = require("./language"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + detectFromCookie, + detectFromHeader, + detectFromPath, + detectFromQuery, + languageDetector +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/language/language.js b/tools/ui/node_modules/hono/dist/cjs/middleware/language/language.js new file mode 100644 index 0000000000000000000000000000000000000000..a705448d0e0d57beee518cdc1cd51c3919ed867f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/language/language.js @@ -0,0 +1,203 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var language_exports = {}; +__export(language_exports, { + DEFAULT_OPTIONS: () => DEFAULT_OPTIONS, + detectFromCookie: () => detectFromCookie, + detectFromHeader: () => detectFromHeader, + detectFromPath: () => detectFromPath, + detectFromQuery: () => detectFromQuery, + detectors: () => detectors, + languageDetector: () => languageDetector, + normalizeLanguage: () => normalizeLanguage, + parseAcceptLanguage: () => parseAcceptLanguage, + validateOptions: () => validateOptions +}); +module.exports = __toCommonJS(language_exports); +var import_cookie = require("../../helper/cookie"); +var import_accept = require("../../utils/accept"); +const DEFAULT_OPTIONS = { + order: ["querystring", "cookie", "header"], + lookupQueryString: "lang", + lookupCookie: "language", + lookupFromHeaderKey: "accept-language", + lookupFromPathIndex: 0, + caches: ["cookie"], + ignoreCase: true, + fallbackLanguage: "en", + supportedLanguages: ["en"], + cookieOptions: { + sameSite: "Strict", + secure: true, + maxAge: 365 * 24 * 60 * 60, + httpOnly: true + }, + debug: false +}; +function parseAcceptLanguage(header) { + return (0, import_accept.parseAccept)(header).map(({ type, q }) => ({ lang: type, q })); +} +const normalizeLanguage = (lang, options) => { + if (!lang) { + return void 0; + } + try { + let normalizedLang = lang.trim(); + if (options.convertDetectedLanguage) { + normalizedLang = options.convertDetectedLanguage(normalizedLang); + } + const compLang = options.ignoreCase ? normalizedLang.toLowerCase() : normalizedLang; + const compSupported = options.supportedLanguages.map( + (l) => options.ignoreCase ? l.toLowerCase() : l + ); + const exactIndex = compSupported.indexOf(compLang); + if (exactIndex !== -1) { + return options.supportedLanguages[exactIndex]; + } + let longestMatchIndex = -1; + let longestMatchLength = -1; + for (let i = 0; i < compSupported.length; i++) { + const candidate = compSupported[i]; + if (candidate.length < compLang.length && candidate.length > longestMatchLength && compLang.startsWith(candidate) && compLang[candidate.length] === "-") { + longestMatchIndex = i; + longestMatchLength = candidate.length; + } + } + if (longestMatchIndex !== -1) { + return options.supportedLanguages[longestMatchIndex]; + } + return void 0; + } catch { + return void 0; + } +}; +const detectFromQuery = (c, options) => { + const query = c.req.query(options.lookupQueryString); + return normalizeLanguage(query, options); +}; +const detectFromCookie = (c, options) => { + const cookie = (0, import_cookie.getCookie)(c, options.lookupCookie); + return normalizeLanguage(cookie, options); +}; +function detectFromHeader(c, options) { + try { + const acceptLanguage = c.req.header(options.lookupFromHeaderKey); + if (!acceptLanguage) { + return void 0; + } + const languages = parseAcceptLanguage(acceptLanguage); + for (const { lang } of languages) { + const normalizedLang = normalizeLanguage(lang, options); + if (normalizedLang) { + return normalizedLang; + } + } + return void 0; + } catch { + return void 0; + } +} +function detectFromPath(c, options) { + const url = new URL(c.req.url); + const pathSegments = url.pathname.split("/").filter(Boolean); + const langSegment = pathSegments[options.lookupFromPathIndex]; + return normalizeLanguage(langSegment, options); +} +const detectors = { + querystring: detectFromQuery, + cookie: detectFromCookie, + header: detectFromHeader, + path: detectFromPath +}; +function validateOptions(options) { + if (!options.supportedLanguages.includes(options.fallbackLanguage)) { + throw new Error("Fallback language must be included in supported languages"); + } + if (options.lookupFromPathIndex < 0) { + throw new Error("Path index must be non-negative"); + } + if (!options.order.every((detector) => Object.keys(detectors).includes(detector))) { + throw new Error("Invalid detector type in order array"); + } +} +function cacheLanguage(c, language, options) { + if (!Array.isArray(options.caches) || !options.caches.includes("cookie")) { + return; + } + try { + (0, import_cookie.setCookie)(c, options.lookupCookie, language, options.cookieOptions); + } catch (error) { + if (options.debug) { + console.error("Failed to cache language:", error); + } + } +} +const detectLanguage = (c, options) => { + let detectedLang; + for (const detectorName of options.order) { + const detector = detectors[detectorName]; + try { + detectedLang = detector(c, options); + if (detectedLang) { + if (options.debug) { + console.log(`Language detected from ${detectorName}: ${detectedLang}`); + } + break; + } + } catch (error) { + if (options.debug) { + console.error(`Error in ${detectorName} detector:`, error); + } + continue; + } + } + const finalLang = detectedLang || options.fallbackLanguage; + if (detectedLang && options.caches) { + cacheLanguage(c, finalLang, options); + } + return finalLang; +}; +const languageDetector = (userOptions) => { + const options = { + ...DEFAULT_OPTIONS, + ...userOptions, + cookieOptions: { + ...DEFAULT_OPTIONS.cookieOptions, + ...userOptions.cookieOptions + } + }; + validateOptions(options); + return async function languageDetector2(ctx, next) { + const lang = detectLanguage(ctx, options); + ctx.set("language", lang); + await next(); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + DEFAULT_OPTIONS, + detectFromCookie, + detectFromHeader, + detectFromPath, + detectFromQuery, + detectors, + languageDetector, + normalizeLanguage, + parseAcceptLanguage, + validateOptions +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/logger/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/logger/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f83e9a05103437512386a04e0c56bb2ea7329757 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/logger/index.js @@ -0,0 +1,72 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var logger_exports = {}; +__export(logger_exports, { + logger: () => logger +}); +module.exports = __toCommonJS(logger_exports); +var import_color = require("../../utils/color"); +var LogPrefix = /* @__PURE__ */ ((LogPrefix2) => { + LogPrefix2["Outgoing"] = "-->"; + LogPrefix2["Incoming"] = "<--"; + LogPrefix2["Error"] = "xxx"; + return LogPrefix2; +})(LogPrefix || {}); +const humanize = (times) => { + const [delimiter, separator] = [",", "."]; + const orderTimes = times.map((v) => v.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter)); + return orderTimes.join(separator); +}; +const time = (start) => { + const delta = Date.now() - start; + return humanize([delta < 1e3 ? delta + "ms" : Math.round(delta / 1e3) + "s"]); +}; +const colorStatus = async (status) => { + const colorEnabled = await (0, import_color.getColorEnabledAsync)(); + if (colorEnabled) { + switch (status / 100 | 0) { + case 5: + return `\x1B[31m${status}\x1B[0m`; + case 4: + return `\x1B[33m${status}\x1B[0m`; + case 3: + return `\x1B[36m${status}\x1B[0m`; + case 2: + return `\x1B[32m${status}\x1B[0m`; + } + } + return `${status}`; +}; +async function log(fn, prefix, method, path, status = 0, elapsed) { + const out = prefix === "<--" /* Incoming */ ? `${prefix} ${method} ${path}` : `${prefix} ${method} ${path} ${await colorStatus(status)} ${elapsed}`; + fn(out); +} +const logger = (fn = console.log) => { + return async function logger2(c, next) { + const { method, url } = c.req; + const path = url.slice(url.indexOf("/", 8)); + await log(fn, "<--" /* Incoming */, method, path); + const start = Date.now(); + await next(); + await log(fn, "-->" /* Outgoing */, method, path, c.res.status, time(start)); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + logger +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b85c49e4f56c10ccdf705749df675cd9311fef44 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js @@ -0,0 +1,90 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var method_not_allowed_exports = {}; +__export(method_not_allowed_exports, { + methodNotAllowed: () => methodNotAllowed +}); +module.exports = __toCommonJS(method_not_allowed_exports); +var import_route = require("../../helper/route"); +var import_router = require("../../router"); +var import_trie_router = require("../../router/trie-router"); +const methodNotAllowed = (options) => { + let methodRouter; + return async function methodNotAllowed2(c, next) { + const routeIndex = c.req.routeIndex; + await next(); + if (c.res.status !== 404) { + return; + } + if (c.error) { + return; + } + if (!methodRouter) { + const methodsByPath = /* @__PURE__ */ new Map(); + for (const route of options.app.routes) { + if (route.method === import_router.METHOD_NAME_ALL || route.method === "HEAD") { + continue; + } + const methods2 = methodsByPath.get(route.path) ?? /* @__PURE__ */ new Set(); + methods2.add(route.method); + if (route.method === "GET") { + methods2.add("HEAD"); + } + methodsByPath.set(route.path, methods2); + } + methodRouter = new import_trie_router.TrieRouter(); + for (const [path, methods2] of methodsByPath) { + methodRouter.add(import_router.METHOD_NAME_ALL, path, [...methods2]); + } + } + let requestPath = c.req.path; + const routes = (0, import_route.matchedRoutes)(c); + const currentRoute = routes[routeIndex]; + const sourceRoute = options.app.routes.find((route) => route.handler === methodNotAllowed2); + if (currentRoute && sourceRoute) { + const currentBasePathParts = (0, import_route.basePath)(c, routeIndex).split("/").filter(Boolean); + const sourceBasePathLength = sourceRoute.basePath.split("/").filter(Boolean).length; + const mountBasePathParts = currentBasePathParts.slice( + 0, + currentBasePathParts.length - sourceBasePathLength + ); + if (mountBasePathParts.length > 0) { + const mountBasePath = `/${mountBasePathParts.join("/")}`; + requestPath = c.req.path.slice(mountBasePath.length) || "/"; + } + } + const allowedMethods = /* @__PURE__ */ new Set(); + for (const [methods2] of methodRouter.match(import_router.METHOD_NAME_ALL, requestPath)[0]) { + for (const method of methods2) { + allowedMethods.add(method); + } + } + if (allowedMethods.size === 0 || allowedMethods.has(c.req.method)) { + return; + } + c.res.headers.delete("Allow"); + c.res.headers.delete("Content-Length"); + const methods = [...allowedMethods]; + const allow = methods.join(", "); + c.res = options.onMethodNotAllowed ? await options.onMethodNotAllowed(c, methods) : c.text("Method Not Allowed", 405, { Allow: allow }); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + methodNotAllowed +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/method-override/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/method-override/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cca4ff24cb608bfd5744c23e76cc67d5a5d2e734 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/method-override/index.js @@ -0,0 +1,106 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var method_override_exports = {}; +__export(method_override_exports, { + methodOverride: () => methodOverride +}); +module.exports = __toCommonJS(method_override_exports); +var import_body = require("../../utils/body"); +const DEFAULT_METHOD_FORM_NAME = "_method"; +const methodOverride = (options) => async function methodOverride2(c, next) { + if (c.req.method === "GET") { + return await next(); + } + const app = options.app; + if (!(options.header || options.query)) { + const contentType = c.req.header("content-type"); + const methodFormName = options.form || DEFAULT_METHOD_FORM_NAME; + const clonedRequest = c.req.raw.clone(); + const newRequest = clonedRequest.clone(); + if (contentType?.startsWith("multipart/form-data")) { + const form = await clonedRequest.formData(); + const method = form.get(methodFormName); + if (method) { + const newForm = await newRequest.formData(); + newForm.delete(methodFormName); + const newHeaders = new Headers(clonedRequest.headers); + newHeaders.delete("content-type"); + newHeaders.delete("content-length"); + const request = new Request(c.req.url, { + body: newForm, + headers: newHeaders, + method + }); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } + if (contentType?.startsWith("application/x-www-form-urlencoded")) { + const params = await (0, import_body.parseBody)(clonedRequest); + const method = params[methodFormName]; + if (method) { + delete params[methodFormName]; + const newParams = new URLSearchParams(params); + const request = new Request(newRequest, { + body: newParams, + method + }); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } + } else if (options.header) { + const headerName = options.header; + const method = c.req.header(headerName); + if (method) { + const newHeaders = new Headers(c.req.raw.headers); + newHeaders.delete(headerName); + const request = new Request(c.req.raw, { + headers: newHeaders, + method + }); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } else if (options.query) { + const queryName = options.query; + const method = c.req.query(queryName); + if (method) { + const url = new URL(c.req.url); + url.searchParams.delete(queryName); + const requestInit = { + body: c.req.raw.body, + headers: c.req.raw.headers, + method, + duplex: c.req.raw.body ? "half" : void 0 + }; + const request = new Request(url.toString(), requestInit); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } + await next(); +}; +const getExecutionCtx = (c) => { + let executionCtx; + try { + executionCtx = c.executionCtx; + } catch { + } + return executionCtx; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + methodOverride +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/powered-by/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/powered-by/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8425ba51959ea19d7d9503e4ab6caecb151914b2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/powered-by/index.js @@ -0,0 +1,32 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var powered_by_exports = {}; +__export(powered_by_exports, { + poweredBy: () => poweredBy +}); +module.exports = __toCommonJS(powered_by_exports); +const poweredBy = (options) => { + return async function poweredBy2(c, next) { + await next(); + c.res.headers.set("X-Powered-By", options?.serverName ?? "Hono"); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + poweredBy +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/pretty-json/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/pretty-json/index.js new file mode 100644 index 0000000000000000000000000000000000000000..42e8bd0e8c0a57fd08a521f1befd8296225f210f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/pretty-json/index.js @@ -0,0 +1,37 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var pretty_json_exports = {}; +__export(pretty_json_exports, { + prettyJSON: () => prettyJSON +}); +module.exports = __toCommonJS(pretty_json_exports); +const prettyJSON = (options) => { + const targetQuery = options?.query ?? "pretty"; + return async function prettyJSON2(c, next) { + const pretty = options?.force || c.req.query(targetQuery) || c.req.query(targetQuery) === ""; + await next(); + if (pretty && c.res.headers.get("Content-Type")?.startsWith("application/json")) { + const obj = await c.res.json(); + c.res = new Response(JSON.stringify(obj, null, options?.space ?? 2), c.res); + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + prettyJSON +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/request-id/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/request-id/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2dbe4c37707ef26344a155591a091e9891d00104 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/request-id/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var request_id_exports = {}; +__export(request_id_exports, { + requestId: () => import_request_id.requestId +}); +module.exports = __toCommonJS(request_id_exports); +var import_request_id = require("./request-id"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + requestId +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/request-id/request-id.js b/tools/ui/node_modules/hono/dist/cjs/middleware/request-id/request-id.js new file mode 100644 index 0000000000000000000000000000000000000000..5c8b28208d61387a0564b8296cb2ccbf4d4f887a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/request-id/request-id.js @@ -0,0 +1,43 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var request_id_exports = {}; +__export(request_id_exports, { + requestId: () => requestId +}); +module.exports = __toCommonJS(request_id_exports); +const requestId = ({ + limitLength = 255, + headerName = "X-Request-Id", + generator = () => crypto.randomUUID() +} = {}) => { + return async function requestId2(c, next) { + let reqId = headerName ? c.req.header(headerName) : void 0; + if (!reqId || reqId.length > limitLength || /[^\w\-=]/.test(reqId)) { + reqId = generator(c); + } + c.set("requestId", reqId); + if (headerName) { + c.header(headerName, reqId); + } + await next(); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + requestId +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a8bd5b178c346e6e2e7026675fcb34008d4dab43 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/index.js @@ -0,0 +1,29 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var secure_headers_exports = {}; +__export(secure_headers_exports, { + NONCE: () => import_secure_headers.NONCE, + secureHeaders: () => import_secure_headers.secureHeaders +}); +module.exports = __toCommonJS(secure_headers_exports); +var import_secure_headers = require("./secure-headers"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + NONCE, + secureHeaders +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js b/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js new file mode 100644 index 0000000000000000000000000000000000000000..53ee0648f82b95924bad7dfb22b4211114dce0c7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var permissions_policy_exports = {}; +module.exports = __toCommonJS(permissions_policy_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js b/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js new file mode 100644 index 0000000000000000000000000000000000000000..7a8812a8c8ae99ae904f0d986bdd35520a57eb50 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js @@ -0,0 +1,195 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var secure_headers_exports = {}; +__export(secure_headers_exports, { + NONCE: () => NONCE, + secureHeaders: () => secureHeaders +}); +module.exports = __toCommonJS(secure_headers_exports); +var import_encode = require("../../utils/encode"); +const HEADERS_MAP = { + crossOriginEmbedderPolicy: ["Cross-Origin-Embedder-Policy", "require-corp"], + crossOriginResourcePolicy: ["Cross-Origin-Resource-Policy", "same-origin"], + crossOriginOpenerPolicy: ["Cross-Origin-Opener-Policy", "same-origin"], + originAgentCluster: ["Origin-Agent-Cluster", "?1"], + referrerPolicy: ["Referrer-Policy", "no-referrer"], + strictTransportSecurity: ["Strict-Transport-Security", "max-age=15552000; includeSubDomains"], + xContentTypeOptions: ["X-Content-Type-Options", "nosniff"], + xDnsPrefetchControl: ["X-DNS-Prefetch-Control", "off"], + xDownloadOptions: ["X-Download-Options", "noopen"], + xFrameOptions: ["X-Frame-Options", "SAMEORIGIN"], + xPermittedCrossDomainPolicies: ["X-Permitted-Cross-Domain-Policies", "none"], + xXssProtection: ["X-XSS-Protection", "0"] +}; +const DEFAULT_OPTIONS = { + crossOriginEmbedderPolicy: false, + crossOriginResourcePolicy: true, + crossOriginOpenerPolicy: true, + originAgentCluster: true, + referrerPolicy: true, + strictTransportSecurity: true, + xContentTypeOptions: true, + xDnsPrefetchControl: true, + xDownloadOptions: true, + xFrameOptions: true, + xPermittedCrossDomainPolicies: true, + xXssProtection: true, + removePoweredBy: true, + permissionsPolicy: {} +}; +const generateNonce = () => { + const arrayBuffer = new Uint8Array(16); + crypto.getRandomValues(arrayBuffer); + return (0, import_encode.encodeBase64)(arrayBuffer.buffer); +}; +const NONCE = (ctx) => { + const key = "secureHeadersNonce"; + const init = ctx.get(key); + const nonce = init || generateNonce(); + if (init == null) { + ctx.set(key, nonce); + } + return `'nonce-${nonce}'`; +}; +const secureHeaders = (customOptions) => { + const options = { ...DEFAULT_OPTIONS, ...customOptions }; + const headersToSet = getFilteredHeaders(options); + const callbacks = []; + if (options.contentSecurityPolicy) { + const [callback, value] = getCSPDirectives( + options.contentSecurityPolicy, + "Content-Security-Policy" + ); + if (callback) { + callbacks.push(callback); + } + headersToSet.push(["Content-Security-Policy", value]); + } + if (options.contentSecurityPolicyReportOnly) { + const [callback, value] = getCSPDirectives( + options.contentSecurityPolicyReportOnly, + "Content-Security-Policy-Report-Only" + ); + if (callback) { + callbacks.push(callback); + } + headersToSet.push(["Content-Security-Policy-Report-Only", value]); + } + if (options.permissionsPolicy && Object.keys(options.permissionsPolicy).length > 0) { + headersToSet.push([ + "Permissions-Policy", + getPermissionsPolicyDirectives(options.permissionsPolicy) + ]); + } + if (options.reportingEndpoints) { + headersToSet.push(["Reporting-Endpoints", getReportingEndpoints(options.reportingEndpoints)]); + } + if (options.reportTo) { + headersToSet.push(["Report-To", getReportToOptions(options.reportTo)]); + } + return async function secureHeaders2(ctx, next) { + const headersToSetForReq = callbacks.length === 0 ? headersToSet : callbacks.reduce((acc, cb) => cb(ctx, acc), headersToSet); + await next(); + setHeaders(ctx, headersToSetForReq); + if (options?.removePoweredBy) { + ctx.res.headers.delete("X-Powered-By"); + } + }; +}; +function getFilteredHeaders(options) { + return Object.entries(HEADERS_MAP).filter(([key]) => options[key]).map(([key, defaultValue]) => { + const overrideValue = options[key]; + return typeof overrideValue === "string" ? [defaultValue[0], overrideValue] : defaultValue; + }); +} +function getCSPDirectives(contentSecurityPolicy, headerName) { + const callbacks = []; + const resultValues = []; + for (const [directive, value] of Object.entries(contentSecurityPolicy)) { + const valueArray = Array.isArray(value) ? value : [value]; + valueArray.forEach((value2, i) => { + if (typeof value2 === "function") { + const index = i * 2 + 2 + resultValues.length; + callbacks.push((ctx, values) => { + values[index] = value2(ctx, directive); + }); + } + }); + resultValues.push( + directive.replace( + /[A-Z]+(?![a-z])|[A-Z]/g, + (match, offset) => offset ? "-" + match.toLowerCase() : match.toLowerCase() + ), + ...valueArray.flatMap((value2) => [" ", value2]), + "; " + ); + } + resultValues.pop(); + return callbacks.length === 0 ? [void 0, resultValues.join("")] : [ + (ctx, headersToSet) => headersToSet.map((values) => { + if (values[0] === headerName) { + const clone = values[1].slice(); + callbacks.forEach((cb) => { + cb(ctx, clone); + }); + return [values[0], clone.join("")]; + } else { + return values; + } + }), + resultValues + ]; +} +function getPermissionsPolicyDirectives(policy) { + return Object.entries(policy).map(([directive, value]) => { + const kebabDirective = camelToKebab(directive); + if (typeof value === "boolean") { + return `${kebabDirective}=${value ? "*" : "none"}`; + } + if (Array.isArray(value)) { + if (value.length === 0) { + return `${kebabDirective}=()`; + } + if (value.length === 1 && (value[0] === "*" || value[0] === "none")) { + return `${kebabDirective}=${value[0]}`; + } + const allowlist = value.map((item) => ["self", "src"].includes(item) ? item : `"${item}"`); + return `${kebabDirective}=(${allowlist.join(" ")})`; + } + return ""; + }).filter(Boolean).join(", "); +} +function camelToKebab(str) { + return str.replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase(); +} +function getReportingEndpoints(reportingEndpoints = []) { + return reportingEndpoints.map((endpoint) => `${endpoint.name}="${endpoint.url}"`).join(", "); +} +function getReportToOptions(reportTo = []) { + return reportTo.map((option) => JSON.stringify(option)).join(", "); +} +function setHeaders(ctx, headersToSet) { + headersToSet.forEach(([header, value]) => { + ctx.res.headers.set(header, value); + }); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + NONCE, + secureHeaders +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/serve-static/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/serve-static/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0b49f312efb734726167ca7613ce6af9faa19b73 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/serve-static/index.js @@ -0,0 +1,99 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var serve_static_exports = {}; +__export(serve_static_exports, { + serveStatic: () => serveStatic +}); +module.exports = __toCommonJS(serve_static_exports); +var import_compress = require("../../utils/compress"); +var import_mime = require("../../utils/mime"); +var import_url = require("../../utils/url"); +var import_path = require("./path"); +const ENCODINGS = { + br: ".br", + zstd: ".zst", + gzip: ".gz" +}; +const ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); +const DEFAULT_DOCUMENT = "index.html"; +const serveStatic = (options) => { + const root = options.root ?? "./"; + const optionPath = options.path; + const join = options.join ?? import_path.defaultJoin; + return async (c, next) => { + if (c.finalized) { + return next(); + } + let filename; + if (options.path) { + filename = options.path; + } else { + try { + filename = (0, import_url.tryDecodeURI)(c.req.path); + if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}|\\/.test(filename)) { + throw new Error(); + } + } catch { + await options.onNotFound?.(c.req.path, c); + return next(); + } + } + let path = join( + root, + !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename + ); + if (options.isDir && await options.isDir(path)) { + path = join(path, DEFAULT_DOCUMENT); + } + const getContent = options.getContent; + let content = await getContent(path, c); + if (content instanceof Response) { + return c.newResponse(content.body, content); + } + if (content != null) { + const mimeType = options.mimes && (0, import_mime.getMimeType)(path, options.mimes) || (0, import_mime.getMimeType)(path); + c.header("Content-Type", mimeType || "application/octet-stream"); + if (options.precompressed && (!mimeType || import_compress.COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) { + const acceptEncodingSet = new Set( + c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()) + ); + for (const encoding of ENCODINGS_ORDERED_KEYS) { + if (!acceptEncodingSet.has(encoding)) { + continue; + } + const compressedContent = await getContent(path + ENCODINGS[encoding], c); + if (compressedContent) { + content = compressedContent; + c.header("Content-Encoding", encoding); + c.header("Vary", "Accept-Encoding", { append: true }); + break; + } + } + } + await options.onFound?.(path, c); + return c.body(content); + } + await options.onNotFound?.(path, c); + await next(); + return; + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + serveStatic +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/serve-static/path.js b/tools/ui/node_modules/hono/dist/cjs/middleware/serve-static/path.js new file mode 100644 index 0000000000000000000000000000000000000000..9b9ae8603bbba690a5658bcf821ab25f99beb768 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/serve-static/path.js @@ -0,0 +1,40 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var path_exports = {}; +__export(path_exports, { + defaultJoin: () => defaultJoin +}); +module.exports = __toCommonJS(path_exports); +const defaultJoin = (...paths) => { + let result = paths.filter((p) => p !== "").join("/"); + result = result.replace(/(?<=\/)\/+/g, ""); + const segments = result.split("/"); + const resolved = []; + for (const segment of segments) { + if (segment === ".." && resolved.length > 0 && resolved.at(-1) !== "..") { + resolved.pop(); + } else if (segment !== ".") { + resolved.push(segment); + } + } + return resolved.join("/") || "."; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + defaultJoin +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/timeout/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/timeout/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1bf4725c17ed39364d26568dad6622f42a4277d1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/timeout/index.js @@ -0,0 +1,47 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var timeout_exports = {}; +__export(timeout_exports, { + timeout: () => timeout +}); +module.exports = __toCommonJS(timeout_exports); +var import_http_exception = require("../../http-exception"); +const defaultTimeoutException = new import_http_exception.HTTPException(504, { + message: "Gateway Timeout" +}); +const timeout = (duration, exception = defaultTimeoutException) => { + return async function timeout2(context, next) { + let timer; + const timeoutPromise = new Promise((_, reject) => { + timer = setTimeout(() => { + reject(typeof exception === "function" ? exception(context) : exception); + }, duration); + }); + try { + await Promise.race([next(), timeoutPromise]); + } finally { + if (timer !== void 0) { + clearTimeout(timer); + } + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + timeout +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/timing/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/timing/index.js new file mode 100644 index 0000000000000000000000000000000000000000..30cef8c73cbb8d0e76be862cba53a07a6e26fcd8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/timing/index.js @@ -0,0 +1,35 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var timing_exports = {}; +__export(timing_exports, { + endTime: () => import_timing.endTime, + setMetric: () => import_timing.setMetric, + startTime: () => import_timing.startTime, + timing: () => import_timing.timing, + wrapTime: () => import_timing.wrapTime +}); +module.exports = __toCommonJS(timing_exports); +var import_timing = require("./timing"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + endTime, + setMetric, + startTime, + timing, + wrapTime +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/timing/timing.js b/tools/ui/node_modules/hono/dist/cjs/middleware/timing/timing.js new file mode 100644 index 0000000000000000000000000000000000000000..11304d8577871f79be3926dddb534f2fd624621c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/timing/timing.js @@ -0,0 +1,130 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var timing_exports = {}; +__export(timing_exports, { + endTime: () => endTime, + setMetric: () => setMetric, + startTime: () => startTime, + timing: () => timing, + wrapTime: () => wrapTime +}); +module.exports = __toCommonJS(timing_exports); +var import_context = require("../../context"); +const getTime = () => { + try { + return performance.now(); + } catch { + } + return Date.now(); +}; +const timing = (config) => { + const options = { + total: true, + enabled: true, + totalDescription: "Total Response Time", + autoEnd: true, + crossOrigin: false, + ...config + }; + return async function timing2(c, next) { + const headers = []; + const timers = /* @__PURE__ */ new Map(); + if (c.get("metric")) { + return await next(); + } + c.set("metric", { headers, timers }); + if (options.total) { + startTime(c, "total", options.totalDescription); + } + await next(); + if (options.total) { + endTime(c, "total"); + } + if (options.autoEnd) { + timers.forEach((_, key) => { + endTime(c, key); + }); + } + const enabled = typeof options.enabled === "function" ? options.enabled(c) : options.enabled; + if (enabled) { + c.res.headers.append("Server-Timing", headers.join(",")); + const crossOrigin = typeof options.crossOrigin === "function" ? options.crossOrigin(c) : options.crossOrigin; + if (crossOrigin) { + c.res.headers.append( + "Timing-Allow-Origin", + typeof crossOrigin === "string" ? crossOrigin : "*" + ); + } + } + }; +}; +const setMetric = (c, name, valueDescription, description, precision) => { + const metrics = c.get("metric"); + if (!metrics) { + console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); + return; + } + if (typeof valueDescription === "number") { + const dur = valueDescription.toFixed(precision || 1); + const metric = description ? `${name};dur=${dur};desc="${description}"` : `${name};dur=${dur}`; + metrics.headers.push(metric); + } else { + const metric = valueDescription ? `${name};desc="${valueDescription}"` : `${name}`; + metrics.headers.push(metric); + } +}; +const startTime = (c, name, description) => { + const metrics = c.get("metric"); + if (!metrics) { + console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); + return; + } + metrics.timers.set(name, { description, start: getTime() }); +}; +const endTime = (c, name, precision) => { + const metrics = c.get("metric"); + if (!metrics) { + console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); + return; + } + const timer = metrics.timers.get(name); + if (!timer) { + console.warn(`Timer "${name}" does not exist!`); + return; + } + const { description, start } = timer; + const duration = getTime() - start; + setMetric(c, name, duration, description, precision); + metrics.timers.delete(name); +}; +async function wrapTime(c, name, callable, description, precision) { + startTime(c, name, description); + try { + return await callable; + } finally { + endTime(c, name, precision); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + endTime, + setMetric, + startTime, + timing, + wrapTime +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js b/tools/ui/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2afac9b06f3a5b3d6f315cbb85b90d6d89dfd384 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js @@ -0,0 +1,62 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var trailing_slash_exports = {}; +__export(trailing_slash_exports, { + appendTrailingSlash: () => appendTrailingSlash, + trimTrailingSlash: () => trimTrailingSlash +}); +module.exports = __toCommonJS(trailing_slash_exports); +const trimTrailingSlash = (options) => { + return async function trimTrailingSlash2(c, next) { + if (options?.alwaysRedirect) { + if ((c.req.method === "GET" || c.req.method === "HEAD") && c.req.path !== "/" && c.req.path.at(-1) === "/") { + const url = new URL(c.req.url); + url.pathname = url.pathname.substring(0, url.pathname.length - 1); + return c.redirect(url.toString(), 301); + } + } + await next(); + if (!options?.alwaysRedirect && c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path !== "/" && c.req.path.at(-1) === "/") { + const url = new URL(c.req.url); + url.pathname = url.pathname.substring(0, url.pathname.length - 1); + c.res = c.redirect(url.toString(), 301); + } + }; +}; +const appendTrailingSlash = (options) => { + return async function appendTrailingSlash2(c, next) { + if (options?.alwaysRedirect) { + if ((c.req.method === "GET" || c.req.method === "HEAD") && c.req.path.at(-1) !== "/" && !options.skip?.(c.req.path)) { + const url = new URL(c.req.url); + url.pathname += "/"; + return c.redirect(url.toString(), 301); + } + } + await next(); + if (!options?.alwaysRedirect && c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path.at(-1) !== "/" && !options?.skip?.(c.req.path)) { + const url = new URL(c.req.url); + url.pathname += "/"; + c.res = c.redirect(url.toString(), 301); + } + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + appendTrailingSlash, + trimTrailingSlash +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/package.json b/tools/ui/node_modules/hono/dist/cjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/hono/dist/cjs/preset/quick.js b/tools/ui/node_modules/hono/dist/cjs/preset/quick.js new file mode 100644 index 0000000000000000000000000000000000000000..81605ac653b624d4cd928c8ce569898e1c8eb30c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/preset/quick.js @@ -0,0 +1,38 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var quick_exports = {}; +__export(quick_exports, { + Hono: () => Hono +}); +module.exports = __toCommonJS(quick_exports); +var import_hono_base = require("../hono-base"); +var import_linear_router = require("../router/linear-router"); +var import_smart_router = require("../router/smart-router"); +var import_trie_router = require("../router/trie-router"); +class Hono extends import_hono_base.HonoBase { + constructor(options = {}) { + super(options); + this.router = new import_smart_router.SmartRouter({ + routers: [new import_linear_router.LinearRouter(), new import_trie_router.TrieRouter()] + }); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Hono +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/preset/tiny.js b/tools/ui/node_modules/hono/dist/cjs/preset/tiny.js new file mode 100644 index 0000000000000000000000000000000000000000..158bec2980520bcf2b359ded59dc7366ebb399ef --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/preset/tiny.js @@ -0,0 +1,34 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var tiny_exports = {}; +__export(tiny_exports, { + Hono: () => Hono +}); +module.exports = __toCommonJS(tiny_exports); +var import_hono_base = require("../hono-base"); +var import_pattern_router = require("../router/pattern-router"); +class Hono extends import_hono_base.HonoBase { + constructor(options = {}) { + super(options); + this.router = new import_pattern_router.PatternRouter(); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Hono +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/request.js b/tools/ui/node_modules/hono/dist/cjs/request.js new file mode 100644 index 0000000000000000000000000000000000000000..7a1cf8875722359c72831ae0c32c0289f54665c8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/request.js @@ -0,0 +1,342 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var request_exports = {}; +__export(request_exports, { + HonoRequest: () => HonoRequest, + cloneRawRequest: () => cloneRawRequest +}); +module.exports = __toCommonJS(request_exports); +var import_http_exception = require("./http-exception"); +var import_constants = require("./request/constants"); +var import_body = require("./utils/body"); +var import_url = require("./utils/url"); +class HonoRequest { + /** + * `.raw` can get the raw Request object. + * + * @see {@link https://hono.dev/docs/api/request#raw} + * + * @example + * ```ts + * // For Cloudflare Workers + * app.post('/', async (c) => { + * const metadata = c.req.raw.cf?.hostMetadata? + * ... + * }) + * ``` + */ + raw; + #validatedData; + // Short name of validatedData + #matchResult; + routeIndex = 0; + /** + * `.path` can get the pathname of the request. + * + * @see {@link https://hono.dev/docs/api/request#path} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const pathname = c.req.path // `/about/me` + * }) + * ``` + */ + path; + bodyCache = {}; + constructor(request, path = "/", matchResult = [[]]) { + this.raw = request; + this.path = path; + this.#matchResult = matchResult; + } + param(key) { + return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams(); + } + #getDecodedParam(key) { + const paramKey = this.#matchResult[0][this.routeIndex][1][key]; + const param = this.#getParamValue(paramKey); + return param && (0, import_url.tryDecodeURIComponent)(param); + } + #getAllDecodedParams() { + const decoded = {}; + const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]); + for (const key of keys) { + const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]); + if (value !== void 0) { + decoded[key] = (0, import_url.tryDecodeURIComponent)(value); + } + } + return decoded; + } + #getParamValue(paramKey) { + return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey; + } + query(key) { + return (0, import_url.getQueryParam)(this.url, key); + } + queries(key) { + return (0, import_url.getQueryParams)(this.url, key); + } + header(name) { + if (name) { + return this.raw.headers.get(name) ?? void 0; + } + const headerData = /* @__PURE__ */ Object.create(null); + this.raw.headers.forEach((value, key) => { + headerData[key] = value; + }); + return headerData; + } + async parseBody(options) { + return (0, import_body.parseBody)(this, options); + } + #cachedBody = (key) => { + const { bodyCache, raw } = this; + const cachedBody = bodyCache[key]; + if (cachedBody) { + return cachedBody; + } + for (const anyCachedKey in bodyCache) { + return bodyCache[anyCachedKey].then((body) => { + if (anyCachedKey === "json") { + body = JSON.stringify(body); + } + return new Response(body)[key](); + }); + } + return bodyCache[key] = raw[key](); + }; + /** + * `.json()` can parse Request body of type `application/json` + * + * @see {@link https://hono.dev/docs/api/request#json} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.json() + * }) + * ``` + */ + json() { + return this.#cachedBody("text").then((text) => JSON.parse(text)); + } + /** + * `.text()` can parse Request body of type `text/plain` + * + * @see {@link https://hono.dev/docs/api/request#text} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.text() + * }) + * ``` + */ + text() { + return this.#cachedBody("text"); + } + /** + * `.arrayBuffer()` parse Request body as an `ArrayBuffer` + * + * @see {@link https://hono.dev/docs/api/request#arraybuffer} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.arrayBuffer() + * }) + * ``` + */ + arrayBuffer() { + return this.#cachedBody("arrayBuffer"); + } + /** + * `.bytes()` parses the request body as a `Uint8Array`. + * + * @see {@link https://hono.dev/docs/api/request#bytes} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.bytes() + * }) + * ``` + */ + bytes() { + return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer)); + } + /** + * Parses the request body as a `Blob`. + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.blob(); + * }); + * ``` + * @see https://hono.dev/docs/api/request#blob + */ + blob() { + return this.#cachedBody("blob"); + } + /** + * Parses the request body as `FormData`. + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.formData(); + * }); + * ``` + * @see https://hono.dev/docs/api/request#formdata + */ + formData() { + return this.#cachedBody("formData"); + } + /** + * Adds validated data to the request. + * + * @param target - The target of the validation. + * @param data - The validated data to add. + */ + addValidatedData(target, data) { + ; + (this.#validatedData ??= {})[target] = data; + } + valid(target) { + return this.#validatedData?.[target]; + } + /** + * `.url()` can get the request url strings. + * + * @see {@link https://hono.dev/docs/api/request#url} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const url = c.req.url // `http://localhost:8787/about/me` + * ... + * }) + * ``` + */ + get url() { + return this.raw.url; + } + /** + * `.method()` can get the method name of the request. + * + * @see {@link https://hono.dev/docs/api/request#method} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const method = c.req.method // `GET` + * }) + * ``` + */ + get method() { + return this.raw.method; + } + get [import_constants.GET_MATCH_RESULT]() { + return this.#matchResult; + } + /** + * `.matchedRoutes()` can return a matched route in the handler + * + * @deprecated + * + * Use matchedRoutes helper defined in "hono/route" instead. + * + * @see {@link https://hono.dev/docs/api/request#matchedroutes} + * + * @example + * ```ts + * app.use('*', async function logger(c, next) { + * await next() + * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { + * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') + * console.log( + * method, + * ' ', + * path, + * ' '.repeat(Math.max(10 - path.length, 0)), + * name, + * i === c.req.routeIndex ? '<- respond from here' : '' + * ) + * }) + * }) + * ``` + */ + get matchedRoutes() { + return this.#matchResult[0].map(([[, route]]) => route); + } + /** + * `routePath()` can retrieve the path registered within the handler + * + * @deprecated + * + * Use routePath helper defined in "hono/route" instead. + * + * @see {@link https://hono.dev/docs/api/request#routepath} + * + * @example + * ```ts + * app.get('/posts/:id', (c) => { + * return c.json({ path: c.req.routePath }) + * }) + * ``` + */ + get routePath() { + return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path; + } +} +const cloneRawRequest = async (req) => { + if (!req.raw.bodyUsed) { + return req.raw.clone(); + } + const cacheKey = Object.keys(req.bodyCache)[0]; + if (!cacheKey) { + throw new import_http_exception.HTTPException(500, { + message: "Cannot clone request: body was already consumed and not cached. Please use HonoRequest methods (e.g., req.json(), req.text()) instead of consuming req.raw directly." + }); + } + const body = await req[cacheKey](); + const headers = req.header(); + if (body instanceof FormData) { + delete headers["content-type"]; + } + const requestInit = { + body, + cache: req.raw.cache, + credentials: req.raw.credentials, + headers, + integrity: req.raw.integrity, + keepalive: req.raw.keepalive, + method: req.method, + mode: req.raw.mode, + redirect: req.raw.redirect, + referrer: req.raw.referrer, + referrerPolicy: req.raw.referrerPolicy, + signal: req.raw.signal + }; + return new Request(req.url, requestInit); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HonoRequest, + cloneRawRequest +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/request/constants.js b/tools/ui/node_modules/hono/dist/cjs/request/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..8a6ed1df4b8559961fb8b589927f66cc218cccc4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/request/constants.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var constants_exports = {}; +__export(constants_exports, { + GET_MATCH_RESULT: () => GET_MATCH_RESULT +}); +module.exports = __toCommonJS(constants_exports); +const GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + GET_MATCH_RESULT +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router.js b/tools/ui/node_modules/hono/dist/cjs/router.js new file mode 100644 index 0000000000000000000000000000000000000000..736160ee670f5d76cff29e1ccb9df4887555d3c6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router.js @@ -0,0 +1,40 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var router_exports = {}; +__export(router_exports, { + MESSAGE_MATCHER_IS_ALREADY_BUILT: () => MESSAGE_MATCHER_IS_ALREADY_BUILT, + METHODS: () => METHODS, + METHOD_NAME_ALL: () => METHOD_NAME_ALL, + METHOD_NAME_ALL_LOWERCASE: () => METHOD_NAME_ALL_LOWERCASE, + UnsupportedPathError: () => UnsupportedPathError +}); +module.exports = __toCommonJS(router_exports); +const METHOD_NAME_ALL = "ALL"; +const METHOD_NAME_ALL_LOWERCASE = "all"; +const METHODS = ["get", "post", "put", "delete", "options", "patch", "query"]; +const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; +class UnsupportedPathError extends Error { +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + MESSAGE_MATCHER_IS_ALREADY_BUILT, + METHODS, + METHOD_NAME_ALL, + METHOD_NAME_ALL_LOWERCASE, + UnsupportedPathError +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/linear-router/index.js b/tools/ui/node_modules/hono/dist/cjs/router/linear-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..38fbcc2c5c11804e0eb992d412d43d3b94a2ec68 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/linear-router/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var linear_router_exports = {}; +__export(linear_router_exports, { + LinearRouter: () => import_router.LinearRouter +}); +module.exports = __toCommonJS(linear_router_exports); +var import_router = require("./router"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + LinearRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/linear-router/router.js b/tools/ui/node_modules/hono/dist/cjs/router/linear-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..e53ea8085e2e7510d5ea9ea6e28e98daa61ac37a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/linear-router/router.js @@ -0,0 +1,140 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var router_exports = {}; +__export(router_exports, { + LinearRouter: () => LinearRouter +}); +module.exports = __toCommonJS(router_exports); +var import_router = require("../../router"); +var import_url = require("../../utils/url"); +const emptyParams = /* @__PURE__ */ Object.create(null); +const splitPathRe = /\/(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/[^\/\?]+|(\?)/g; +const splitByStarRe = /\*/; +class LinearRouter { + name = "LinearRouter"; + #routes = []; + add(method, path, handler) { + for (let i = 0, paths = (0, import_url.checkOptionalParameter)(path) || [path], len = paths.length; i < len; i++) { + this.#routes.push([method, paths[i], handler]); + } + } + match(method, path) { + const handlers = []; + ROUTES_LOOP: for (let i = 0, len = this.#routes.length; i < len; i++) { + const [routeMethod, routePath, handler] = this.#routes[i]; + if (routeMethod === method || routeMethod === import_router.METHOD_NAME_ALL) { + if (routePath === "*" || routePath === "/*") { + handlers.push([handler, emptyParams]); + continue; + } + const hasStar = routePath.indexOf("*") !== -1; + const hasLabel = routePath.indexOf(":") !== -1; + if (!hasStar && !hasLabel) { + if (routePath === path || routePath + "/" === path) { + handlers.push([handler, emptyParams]); + } + } else if (hasStar && !hasLabel) { + const endsWithStar = routePath.charCodeAt(routePath.length - 1) === 42; + const parts = (endsWithStar ? routePath.slice(0, -2) : routePath).split(splitByStarRe); + const lastIndex = parts.length - 1; + for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { + const part = parts[j]; + const index = path.indexOf(part, pos); + if (index !== pos) { + continue ROUTES_LOOP; + } + pos += part.length; + if (j === lastIndex) { + if (!endsWithStar && pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { + continue ROUTES_LOOP; + } + } else { + const index2 = path.indexOf("/", pos); + if (index2 === -1) { + continue ROUTES_LOOP; + } + pos = index2; + } + } + handlers.push([handler, emptyParams]); + } else if (hasLabel && !hasStar) { + const params = /* @__PURE__ */ Object.create(null); + const parts = routePath.match(splitPathRe); + const lastIndex = parts.length - 1; + for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { + if (pos === -1 || pos >= path.length) { + continue ROUTES_LOOP; + } + const part = parts[j]; + if (part.charCodeAt(1) === 58) { + if (path.charCodeAt(pos) !== 47) { + continue ROUTES_LOOP; + } + let name = part.slice(2); + let value; + if (name.charCodeAt(name.length - 1) === 125) { + const openBracePos = name.indexOf("{"); + const next = parts[j + 1]; + const lookahead = next && next[1] !== ":" && next[1] !== "*" ? `(?=${next})` : ""; + const pattern = name.slice(openBracePos + 1, -1) + lookahead; + const restPath = path.slice(pos + 1); + const match = new RegExp(pattern, "d").exec(restPath); + if (!match || match.indices[0][0] !== 0 || match.indices[0][1] === 0) { + continue ROUTES_LOOP; + } + name = name.slice(0, openBracePos); + value = restPath.slice(...match.indices[0]); + pos += match.indices[0][1] + 1; + } else { + let endValuePos = path.indexOf("/", pos + 1); + if (endValuePos === -1) { + if (pos + 1 === path.length) { + continue ROUTES_LOOP; + } + endValuePos = path.length; + } + value = path.slice(pos + 1, endValuePos); + pos = endValuePos; + } + params[name] ||= value; + } else { + const index = path.indexOf(part, pos); + if (index !== pos) { + continue ROUTES_LOOP; + } + pos += part.length; + } + if (j === lastIndex) { + if (pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { + continue ROUTES_LOOP; + } + } + } + handlers.push([handler, params]); + } else if (hasLabel && hasStar) { + throw new import_router.UnsupportedPathError(); + } + } + } + return [handlers]; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + LinearRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/pattern-router/index.js b/tools/ui/node_modules/hono/dist/cjs/router/pattern-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b7e6875240fe35d778326e9b6eb8530fbc4b21ca --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/pattern-router/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var pattern_router_exports = {}; +__export(pattern_router_exports, { + PatternRouter: () => import_router.PatternRouter +}); +module.exports = __toCommonJS(pattern_router_exports); +var import_router = require("./router"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + PatternRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/pattern-router/router.js b/tools/ui/node_modules/hono/dist/cjs/router/pattern-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..001ff7fa5cb31ee0ac293e81cac9c8c2dea66456 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/pattern-router/router.js @@ -0,0 +1,70 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var router_exports = {}; +__export(router_exports, { + PatternRouter: () => PatternRouter +}); +module.exports = __toCommonJS(router_exports); +var import_router = require("../../router"); +const emptyParams = /* @__PURE__ */ Object.create(null); +class PatternRouter { + name = "PatternRouter"; + #routes = []; + add(method, path, handler) { + const endsWithWildcard = path.at(-1) === "*"; + if (endsWithWildcard) { + path = path.slice(0, -2); + } + if (path.at(-1) === "?") { + path = path.slice(0, -1); + this.add(method, path.replace(/\/[^/]+$/, ""), handler); + } + const parts = (path.match(/\/?(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/?[^\/\?]+/g) || []).map( + (part) => { + const match = part.match(/^\/:([^{]+)(?:{(.*)})?/); + return match ? `/(?<${match[1]}>${match[2] || "[^/]+"})` : part === "/*" ? "/[^/]+" : part.replace(/[.\\+*[^\]$()]/g, "\\$&"); + } + ); + try { + this.#routes.push([ + new RegExp(`^${parts.join("")}${endsWithWildcard ? "" : "/?$"}`), + method, + handler + ]); + } catch { + throw new import_router.UnsupportedPathError(); + } + } + match(method, path) { + const handlers = []; + for (let i = 0, len = this.#routes.length; i < len; i++) { + const [pattern, routeMethod, handler] = this.#routes[i]; + if (routeMethod === method || routeMethod === import_router.METHOD_NAME_ALL) { + const match = pattern.exec(path); + if (match) { + handlers.push([handler, match.groups || emptyParams]); + } + } + } + return [handlers]; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + PatternRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/index.js b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..559061c2c5c2eddcc77f0811bde48fb0ed9ace63 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/index.js @@ -0,0 +1,34 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var reg_exp_router_exports = {}; +__export(reg_exp_router_exports, { + PreparedRegExpRouter: () => import_prepared_router.PreparedRegExpRouter, + RegExpRouter: () => import_router.RegExpRouter, + buildInitParams: () => import_prepared_router.buildInitParams, + serializeInitParams: () => import_prepared_router.serializeInitParams +}); +module.exports = __toCommonJS(reg_exp_router_exports); +var import_router = require("./router"); +var import_prepared_router = require("./prepared-router"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + PreparedRegExpRouter, + RegExpRouter, + buildInitParams, + serializeInitParams +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js new file mode 100644 index 0000000000000000000000000000000000000000..0b0025cd386aa8cc612aeeeddf00c68fff059811 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js @@ -0,0 +1,48 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var matcher_exports = {}; +__export(matcher_exports, { + emptyParam: () => emptyParam, + match: () => match +}); +module.exports = __toCommonJS(matcher_exports); +var import_router = require("../../router"); +const emptyParam = []; +function match(method, path) { + const matchers = this.buildAllMatchers(); + const match2 = ((method2, path2) => { + const matcher = matchers[method2] || matchers[import_router.METHOD_NAME_ALL]; + const staticMatch = matcher[2][path2]; + if (staticMatch) { + return staticMatch; + } + const match3 = path2.match(matcher[0]); + if (!match3) { + return [[], emptyParam]; + } + const index = match3.indexOf("", 1); + return [matcher[1][index], match3]; + }); + this.match = match2; + return match2(method, path); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + emptyParam, + match +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/node.js b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/node.js new file mode 100644 index 0000000000000000000000000000000000000000..b1dccfab1b56c527a1f18361a6587625ecc73f62 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/node.js @@ -0,0 +1,133 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var node_exports = {}; +__export(node_exports, { + Node: () => Node, + PATH_ERROR: () => PATH_ERROR +}); +module.exports = __toCommonJS(node_exports); +const LABEL_REG_EXP_STR = "[^/]+"; +const ONLY_WILDCARD_REG_EXP_STR = ".*"; +const TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; +const PATH_ERROR = /* @__PURE__ */ Symbol(); +const regExpMetaChars = new Set(".\\+*[^]$()"); +function compareKey(a, b) { + if (a.length === 1) { + return b.length === 1 ? a < b ? -1 : 1 : -1; + } + if (b.length === 1) { + return 1; + } + if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) { + return b === TAIL_WILDCARD_REG_EXP_STR ? -1 : 1; + } else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) { + return -1; + } + if (a === LABEL_REG_EXP_STR) { + return 1; + } else if (b === LABEL_REG_EXP_STR) { + return -1; + } + return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length; +} +class Node { + // handler index of a dynamic path, or -1 for a static path terminal + #index; + #varIndex; + #children = /* @__PURE__ */ Object.create(null); + insert(tokens, index, paramMap, context, isStatic) { + let node = this; + for (let i = 0, len = tokens.length; i < len; i++) { + const token = tokens[i]; + const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : null : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); + let nextNode; + if (pattern) { + const name = pattern[1]; + let regexpStr = pattern[2] || LABEL_REG_EXP_STR; + if (name && pattern[2]) { + if (regexpStr === ".*") { + throw PATH_ERROR; + } + regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); + if (/\((?!\?:)/.test(regexpStr)) { + throw PATH_ERROR; + } + if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) { + throw PATH_ERROR; + } + } + nextNode = node.#children[regexpStr]; + if (!nextNode) { + if (regexpStr !== ONLY_WILDCARD_REG_EXP_STR && regexpStr !== TAIL_WILDCARD_REG_EXP_STR) { + for (const k in node.#children) { + if ( + // a single-char pattern coexists with single-char literals as a literal does + (regexpStr.length > 1 || k.length > 1) && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR + ) { + throw PATH_ERROR; + } + } + } + nextNode = node.#children[regexpStr] = new Node(); + } + if (name !== "") { + nextNode.#varIndex ??= context.varIndex++; + paramMap.push([name, nextNode.#varIndex]); + } + } else { + nextNode = node.#children[token]; + if (!nextNode) { + for (const k in node.#children) { + if (k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR) { + throw PATH_ERROR; + } + } + nextNode = node.#children[token] = new Node(); + } + } + node = nextNode; + } + if (node.#index !== void 0) { + throw PATH_ERROR; + } + node.#index = isStatic ? -1 : index; + } + buildRegExpStr() { + const childKeys = Object.keys(this.#children).sort(compareKey); + const strList = childKeys.map((k) => { + const c = this.#children[k]; + const childStr = c.buildRegExpStr(); + return childStr === "" ? "" : (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + childStr; + }).filter(Boolean); + if (typeof this.#index === "number" && this.#index !== -1) { + strList.unshift(`#${this.#index}`); + } + if (strList.length === 0) { + return ""; + } + if (strList.length === 1) { + return strList[0]; + } + return "(?:" + strList.join("|") + ")"; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Node, + PATH_ERROR +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js new file mode 100644 index 0000000000000000000000000000000000000000..2752b58413828754bcd14e96e230e9bca28b5de2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js @@ -0,0 +1,166 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var prepared_router_exports = {}; +__export(prepared_router_exports, { + PreparedRegExpRouter: () => PreparedRegExpRouter, + buildInitParams: () => buildInitParams, + serializeInitParams: () => serializeInitParams +}); +module.exports = __toCommonJS(prepared_router_exports); +var import_router = require("../../router"); +var import_matcher = require("./matcher"); +var import_router2 = require("./router"); +class PreparedRegExpRouter { + name = "PreparedRegExpRouter"; + #matchers; + #relocateMap; + constructor(matchers, relocateMap) { + this.#matchers = matchers; + this.#relocateMap = relocateMap; + } + #addWildcard(method, handlerData) { + const matcher = this.#matchers[method]; + matcher[1].forEach((list) => list && list.push(handlerData)); + Object.values(matcher[2]).forEach((list) => list[0].push(handlerData)); + } + #addPath(method, path, handler, indexes, map) { + const matcher = this.#matchers[method]; + if (!map) { + matcher[2][path][0].push([handler, {}]); + } else { + indexes.forEach((index) => { + if (typeof index === "number") { + matcher[1][index].push([handler, map]); + } else { + ; + matcher[2][index || path][0].push([handler, map]); + } + }); + } + } + add(method, path, handler) { + if (!this.#matchers[method]) { + const all = this.#matchers[import_router.METHOD_NAME_ALL]; + const staticMap = {}; + for (const key in all[2]) { + staticMap[key] = [all[2][key][0].slice(), import_matcher.emptyParam]; + } + this.#matchers[method] = [ + all[0], + all[1].map((list) => Array.isArray(list) ? list.slice() : 0), + staticMap + ]; + } + if (path === "/*" || path === "*") { + const handlerData = [handler, {}]; + if (method === import_router.METHOD_NAME_ALL) { + for (const m in this.#matchers) { + this.#addWildcard(m, handlerData); + } + } else { + this.#addWildcard(method, handlerData); + } + return; + } + const data = this.#relocateMap[path]; + if (!data) { + throw new Error(`Path ${path} is not registered`); + } + for (const [indexes, map] of data) { + if (method === import_router.METHOD_NAME_ALL) { + for (const m in this.#matchers) { + this.#addPath(m, path, handler, indexes, map); + } + } else { + this.#addPath(method, path, handler, indexes, map); + } + } + } + buildAllMatchers() { + return this.#matchers; + } + match = import_matcher.match; +} +const buildInitParams = ({ paths }) => { + const RegExpRouterWithMatcherExport = class extends import_router2.RegExpRouter { + buildAndExportAllMatchers() { + return this.buildAllMatchers(); + } + }; + const router = new RegExpRouterWithMatcherExport(); + for (const path of paths) { + router.add(import_router.METHOD_NAME_ALL, path, path); + } + const matchers = router.buildAndExportAllMatchers(); + const all = matchers[import_router.METHOD_NAME_ALL]; + const relocateMap = {}; + for (const path of paths) { + if (path === "/*" || path === "*") { + continue; + } + all[1].forEach((list, i) => { + list.forEach(([p, map]) => { + if (p === path) { + if (relocateMap[path]) { + relocateMap[path][0][1] = { + ...relocateMap[path][0][1], + ...map + }; + } else { + relocateMap[path] = [[[], map]]; + } + if (relocateMap[path][0][0].findIndex((j) => j === i) === -1) { + relocateMap[path][0][0].push(i); + } + } + }); + }); + for (const path2 in all[2]) { + all[2][path2][0].forEach(([p]) => { + if (p === path) { + relocateMap[path] ||= [[[]]]; + const value = path2 === path ? "" : path2; + if (relocateMap[path][0][0].findIndex((v) => v === value) === -1) { + relocateMap[path][0][0].push(value); + } + } + }); + } + } + for (let i = 0, len = all[1].length; i < len; i++) { + all[1][i] = all[1][i] ? [] : 0; + } + for (const path in all[2]) { + all[2][path][0] = []; + } + return [matchers, relocateMap]; +}; +const serializeInitParams = ([matchers, relocateMap]) => { + const matchersStr = JSON.stringify( + matchers, + (_, value) => value instanceof RegExp ? `##${value.toString()}##` : value + ).replace(/"##(.+?)##"/g, (_, str) => str.replace(/\\\\/g, "\\")); + const relocateMapStr = JSON.stringify(relocateMap); + return `[${matchersStr},${relocateMapStr}]`; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + PreparedRegExpRouter, + buildInitParams, + serializeInitParams +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/router.js b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..37ab5f601f0c987f3e419a30316882ce6bb0030b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/router.js @@ -0,0 +1,187 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var router_exports = {}; +__export(router_exports, { + RegExpRouter: () => RegExpRouter +}); +module.exports = __toCommonJS(router_exports); +var import_router = require("../../router"); +var import_url = require("../../utils/url"); +var import_matcher = require("./matcher"); +var import_node = require("./node"); +var import_trie = require("./trie"); +let wildcardRegExpCache = /* @__PURE__ */ Object.create(null); +function buildWildcardRegExp(path) { + return wildcardRegExpCache[path] ??= new RegExp( + path === "*" ? "" : `^${path.replace( + /\/\*$|([.\\+*[^\]$()])/g, + (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)" + )}$` + ); +} +function clearWildcardRegExpCache() { + wildcardRegExpCache = /* @__PURE__ */ Object.create(null); +} +function findMiddleware(middleware, path) { + if (!middleware) { + return void 0; + } + for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) { + if (buildWildcardRegExp(k).test(path)) { + return [...middleware[k]]; + } + } + return void 0; +} +class RegExpRouter { + name = "RegExpRouter"; + #middleware; + #routes; + #tries; + constructor() { + this.#middleware = { [import_router.METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; + this.#routes = { [import_router.METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; + this.#tries = { [import_router.METHOD_NAME_ALL]: new import_trie.Trie() }; + } + #insertPath(method, path) { + try { + this.#tries[method].insert(path, !/\*|\/:/.test(path)); + } catch (e) { + throw e === import_node.PATH_ERROR ? new import_router.UnsupportedPathError(path) : e; + } + } + add(method, path, handler) { + const middleware = this.#middleware; + const routes = this.#routes; + if (!middleware || !routes) { + throw new Error(import_router.MESSAGE_MATCHER_IS_ALREADY_BUILT); + } + if (!middleware[method]) { + this.#tries[method] = new import_trie.Trie(); + [middleware, routes].forEach((handlerMap) => { + handlerMap[method] = /* @__PURE__ */ Object.create(null); + Object.keys(handlerMap[import_router.METHOD_NAME_ALL]).forEach((p) => { + handlerMap[method][p] = [...handlerMap[import_router.METHOD_NAME_ALL][p]]; + this.#insertPath(method, p); + }); + }); + } + if (path === "/*") { + path = "*"; + } + const paramCount = (path.match(/\/:/g) || []).length; + if (/\*$/.test(path)) { + const re = buildWildcardRegExp(path); + Object.keys(middleware).forEach((m) => { + if ((method === import_router.METHOD_NAME_ALL || method === m) && !middleware[m][path]) { + this.#insertPath(m, path); + middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[import_router.METHOD_NAME_ALL], path) || []; + } + }); + Object.keys(middleware).forEach((m) => { + if (method === import_router.METHOD_NAME_ALL || method === m) { + Object.keys(middleware[m]).forEach((p) => { + re.test(p) && middleware[m][p].push([handler, paramCount]); + }); + } + }); + Object.keys(routes).forEach((m) => { + if (method === import_router.METHOD_NAME_ALL || method === m) { + Object.keys(routes[m]).forEach( + (p) => re.test(p) && routes[m][p].push([handler, paramCount]) + ); + } + }); + return; + } + const paths = (0, import_url.checkOptionalParameter)(path) || [path]; + for (let i = 0, len = paths.length; i < len; i++) { + const path2 = paths[i]; + Object.keys(routes).forEach((m) => { + if (method === import_router.METHOD_NAME_ALL || method === m) { + if (!routes[m][path2]) { + this.#insertPath(m, path2); + routes[m][path2] = [ + ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[import_router.METHOD_NAME_ALL], path2) || [] + ]; + } + routes[m][path2].push([handler, paramCount - len + i + 1]); + } + }); + } + } + match = import_matcher.match; + buildAllMatchers() { + const matchers = /* @__PURE__ */ Object.create(null); + Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => { + matchers[method] ||= this.#buildMatcher(method); + }); + this.#middleware = this.#routes = this.#tries = void 0; + clearWildcardRegExpCache(); + return matchers; + } + #buildMatcher(method) { + const middleware = this.#middleware[method]; + const routes = this.#routes[method]; + const trie = this.#tries[method]; + const staticMap = /* @__PURE__ */ Object.create(null); + const handlerData = []; + [middleware, routes].forEach((r) => { + for (const path in r) { + const handlers = r[path]; + const pathData = trie.paths[path]; + if (!pathData) { + staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), import_matcher.emptyParam]; + continue; + } + const paramAssoc = pathData[1]; + handlerData[pathData[0]] = handlers.map(([h, paramCount]) => { + const paramIndexMap = /* @__PURE__ */ Object.create(null); + paramCount -= 1; + for (; paramCount >= 0; paramCount--) { + const [key, value] = paramAssoc[paramCount]; + paramIndexMap[key] = value; + } + return [h, paramIndexMap]; + }); + } + }); + const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); + for (let i = 0, len = handlerData.length; i < len; i++) { + for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { + const map = handlerData[i][j]?.[1]; + if (!map) { + continue; + } + const keys = Object.keys(map); + for (let k = 0, len3 = keys.length; k < len3; k++) { + map[keys[k]] = paramReplacementMap[map[keys[k]]]; + } + } + } + const handlerMap = []; + for (const i in indexReplacementMap) { + handlerMap[i] = handlerData[indexReplacementMap[i]]; + } + return [regexp, handlerMap, staticMap]; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + RegExpRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js new file mode 100644 index 0000000000000000000000000000000000000000..9970fed54e710b1167ce9685be7fb152eafe4d02 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js @@ -0,0 +1,89 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var trie_exports = {}; +__export(trie_exports, { + Trie: () => Trie +}); +module.exports = __toCommonJS(trie_exports); +var import_node = require("./node"); +class Trie { + #context = { varIndex: 0 }; + #root = new import_node.Node(); + #index = 0; + // dynamic path -> [handler index, param assoc]; static paths are not registered + paths = /* @__PURE__ */ Object.create(null); + insert(path, isStatic) { + if (isStatic) { + this.#root.insert(path.split(""), 0, [], this.#context, true); + return; + } + const paramAssoc = []; + const groups = []; + let markedPath = path; + for (let i = 0; ; ) { + let replaced = false; + markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => { + const mark = `@\\${i}`; + groups[i] = [mark, m]; + i++; + replaced = true; + return mark; + }); + if (!replaced) { + break; + } + } + const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; + for (let i = groups.length - 1; i >= 0; i--) { + const [mark] = groups[i]; + for (let j = tokens.length - 1; j >= 0; j--) { + if (tokens[j].indexOf(mark) !== -1) { + tokens[j] = tokens[j].replace(mark, groups[i][1]); + break; + } + } + } + this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false); + this.paths[path] = [this.#index++, paramAssoc]; + } + buildRegExp() { + let regexp = this.#root.buildRegExpStr(); + if (regexp === "") { + return [/^$/, [], []]; + } + let captureIndex = 0; + const indexReplacementMap = []; + const paramReplacementMap = []; + regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => { + if (handlerIndex !== void 0) { + indexReplacementMap[++captureIndex] = Number(handlerIndex); + return "$()"; + } + if (paramIndex !== void 0) { + paramReplacementMap[Number(paramIndex)] = ++captureIndex; + return ""; + } + return ""; + }); + return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap]; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Trie +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/smart-router/index.js b/tools/ui/node_modules/hono/dist/cjs/router/smart-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..168c7d6c6baae594c9ab59dc25348bdf4de611e6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/smart-router/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var smart_router_exports = {}; +__export(smart_router_exports, { + SmartRouter: () => import_router.SmartRouter +}); +module.exports = __toCommonJS(smart_router_exports); +var import_router = require("./router"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SmartRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/smart-router/router.js b/tools/ui/node_modules/hono/dist/cjs/router/smart-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..6413fc43bdb83385abcf5a9ce2e5982642241ebb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/smart-router/router.js @@ -0,0 +1,80 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var router_exports = {}; +__export(router_exports, { + SmartRouter: () => SmartRouter +}); +module.exports = __toCommonJS(router_exports); +var import_router = require("../../router"); +class SmartRouter { + name = "SmartRouter"; + #routers = []; + #routes = []; + constructor(init) { + this.#routers = init.routers; + } + add(method, path, handler) { + if (!this.#routes) { + throw new Error(import_router.MESSAGE_MATCHER_IS_ALREADY_BUILT); + } + this.#routes.push([method, path, handler]); + } + match(method, path) { + if (!this.#routes) { + throw new Error("Fatal error"); + } + const routers = this.#routers; + const routes = this.#routes; + const len = routers.length; + let i = 0; + let res; + for (; i < len; i++) { + const router = routers[i]; + try { + for (let i2 = 0, len2 = routes.length; i2 < len2; i2++) { + router.add(...routes[i2]); + } + res = router.match(method, path); + } catch (e) { + if (e instanceof import_router.UnsupportedPathError) { + continue; + } + throw e; + } + this.match = router.match.bind(router); + this.#routers = [router]; + this.#routes = void 0; + break; + } + if (i === len) { + throw new Error("Fatal error"); + } + this.name = `SmartRouter + ${this.activeRouter.name}`; + return res; + } + get activeRouter() { + if (this.#routes || this.#routers.length !== 1) { + throw new Error("No active router has been determined yet."); + } + return this.#routers[0]; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SmartRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/trie-router/index.js b/tools/ui/node_modules/hono/dist/cjs/router/trie-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fcbc6c7c19ec81cffffd46c8ef06f0b2159fd590 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/trie-router/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var trie_router_exports = {}; +__export(trie_router_exports, { + TrieRouter: () => import_router.TrieRouter +}); +module.exports = __toCommonJS(trie_router_exports); +var import_router = require("./router"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TrieRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/trie-router/node.js b/tools/ui/node_modules/hono/dist/cjs/router/trie-router/node.js new file mode 100644 index 0000000000000000000000000000000000000000..dbdab6adef0e89ac56b3f5c4b4c2601f21d1bdc2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/trie-router/node.js @@ -0,0 +1,210 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var node_exports = {}; +__export(node_exports, { + Node: () => Node +}); +module.exports = __toCommonJS(node_exports); +var import_router = require("../../router"); +var import_url = require("../../utils/url"); +const emptyParams = /* @__PURE__ */ Object.create(null); +const hasChildren = (children) => { + for (const _ in children) { + return true; + } + return false; +}; +class Node { + #methods; + #children; + #patterns; + #order = 0; + #params = emptyParams; + constructor(method, handler, children) { + this.#children = children || /* @__PURE__ */ Object.create(null); + this.#methods = []; + if (method && handler) { + const m = /* @__PURE__ */ Object.create(null); + m[method] = { handler, possibleKeys: [], score: 0 }; + this.#methods = [m]; + } + this.#patterns = []; + } + insert(method, path, handler) { + this.#order = ++this.#order; + let curNode = this; + const parts = (0, import_url.splitRoutingPath)(path); + const possibleKeys = []; + for (let i = 0, len = parts.length; i < len; i++) { + const p = parts[i]; + const nextP = parts[i + 1]; + const pattern = (0, import_url.getPattern)(p, nextP); + const key = Array.isArray(pattern) ? pattern[0] : p; + if (key in curNode.#children) { + curNode = curNode.#children[key]; + if (pattern) { + possibleKeys.push(pattern[1]); + } + continue; + } + curNode.#children[key] = new Node(); + if (pattern) { + curNode.#patterns.push(pattern); + possibleKeys.push(pattern[1]); + } + curNode = curNode.#children[key]; + } + curNode.#methods.push({ + [method]: { + handler, + possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i), + score: this.#order + } + }); + return curNode; + } + #pushHandlerSets(handlerSets, node, method, nodeParams, params) { + for (let i = 0, len = node.#methods.length; i < len; i++) { + const m = node.#methods[i]; + const handlerSet = m[method] || m[import_router.METHOD_NAME_ALL]; + const processedSet = {}; + if (handlerSet !== void 0) { + handlerSet.params = /* @__PURE__ */ Object.create(null); + handlerSets.push(handlerSet); + if (nodeParams !== emptyParams || params && params !== emptyParams) { + for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) { + const key = handlerSet.possibleKeys[i2]; + const processed = processedSet[handlerSet.score]; + handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key]; + processedSet[handlerSet.score] = true; + } + } + } + } + } + search(method, path) { + const handlerSets = []; + this.#params = emptyParams; + const curNode = this; + let curNodes = [curNode]; + const parts = (0, import_url.splitPath)(path); + const curNodesQueue = []; + const len = parts.length; + let partOffsets = null; + for (let i = 0; i < len; i++) { + const part = parts[i]; + const isLast = i === len - 1; + const tempNodes = []; + for (let j = 0, len2 = curNodes.length; j < len2; j++) { + const node = curNodes[j]; + const nextNode = node.#children[part]; + if (nextNode) { + nextNode.#params = node.#params; + if (isLast) { + if (nextNode.#children["*"]) { + this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params); + } + this.#pushHandlerSets(handlerSets, nextNode, method, node.#params); + } else { + tempNodes.push(nextNode); + } + } + for (let k = 0, len3 = node.#patterns.length; k < len3; k++) { + const pattern = node.#patterns[k]; + const params = node.#params === emptyParams ? {} : { ...node.#params }; + if (pattern === "*") { + const astNode = node.#children["*"]; + if (astNode) { + this.#pushHandlerSets(handlerSets, astNode, method, node.#params); + astNode.#params = params; + tempNodes.push(astNode); + } + continue; + } + const [key, name, matcher] = pattern; + if (!part && !(matcher instanceof RegExp)) { + continue; + } + const child = node.#children[key]; + if (matcher instanceof RegExp) { + if (partOffsets === null) { + partOffsets = new Array(len); + let offset = path[0] === "/" ? 1 : 0; + for (let p = 0; p < len; p++) { + partOffsets[p] = offset; + offset += parts[p].length + 1; + } + } + const restPathString = path.substring(partOffsets[i]); + const m = matcher.exec(restPathString); + if (m) { + params[name] = m[0]; + this.#pushHandlerSets(handlerSets, child, method, node.#params, params); + if (m[0].length === restPathString.length && child.#children["*"]) { + this.#pushHandlerSets( + handlerSets, + child.#children["*"], + method, + node.#params, + params + ); + } + if (hasChildren(child.#children)) { + child.#params = params; + const componentCount = m[0].match(/\//)?.length ?? 0; + const targetCurNodes = curNodesQueue[componentCount] ||= []; + targetCurNodes.push(child); + } + continue; + } + } + if (matcher === true || matcher.test(part)) { + params[name] = part; + if (isLast) { + this.#pushHandlerSets(handlerSets, child, method, params, node.#params); + if (child.#children["*"]) { + this.#pushHandlerSets( + handlerSets, + child.#children["*"], + method, + params, + node.#params + ); + } + } else { + child.#params = params; + tempNodes.push(child); + } + } + } + } + const shifted = curNodesQueue.shift(); + curNodes = shifted ? tempNodes.concat(shifted) : tempNodes; + } + if (handlerSets.length > 1) { + handlerSets.sort((a, b) => { + return a.score - b.score; + }); + } + return [handlerSets.map(({ handler, params }) => [handler, params])]; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Node +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/router/trie-router/router.js b/tools/ui/node_modules/hono/dist/cjs/router/trie-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..15f28c810c8d74721099e2558dde08fa5cddaefe --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/router/trie-router/router.js @@ -0,0 +1,48 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var router_exports = {}; +__export(router_exports, { + TrieRouter: () => TrieRouter +}); +module.exports = __toCommonJS(router_exports); +var import_url = require("../../utils/url"); +var import_node = require("./node"); +class TrieRouter { + name = "TrieRouter"; + #node; + constructor() { + this.#node = new import_node.Node(); + } + add(method, path, handler) { + const results = (0, import_url.checkOptionalParameter)(path); + if (results) { + for (let i = 0, len = results.length; i < len; i++) { + this.#node.insert(method, results[i], handler); + } + return; + } + this.#node.insert(method, path, handler); + } + match(method, path) { + return this.#node.search(method, path); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TrieRouter +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/types.js b/tools/ui/node_modules/hono/dist/cjs/types.js new file mode 100644 index 0000000000000000000000000000000000000000..b58a9023c8e198880296abc5aaa45d3f31a19e09 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/types.js @@ -0,0 +1,28 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +__export(types_exports, { + FetchEventLike: () => FetchEventLike +}); +module.exports = __toCommonJS(types_exports); +class FetchEventLike { +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + FetchEventLike +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/accept.js b/tools/ui/node_modules/hono/dist/cjs/utils/accept.js new file mode 100644 index 0000000000000000000000000000000000000000..883aa1701b6359034cfdc9a26c45b9a176970b51 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/accept.js @@ -0,0 +1,245 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var accept_exports = {}; +__export(accept_exports, { + parseAccept: () => parseAccept +}); +module.exports = __toCommonJS(accept_exports); +const isWhitespace = (char) => char === 32 || char === 9 || char === 10 || char === 13; +const consumeWhitespace = (acceptHeader, startIndex) => { + while (startIndex < acceptHeader.length) { + if (!isWhitespace(acceptHeader.charCodeAt(startIndex))) { + break; + } + startIndex++; + } + return startIndex; +}; +const ignoreTrailingWhitespace = (acceptHeader, startIndex) => { + while (startIndex > 0) { + if (!isWhitespace(acceptHeader.charCodeAt(startIndex - 1))) { + break; + } + startIndex--; + } + return startIndex; +}; +const skipInvalidParam = (acceptHeader, startIndex) => { + while (startIndex < acceptHeader.length) { + const char = acceptHeader.charCodeAt(startIndex); + if (char === 59) { + return [startIndex + 1, true]; + } + if (char === 44) { + return [startIndex + 1, false]; + } + startIndex++; + } + return [startIndex, false]; +}; +const skipInvalidAcceptValue = (acceptHeader, startIndex) => { + let i = startIndex; + let inQuotes = false; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (inQuotes && char === 92) { + i++; + } else if (char === 34) { + inQuotes = !inQuotes; + } else if (!inQuotes && char === 44) { + return i + 1; + } + i++; + } + return i; +}; +const getNextParam = (acceptHeader, startIndex) => { + startIndex = consumeWhitespace(acceptHeader, startIndex); + let i = startIndex; + let key; + let value; + let hasNext = false; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (char === 61) { + key = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i)); + i++; + break; + } + if (char === 59) { + return [i + 1, void 0, void 0, true]; + } + if (char === 44) { + return [i + 1, void 0, void 0, false]; + } + i++; + } + if (key === void 0) { + return [i, void 0, void 0, false]; + } + i = consumeWhitespace(acceptHeader, i); + if (acceptHeader.charCodeAt(i) === 61) { + const skipResult = skipInvalidParam(acceptHeader, i + 1); + return [skipResult[0], key, void 0, skipResult[1]]; + } + let inQuotes = false; + const paramStartIndex = i; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (inQuotes && char === 92) { + i++; + } else if (char === 34) { + if (inQuotes) { + let nextIndex = consumeWhitespace(acceptHeader, i + 1); + const nextChar = acceptHeader.charCodeAt(nextIndex); + if (nextIndex < acceptHeader.length && !(nextChar === 59 || nextChar === 44)) { + const skipResult = skipInvalidParam(acceptHeader, nextIndex); + return [skipResult[0], key, void 0, skipResult[1]]; + } + value = acceptHeader.slice(paramStartIndex + 1, i); + if (value.includes("\\")) { + value = value.replace(/\\(.)/g, "$1"); + } + if (nextChar === 44) { + return [nextIndex + 1, key, value, false]; + } + if (nextChar === 59) { + hasNext = true; + nextIndex++; + } + i = nextIndex; + break; + } + inQuotes = true; + } else if (!inQuotes && (char === 59 || char === 44)) { + value = acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i)); + if (char === 59) { + hasNext = true; + } + i++; + break; + } + i++; + } + return [ + i, + key, + value ?? acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i)), + hasNext + ]; +}; +const getNextAcceptValue = (acceptHeader, startIndex) => { + const accept = { + type: "", + params: /* @__PURE__ */ Object.create(null), + q: 1 + }; + startIndex = consumeWhitespace(acceptHeader, startIndex); + let i = startIndex; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (char === 59 || char === 44) { + accept.type = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i)); + i++; + if (char === 44) { + return [i, accept.type ? accept : void 0]; + } + if (!accept.type) { + return [skipInvalidAcceptValue(acceptHeader, i), void 0]; + } + break; + } + i++; + } + if (!accept.type) { + accept.type = acceptHeader.slice( + startIndex, + ignoreTrailingWhitespace(acceptHeader, acceptHeader.length) + ); + return [acceptHeader.length, accept.type ? accept : void 0]; + } + let param; + let value; + let hasNext; + while (i < acceptHeader.length) { + ; + [i, param, value, hasNext] = getNextParam(acceptHeader, i); + if (param && value) { + accept.params[param] = value; + } + if (!hasNext) { + break; + } + } + return [i, accept]; +}; +const parseAccept = (acceptHeader) => { + if (!acceptHeader) { + return []; + } + const values = []; + let i = 0; + let accept; + let requiresSort = false; + let lastAccept; + while (i < acceptHeader.length) { + ; + [i, accept] = getNextAcceptValue(acceptHeader, i); + if (accept) { + accept.q = parseQuality(accept.params.q); + values.push(accept); + if (lastAccept && lastAccept.q < accept.q) { + requiresSort = true; + } + lastAccept = accept; + } + } + if (requiresSort) { + values.sort((a, b) => b.q - a.q); + } + return values; +}; +const parseQuality = (qVal) => { + if (qVal === void 0) { + return 1; + } + if (qVal === "") { + return 1; + } + if (qVal === "NaN") { + return 0; + } + const num = Number(qVal); + if (num === Infinity) { + return 1; + } + if (num === -Infinity) { + return 0; + } + if (Number.isNaN(num)) { + return 1; + } + if (num < 0 || num > 1) { + return 1; + } + return num; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + parseAccept +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/basic-auth.js b/tools/ui/node_modules/hono/dist/cjs/utils/basic-auth.js new file mode 100644 index 0000000000000000000000000000000000000000..3a32d08b2a92673faa54f113058cd33d6b6e9d30 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/basic-auth.js @@ -0,0 +1,45 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var basic_auth_exports = {}; +__export(basic_auth_exports, { + auth: () => auth +}); +module.exports = __toCommonJS(basic_auth_exports); +var import_encode = require("./encode"); +const CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/; +const USER_PASS_REGEXP = /^([^:]*):(.*)$/; +const utf8Decoder = new TextDecoder(); +const auth = (req) => { + const match = CREDENTIALS_REGEXP.exec(req.headers.get("Authorization") || ""); + if (!match) { + return void 0; + } + let userPass = void 0; + try { + userPass = USER_PASS_REGEXP.exec(utf8Decoder.decode((0, import_encode.decodeBase64)(match[1]))); + } catch { + } + if (!userPass) { + return void 0; + } + return { username: userPass[1], password: userPass[2] }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + auth +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/body.js b/tools/ui/node_modules/hono/dist/cjs/utils/body.js new file mode 100644 index 0000000000000000000000000000000000000000..64307e95054262b230f34b683706c499e9b1a2df --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/body.js @@ -0,0 +1,111 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var body_exports = {}; +__export(body_exports, { + parseBody: () => parseBody +}); +module.exports = __toCommonJS(body_exports); +var import_buffer = require("./buffer"); +const isRawRequest = (request) => "headers" in request; +const parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { + const { all = false, dot = false } = options; + const headers = isRawRequest(request) ? request.headers : request.raw.headers; + const contentType = headers.get("Content-Type"); + const mediaType = contentType?.split(";")[0].trim().toLowerCase(); + if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") { + return parseFormData(request, { all, dot }); + } + return {}; +}; +async function parseFormData(request, options) { + if (!isRawRequest(request) && request.bodyCache.formData) { + return convertFormDataToBodyData( + await request.bodyCache.formData, + options + ); + } + const headers = isRawRequest(request) ? request.headers : request.raw.headers; + const arrayBuffer = await request.arrayBuffer(); + const formDataPromise = (0, import_buffer.bufferToFormData)(arrayBuffer, headers.get("Content-Type") || ""); + if (!isRawRequest(request)) { + request.bodyCache.formData = formDataPromise; + } + const formData = await formDataPromise; + if (formData) { + return convertFormDataToBodyData(formData, options); + } + return {}; +} +function convertFormDataToBodyData(formData, options) { + const form = /* @__PURE__ */ Object.create(null); + formData.forEach((value, key) => { + const shouldParseAllValues = options.all || key.endsWith("[]"); + if (!shouldParseAllValues) { + form[key] = value; + } else { + handleParsingAllValues(form, key, value); + } + }); + if (options.dot) { + Object.entries(form).forEach(([key, value]) => { + const shouldParseDotValues = key.includes("."); + if (shouldParseDotValues) { + handleParsingNestedValues(form, key, value); + delete form[key]; + } + }); + } + return form; +} +const handleParsingAllValues = (form, key, value) => { + if (form[key] !== void 0) { + if (Array.isArray(form[key])) { + ; + form[key].push(value); + } else { + form[key] = [form[key], value]; + } + } else { + if (!key.endsWith("[]")) { + form[key] = value; + } else { + form[key] = [value]; + } + } +}; +const handleParsingNestedValues = (form, key, value) => { + if (/(?:^|\.)__proto__\./.test(key)) { + return; + } + let nestedForm = form; + const keys = key.split("."); + keys.forEach((key2, index) => { + if (index === keys.length - 1) { + nestedForm[key2] = value; + } else { + if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) { + nestedForm[key2] = /* @__PURE__ */ Object.create(null); + } + nestedForm = nestedForm[key2]; + } + }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + parseBody +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/buffer.js b/tools/ui/node_modules/hono/dist/cjs/utils/buffer.js new file mode 100644 index 0000000000000000000000000000000000000000..5625dcbcf7109d764e3d967107a6ae2226531273 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/buffer.js @@ -0,0 +1,103 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var buffer_exports = {}; +__export(buffer_exports, { + bufferToFormData: () => bufferToFormData, + bufferToString: () => bufferToString, + equal: () => equal, + timingSafeEqual: () => timingSafeEqual +}); +module.exports = __toCommonJS(buffer_exports); +var import_crypto = require("./crypto"); +const equal = (a, b) => { + if (a === b) { + return true; + } + if (a.byteLength !== b.byteLength) { + return false; + } + const va = new DataView(a); + const vb = new DataView(b); + let i = va.byteLength; + while (i--) { + if (va.getUint8(i) !== vb.getUint8(i)) { + return false; + } + } + return true; +}; +const constantTimeEqualString = (a, b) => { + const aLen = a.length; + const bLen = b.length; + const maxLen = Math.max(aLen, bLen); + let out = aLen ^ bLen; + for (let i = 0; i < maxLen; i++) { + const aChar = i < aLen ? a.charCodeAt(i) : 0; + const bChar = i < bLen ? b.charCodeAt(i) : 0; + out |= aChar ^ bChar; + } + return out === 0; +}; +const timingSafeEqualString = async (a, b, hashFunction) => { + if (!hashFunction) { + hashFunction = import_crypto.sha256; + } + const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]); + if (sa == null || sb == null || typeof sa !== "string" || typeof sb !== "string") { + return false; + } + const hashEqual = constantTimeEqualString(sa, sb); + const originalEqual = constantTimeEqualString(a, b); + return hashEqual && originalEqual; +}; +const timingSafeEqual = async (a, b, hashFunction) => { + if (typeof a === "string" && typeof b === "string") { + return timingSafeEqualString(a, b, hashFunction); + } + if (!hashFunction) { + hashFunction = import_crypto.sha256; + } + const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]); + if (!sa || !sb || typeof sa !== "string" || typeof sb !== "string") { + return false; + } + return timingSafeEqualString(sa, sb); +}; +const bufferToString = (buffer) => { + if (buffer instanceof ArrayBuffer) { + const enc = new TextDecoder("utf-8"); + return enc.decode(buffer); + } + return buffer; +}; +const bufferToFormData = (arrayBuffer, contentType) => { + const response = new Response(arrayBuffer, { + headers: { + // Normalize the media type (case-insensitive) while keeping parameters like the boundary + "Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase()) + } + }); + return response.formData(); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + bufferToFormData, + bufferToString, + equal, + timingSafeEqual +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/color.js b/tools/ui/node_modules/hono/dist/cjs/utils/color.js new file mode 100644 index 0000000000000000000000000000000000000000..e8b9a49211ea68d0ff8b465b3f5429e57f009be3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/color.js @@ -0,0 +1,48 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var color_exports = {}; +__export(color_exports, { + getColorEnabled: () => getColorEnabled, + getColorEnabledAsync: () => getColorEnabledAsync +}); +module.exports = __toCommonJS(color_exports); +function getColorEnabled() { + const { process, Deno } = globalThis; + const isNoColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : process !== void 0 ? ( + // eslint-disable-next-line no-unsafe-optional-chaining + "NO_COLOR" in process?.env + ) : false; + return !isNoColor; +} +async function getColorEnabledAsync() { + const { navigator } = globalThis; + const cfWorkers = "cloudflare:workers"; + const isNoColor = navigator !== void 0 && navigator.userAgent === "Cloudflare-Workers" ? await (async () => { + try { + return "NO_COLOR" in ((await import(cfWorkers)).env ?? {}); + } catch { + return false; + } + })() : !getColorEnabled(); + return !isNoColor; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getColorEnabled, + getColorEnabledAsync +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/compress.js b/tools/ui/node_modules/hono/dist/cjs/utils/compress.js new file mode 100644 index 0000000000000000000000000000000000000000..0c063361e71e370cd6059d13d22fe2ab911d0e19 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/compress.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var compress_exports = {}; +__export(compress_exports, { + COMPRESSIBLE_CONTENT_TYPE_REGEX: () => COMPRESSIBLE_CONTENT_TYPE_REGEX +}); +module.exports = __toCommonJS(compress_exports); +const COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|msgpack|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|vnd\.msgpack|wasm|x-httpd-php|x-javascript|x-msgpack|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml|msgpack))(?:[;\s]|$)/i; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + COMPRESSIBLE_CONTENT_TYPE_REGEX +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/concurrent.js b/tools/ui/node_modules/hono/dist/cjs/utils/concurrent.js new file mode 100644 index 0000000000000000000000000000000000000000..d351c49c9d1de29fc64d0a171d1130da8d1cb9da --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/concurrent.js @@ -0,0 +1,61 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var concurrent_exports = {}; +__export(concurrent_exports, { + createPool: () => createPool +}); +module.exports = __toCommonJS(concurrent_exports); +const DEFAULT_CONCURRENCY = 1024; +const createPool = ({ + concurrency, + interval +} = {}) => { + concurrency ||= DEFAULT_CONCURRENCY; + if (concurrency === Infinity) { + return { + run: async (fn) => fn() + }; + } + const pool = /* @__PURE__ */ new Set(); + const run = async (fn, promise, resolve) => { + if (pool.size >= concurrency) { + promise ||= new Promise((r) => resolve = r); + setTimeout(() => run(fn, promise, resolve)); + return promise; + } + const marker = {}; + pool.add(marker); + const result = await fn(); + if (interval) { + setTimeout(() => pool.delete(marker), interval); + } else { + pool.delete(marker); + } + if (resolve) { + resolve(result); + return promise; + } else { + return result; + } + }; + return { run }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createPool +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/constants.js b/tools/ui/node_modules/hono/dist/cjs/utils/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..7f7f0f610f8252f570f050a8d9792bc62e4074d2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/constants.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var constants_exports = {}; +__export(constants_exports, { + COMPOSED_HANDLER: () => COMPOSED_HANDLER +}); +module.exports = __toCommonJS(constants_exports); +const COMPOSED_HANDLER = "__COMPOSED_HANDLER"; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + COMPOSED_HANDLER +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/cookie.js b/tools/ui/node_modules/hono/dist/cjs/utils/cookie.js new file mode 100644 index 0000000000000000000000000000000000000000..f2e4ca121a4c3abf6018ffe4771ef48051fb426c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/cookie.js @@ -0,0 +1,199 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var cookie_exports = {}; +__export(cookie_exports, { + parse: () => parse, + parseSigned: () => parseSigned, + serialize: () => serialize, + serializeSigned: () => serializeSigned +}); +module.exports = __toCommonJS(cookie_exports); +var import_url = require("./url"); +const algorithm = { name: "HMAC", hash: "SHA-256" }; +const getCryptoKey = async (secret) => { + const secretBuf = typeof secret === "string" ? new TextEncoder().encode(secret) : secret; + return await crypto.subtle.importKey("raw", secretBuf, algorithm, false, ["sign", "verify"]); +}; +const makeSignature = async (value, secret) => { + const key = await getCryptoKey(secret); + const signature = await crypto.subtle.sign(algorithm.name, key, new TextEncoder().encode(value)); + return btoa(String.fromCharCode(...new Uint8Array(signature))); +}; +const verifySignature = async (base64Signature, value, secret) => { + try { + const signatureBinStr = atob(base64Signature); + const signature = new Uint8Array(signatureBinStr.length); + for (let i = 0, len = signatureBinStr.length; i < len; i++) { + signature[i] = signatureBinStr.charCodeAt(i); + } + return await crypto.subtle.verify(algorithm, secret, signature, new TextEncoder().encode(value)); + } catch { + return false; + } +}; +const validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/; +const relaxedCookieNameRegEx = /^[!#-:<>-[\]-~]+$/; +const validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/; +const trimCookieWhitespace = (value) => { + let start = 0; + let end = value.length; + while (start < end) { + const charCode = value.charCodeAt(start); + if (charCode !== 32 && charCode !== 9) { + break; + } + start++; + } + while (end > start) { + const charCode = value.charCodeAt(end - 1); + if (charCode !== 32 && charCode !== 9) { + break; + } + end--; + } + return start === 0 && end === value.length ? value : value.slice(start, end); +}; +const parse = (cookie, name) => { + if (name && cookie.indexOf(name) === -1) { + return {}; + } + const pairs = cookie.split(";"); + const parsedCookie = /* @__PURE__ */ Object.create(null); + for (const pairStr of pairs) { + const valueStartPos = pairStr.indexOf("="); + if (valueStartPos === -1) { + continue; + } + const cookieName = trimCookieWhitespace(pairStr.substring(0, valueStartPos)); + if (name && name !== cookieName || !relaxedCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) { + continue; + } + let cookieValue = trimCookieWhitespace(pairStr.substring(valueStartPos + 1)); + if (cookieValue.startsWith('"') && cookieValue.endsWith('"')) { + cookieValue = cookieValue.slice(1, -1); + } + if (validCookieValueRegEx.test(cookieValue)) { + parsedCookie[cookieName] = (0, import_url.tryDecodeURIComponent)(cookieValue); + if (name) { + break; + } + } + } + return parsedCookie; +}; +const parseSigned = async (cookie, secret, name) => { + const parsedCookie = /* @__PURE__ */ Object.create(null); + const secretKey = await getCryptoKey(secret); + for (const [key, value] of Object.entries(parse(cookie, name))) { + const signatureStartPos = value.lastIndexOf("."); + if (signatureStartPos < 1) { + continue; + } + const signedValue = value.substring(0, signatureStartPos); + const signature = value.substring(signatureStartPos + 1); + if (signature.length !== 44 || !signature.endsWith("=")) { + continue; + } + const isVerified = await verifySignature(signature, signedValue, secretKey); + parsedCookie[key] = isVerified ? signedValue : false; + } + return parsedCookie; +}; +const _serialize = (name, value, opt = {}) => { + if (!validCookieNameRegEx.test(name)) { + throw new Error("Invalid cookie name"); + } + let cookie = `${name}=${value}`; + if (name.startsWith("__Secure-") && !opt.secure) { + throw new Error("__Secure- Cookie must have Secure attributes"); + } + if (name.startsWith("__Host-")) { + if (!opt.secure) { + throw new Error("__Host- Cookie must have Secure attributes"); + } + if (opt.path !== "/") { + throw new Error('__Host- Cookie must have Path attributes with "/"'); + } + if (opt.domain) { + throw new Error("__Host- Cookie must not have Domain attributes"); + } + } + for (const key of ["domain", "path", "sameSite", "priority"]) { + if (opt[key] && /[;\r\n]/.test(opt[key])) { + throw new Error(`${key} must not contain ";", "\\r", or "\\n"`); + } + } + if (opt && typeof opt.maxAge === "number" && opt.maxAge >= 0) { + if (opt.maxAge > 3456e4) { + throw new Error( + "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration." + ); + } + cookie += `; Max-Age=${opt.maxAge | 0}`; + } + if (opt.domain && opt.prefix !== "host") { + cookie += `; Domain=${opt.domain}`; + } + if (opt.path) { + cookie += `; Path=${opt.path}`; + } + if (opt.expires) { + if (opt.expires.getTime() - Date.now() > 3456e7) { + throw new Error( + "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future." + ); + } + cookie += `; Expires=${opt.expires.toUTCString()}`; + } + if (opt.httpOnly) { + cookie += "; HttpOnly"; + } + if (opt.secure) { + cookie += "; Secure"; + } + if (opt.sameSite) { + cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`; + } + if (opt.priority) { + cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`; + } + if (opt.partitioned) { + if (!opt.secure) { + throw new Error("Partitioned Cookie must have Secure attributes"); + } + cookie += "; Partitioned"; + } + return cookie; +}; +const serialize = (name, value, opt) => { + value = encodeURIComponent(value); + return _serialize(name, value, opt); +}; +const serializeSigned = async (name, value, secret, opt = {}) => { + const signature = await makeSignature(value, secret); + value = `${value}.${signature}`; + value = encodeURIComponent(value); + return _serialize(name, value, opt); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + parse, + parseSigned, + serialize, + serializeSigned +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/crypto.js b/tools/ui/node_modules/hono/dist/cjs/utils/crypto.js new file mode 100644 index 0000000000000000000000000000000000000000..dfc1a4add69b2662a9cb46b8c4f6c075dab25ae0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/crypto.js @@ -0,0 +1,69 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var crypto_exports = {}; +__export(crypto_exports, { + createHash: () => createHash, + md5: () => md5, + sha1: () => sha1, + sha256: () => sha256 +}); +module.exports = __toCommonJS(crypto_exports); +const sha256 = async (data) => { + const algorithm = { name: "SHA-256", alias: "sha256" }; + const hash = await createHash(data, algorithm); + return hash; +}; +const sha1 = async (data) => { + const algorithm = { name: "SHA-1", alias: "sha1" }; + const hash = await createHash(data, algorithm); + return hash; +}; +const md5 = async (data) => { + const algorithm = { name: "MD5", alias: "md5" }; + const hash = await createHash(data, algorithm); + return hash; +}; +const createHash = async (data, algorithm) => { + let sourceBuffer; + if (ArrayBuffer.isView(data) || data instanceof ArrayBuffer) { + sourceBuffer = data; + } else { + if (typeof data === "object") { + data = JSON.stringify(data); + } + sourceBuffer = new TextEncoder().encode(String(data)); + } + if (crypto && crypto.subtle) { + const buffer = await crypto.subtle.digest( + { + name: algorithm.name + }, + sourceBuffer + ); + const hash = Array.prototype.map.call(new Uint8Array(buffer), (x) => ("00" + x.toString(16)).slice(-2)).join(""); + return hash; + } + return null; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createHash, + md5, + sha1, + sha256 +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/encode.js b/tools/ui/node_modules/hono/dist/cjs/utils/encode.js new file mode 100644 index 0000000000000000000000000000000000000000..2a339709f60b04f110d73db9b51711d066eac1ce --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/encode.js @@ -0,0 +1,54 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var encode_exports = {}; +__export(encode_exports, { + decodeBase64: () => decodeBase64, + decodeBase64Url: () => decodeBase64Url, + encodeBase64: () => encodeBase64, + encodeBase64Url: () => encodeBase64Url +}); +module.exports = __toCommonJS(encode_exports); +const decodeBase64Url = (str) => { + return decodeBase64(str.replace(/_|-/g, (m) => ({ _: "/", "-": "+" })[m] ?? m)); +}; +const encodeBase64Url = (buf) => encodeBase64(buf).replace(/\/|\+/g, (m) => ({ "/": "_", "+": "-" })[m] ?? m); +const encodeBase64 = (buf) => { + let binary = ""; + const bytes = new Uint8Array(buf); + for (let i = 0, len = bytes.length; i < len; i++) { + binary += String.fromCharCode(bytes[i]); + } + return btoa(binary); +}; +const decodeBase64 = (str) => { + const binary = atob(str); + const bytes = new Uint8Array(new ArrayBuffer(binary.length)); + const half = binary.length / 2; + for (let i = 0, j = binary.length - 1; i <= half; i++, j--) { + bytes[i] = binary.charCodeAt(i); + bytes[j] = binary.charCodeAt(j); + } + return bytes; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + decodeBase64, + decodeBase64Url, + encodeBase64, + encodeBase64Url +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/filepath.js b/tools/ui/node_modules/hono/dist/cjs/utils/filepath.js new file mode 100644 index 0000000000000000000000000000000000000000..95ea1df3326bd7ce9fdc2415d282a038d41727e5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/filepath.js @@ -0,0 +1,58 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var filepath_exports = {}; +__export(filepath_exports, { + getFilePath: () => getFilePath, + getFilePathWithoutDefaultDocument: () => getFilePathWithoutDefaultDocument +}); +module.exports = __toCommonJS(filepath_exports); +const getFilePath = (options) => { + let filename = options.filename; + const defaultDocument = options.defaultDocument || "index.html"; + if (filename.endsWith("/")) { + filename = filename.concat(defaultDocument); + } else if (!filename.match(/\.[a-zA-Z0-9_-]+$/)) { + filename = filename.concat("/" + defaultDocument); + } + const path = getFilePathWithoutDefaultDocument({ + root: options.root, + filename + }); + return path; +}; +const getFilePathWithoutDefaultDocument = (options) => { + let root = options.root || ""; + let filename = options.filename; + if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { + return; + } + filename = filename.replace(/^\.?[\/\\]/, ""); + filename = filename.replace(/\\/g, "/"); + root = root.replace(/\/$/, ""); + let path = root ? root + "/" + filename : filename; + path = path.replace(/^\.?\//, ""); + if (root[0] !== "/" && path[0] === "/") { + return; + } + return path; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getFilePath, + getFilePathWithoutDefaultDocument +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/handler.js b/tools/ui/node_modules/hono/dist/cjs/utils/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..d9a1dedd5682a3bdbe1d5ee5ef2f395c8f06142f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/handler.js @@ -0,0 +1,36 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var handler_exports = {}; +__export(handler_exports, { + findTargetHandler: () => findTargetHandler, + isMiddleware: () => isMiddleware +}); +module.exports = __toCommonJS(handler_exports); +var import_constants = require("./constants"); +const isMiddleware = (handler) => handler.length > 1; +const findTargetHandler = (handler) => { + return handler[import_constants.COMPOSED_HANDLER] ? ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + findTargetHandler(handler[import_constants.COMPOSED_HANDLER]) + ) : handler; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + findTargetHandler, + isMiddleware +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/headers.js b/tools/ui/node_modules/hono/dist/cjs/utils/headers.js new file mode 100644 index 0000000000000000000000000000000000000000..2295eea2a938f15c57140e9a8017f3fa9f0e79e5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/headers.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var headers_exports = {}; +module.exports = __toCommonJS(headers_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/html.js b/tools/ui/node_modules/hono/dist/cjs/utils/html.js new file mode 100644 index 0000000000000000000000000000000000000000..3c29dd6bc23c613e1e2d7e094f5445523e742685 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/html.js @@ -0,0 +1,150 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var html_exports = {}; +__export(html_exports, { + HtmlEscapedCallbackPhase: () => HtmlEscapedCallbackPhase, + escapeToBuffer: () => escapeToBuffer, + raw: () => raw, + resolveCallback: () => resolveCallback, + resolveCallbackSync: () => resolveCallbackSync, + stringBufferToString: () => stringBufferToString +}); +module.exports = __toCommonJS(html_exports); +const HtmlEscapedCallbackPhase = { + Stringify: 1, + BeforeStream: 2, + Stream: 3 +}; +const raw = (value, callbacks) => { + const escapedString = new String(value); + escapedString.isEscaped = true; + escapedString.callbacks = callbacks; + return escapedString; +}; +const escapeRe = /[&<>'"]/; +const stringBufferToString = async (buffer, callbacks) => { + let str = ""; + callbacks ||= []; + const resolvedBuffer = await Promise.all(buffer); + for (let i = resolvedBuffer.length - 1; ; i--) { + str += resolvedBuffer[i]; + i--; + if (i < 0) { + break; + } + let r = resolvedBuffer[i]; + if (typeof r === "object") { + callbacks.push(...r.callbacks || []); + } + const isEscaped = r.isEscaped; + r = await (typeof r === "object" ? r.toString() : r); + if (typeof r === "object") { + callbacks.push(...r.callbacks || []); + } + if (r.isEscaped ?? isEscaped) { + str += r; + } else { + const buf = [str]; + escapeToBuffer(r, buf); + str = buf[0]; + } + } + return raw(str, callbacks); +}; +const escapeToBuffer = (str, buffer) => { + const match = str.search(escapeRe); + if (match === -1) { + buffer[0] += str; + return; + } + let escape; + let index; + let lastIndex = 0; + for (index = match; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escape = """; + break; + case 39: + escape = "'"; + break; + case 38: + escape = "&"; + break; + case 60: + escape = "<"; + break; + case 62: + escape = ">"; + break; + default: + continue; + } + buffer[0] += str.substring(lastIndex, index) + escape; + lastIndex = index + 1; + } + buffer[0] += str.substring(lastIndex, index); +}; +const resolveCallbackSync = (str) => { + const callbacks = str.callbacks; + if (!callbacks?.length) { + return str; + } + const buffer = [str]; + const context = {}; + callbacks.forEach((c) => c({ phase: HtmlEscapedCallbackPhase.Stringify, buffer, context })); + return buffer[0]; +}; +const resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => { + if (typeof str === "object" && !(str instanceof String)) { + if (!(str instanceof Promise)) { + str = str.toString(); + } + if (str instanceof Promise) { + str = await str; + } + } + const callbacks = str.callbacks; + if (!callbacks?.length) { + return Promise.resolve(str); + } + if (buffer) { + buffer[0] += str; + } else { + buffer = [str]; + } + const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then( + (res) => Promise.all( + res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer)) + ).then(() => buffer[0]) + ); + if (preserveCallbacks) { + return raw(await resStr, callbacks); + } else { + return resStr; + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HtmlEscapedCallbackPhase, + escapeToBuffer, + raw, + resolveCallback, + resolveCallbackSync, + stringBufferToString +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/http-status.js b/tools/ui/node_modules/hono/dist/cjs/utils/http-status.js new file mode 100644 index 0000000000000000000000000000000000000000..ec668f01e822ad22e5d2535a1674f5274613dbe7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/http-status.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var http_status_exports = {}; +module.exports = __toCommonJS(http_status_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/ipaddr.js b/tools/ui/node_modules/hono/dist/cjs/utils/ipaddr.js new file mode 100644 index 0000000000000000000000000000000000000000..ee150d0c147e5bb6b5853e8ab24f31830fc9e6ec --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/ipaddr.js @@ -0,0 +1,318 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ipaddr_exports = {}; +__export(ipaddr_exports, { + INVALID_IP_ADDRESS_ERROR_CODE: () => INVALID_IP_ADDRESS_ERROR_CODE, + convertIPv4BinaryToString: () => convertIPv4BinaryToString, + convertIPv4MappedIPv6ToIPv4: () => convertIPv4MappedIPv6ToIPv4, + convertIPv4ToBinary: () => convertIPv4ToBinary, + convertIPv6BinaryToString: () => convertIPv6BinaryToString, + convertIPv6ToBinary: () => convertIPv6ToBinary, + distinctRemoteAddr: () => distinctRemoteAddr, + expandIPv6: () => expandIPv6, + isIPv4MappedIPv6: () => isIPv4MappedIPv6 +}); +module.exports = __toCommonJS(ipaddr_exports); +const expandIPv6 = (ipV6) => { + const sections = ipV6.split(":"); + if (IPV4_REGEX.test(sections.at(-1))) { + sections.splice( + -1, + 1, + ...convertIPv6BinaryToString(convertIPv4ToBinary(sections.at(-1))).substring(2).split(":") + // => ['7f00', '0001'] + ); + } + for (let i = 0; i < sections.length; i++) { + const node = sections[i]; + if (node !== "") { + sections[i] = node.padStart(4, "0"); + } else { + while (sections[i + 1] === "") { + sections.splice(i + 1, 1); + } + sections[i] = new Array(8 - sections.length + 1).fill("0000").join(":"); + } + } + return sections.join(":"); +}; +const IPV4_OCTET_PART = "(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])"; +const IPV4_REGEX = new RegExp(`^(?:${IPV4_OCTET_PART}\\.){3}${IPV4_OCTET_PART}$`); +const INVALID_IP_ADDRESS_ERROR_CODE = "ERR_INVALID_IP_ADDRESS"; +const CHAR_CODE_0 = 48; +const CHAR_CODE_9 = 57; +const CHAR_CODE_A = 65; +const CHAR_CODE_F = 70; +const CHAR_CODE_a = 97; +const CHAR_CODE_f = 102; +const CHAR_CODE_DOT = 46; +const CHAR_CODE_COLON = 58; +const CHAR_CODE_PERCENT = 37; +const distinctRemoteAddr = (remoteAddr) => { + if (IPV4_REGEX.test(remoteAddr)) { + return "IPv4"; + } + if (remoteAddr.includes(":")) { + return "IPv6"; + } +}; +const createInvalidIPAddressError = (message) => { + const error = new TypeError(message); + error.code = INVALID_IP_ADDRESS_ERROR_CODE; + return error; +}; +const throwInvalidIPv4Address = (ipv4) => { + throw createInvalidIPAddressError(`Invalid IPv4 address: ${ipv4}`); +}; +const throwInvalidIPv6Address = (ipv6) => { + throw createInvalidIPAddressError(`Invalid IPv6 address: ${ipv6}`); +}; +const parseIPv4ToBinary = (ipv4, start, end, onInvalid) => { + let result = 0n; + let octets = 0; + let octet = 0; + let digits = 0; + let firstDigit = 0; + for (let i = start; i <= end; i++) { + const code = i < end ? ipv4.charCodeAt(i) : CHAR_CODE_DOT; + if (code >= CHAR_CODE_0 && code <= CHAR_CODE_9) { + if (digits === 0) { + firstDigit = code; + } else if (firstDigit === CHAR_CODE_0) { + onInvalid(); + } + octet = octet * 10 + code - CHAR_CODE_0; + if (octet > 255) { + onInvalid(); + } + digits++; + continue; + } + if (code !== CHAR_CODE_DOT || digits === 0 || octets === 4) { + onInvalid(); + } + result = (result << 8n) + BigInt(octet); + octets++; + octet = 0; + digits = 0; + } + if (octets !== 4) { + onInvalid(); + } + return result; +}; +const parseIPv6HexCode = (code) => { + if (code >= CHAR_CODE_0 && code <= CHAR_CODE_9) { + return code - CHAR_CODE_0; + } + if (code >= CHAR_CODE_A && code <= CHAR_CODE_F) { + return code - CHAR_CODE_A + 10; + } + if (code >= CHAR_CODE_a && code <= CHAR_CODE_f) { + return code - CHAR_CODE_a + 10; + } + return -1; +}; +const isIPv6LinkLocal = (ipv6binary) => ipv6binary >> 118n === 0x3fan; +const convertIPv4ToBinary = (ipv4) => { + return parseIPv4ToBinary(ipv4, 0, ipv4.length, () => throwInvalidIPv4Address(ipv4)); +}; +const convertIPv6ToBinary = (ipv6) => { + const length = ipv6.length; + const sections = []; + let hasZoneId = false; + let compressAt = -1; + let index = 0; + if (length === 0) { + throwInvalidIPv6Address(ipv6); + } + while (index < length) { + if (sections.length > 8) { + throwInvalidIPv6Address(ipv6); + } + let code = ipv6.charCodeAt(index); + if (code === CHAR_CODE_PERCENT) { + if (index + 1 === length) { + throwInvalidIPv6Address(ipv6); + } + hasZoneId = true; + break; + } + if (code === CHAR_CODE_COLON) { + if (index + 1 < length && ipv6.charCodeAt(index + 1) === CHAR_CODE_COLON) { + if (compressAt !== -1) { + throwInvalidIPv6Address(ipv6); + } + compressAt = sections.length; + index += 2; + continue; + } + throwInvalidIPv6Address(ipv6); + } + let value = 0; + let digits = 0; + const sectionStart = index; + while (index < length) { + code = ipv6.charCodeAt(index); + const hex = parseIPv6HexCode(code); + if (hex === -1) { + break; + } + if (digits === 4) { + throwInvalidIPv6Address(ipv6); + } + value = value << 4 | hex; + digits++; + index++; + } + if (index < length && ipv6.charCodeAt(index) === CHAR_CODE_DOT) { + let ipv4End = length; + for (let i = index; i < length; i++) { + if (ipv6.charCodeAt(i) === CHAR_CODE_PERCENT) { + if (i + 1 === length) { + throwInvalidIPv6Address(ipv6); + } + hasZoneId = true; + ipv4End = i; + break; + } + } + const ipv4 = parseIPv4ToBinary( + ipv6, + sectionStart, + ipv4End, + () => throwInvalidIPv6Address(ipv6) + ); + sections.push(Number(ipv4 >> 16n & 0xffffn), Number(ipv4 & 0xffffn)); + index = length; + break; + } + if (digits === 0) { + throwInvalidIPv6Address(ipv6); + } + sections.push(value); + if (index === length) { + break; + } + code = ipv6.charCodeAt(index); + if (code === CHAR_CODE_PERCENT) { + if (index + 1 === length) { + throwInvalidIPv6Address(ipv6); + } + hasZoneId = true; + break; + } + if (code !== CHAR_CODE_COLON) { + throwInvalidIPv6Address(ipv6); + } + if (index + 1 < length && ipv6.charCodeAt(index + 1) === CHAR_CODE_COLON) { + if (compressAt !== -1) { + throwInvalidIPv6Address(ipv6); + } + compressAt = sections.length; + index += 2; + continue; + } + index++; + if (index === length) { + throwInvalidIPv6Address(ipv6); + } + } + if (compressAt === -1 ? sections.length !== 8 : sections.length >= 8) { + throwInvalidIPv6Address(ipv6); + } + let result = 0n; + const zeros = compressAt === -1 ? 0 : 8 - sections.length; + const firstSectionEnd = compressAt === -1 ? sections.length : compressAt; + for (let i = 0; i < firstSectionEnd; i++) { + result <<= 16n; + result += BigInt(sections[i]); + } + for (let i = 0; i < zeros; i++) { + result <<= 16n; + } + for (let i = firstSectionEnd; i < sections.length; i++) { + result <<= 16n; + result += BigInt(sections[i]); + } + if (hasZoneId && !isIPv6LinkLocal(result)) { + throwInvalidIPv6Address(ipv6); + } + return result; +}; +const convertIPv4BinaryToString = (ipV4) => { + const sections = []; + for (let i = 0; i < 4; i++) { + sections.push(ipV4 >> BigInt(8 * (3 - i)) & 0xffn); + } + return sections.join("."); +}; +const isIPv4MappedIPv6 = (ipv6binary) => ipv6binary >> 32n === 0xffffn; +const convertIPv4MappedIPv6ToIPv4 = (ipv6binary) => ipv6binary & 0xffffffffn; +const convertIPv6BinaryToString = (ipV6) => { + if (ipV6 === 0n) { + return "::"; + } + if (isIPv4MappedIPv6(ipV6)) { + return `::ffff:${convertIPv4BinaryToString(convertIPv4MappedIPv6ToIPv4(ipV6))}`; + } + const sections = []; + for (let i = 0; i < 8; i++) { + sections.push((ipV6 >> BigInt(16 * (7 - i)) & 0xffffn).toString(16)); + } + let currentZeroStart = -1; + let maxZeroStart = -1; + let maxZeroEnd = -1; + for (let i = 0; i < 8; i++) { + if (sections[i] === "0") { + if (currentZeroStart === -1) { + currentZeroStart = i; + } + } else { + if (currentZeroStart > -1) { + if (i - currentZeroStart > maxZeroEnd - maxZeroStart) { + maxZeroStart = currentZeroStart; + maxZeroEnd = i; + } + currentZeroStart = -1; + } + } + } + if (currentZeroStart > -1) { + if (8 - currentZeroStart > maxZeroEnd - maxZeroStart) { + maxZeroStart = currentZeroStart; + maxZeroEnd = 8; + } + } + if (maxZeroStart !== -1 && maxZeroEnd - maxZeroStart > 1) { + sections.splice(maxZeroStart, maxZeroEnd - maxZeroStart, ":"); + } + return sections.join(":").replace(/:{2,}/g, "::"); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + INVALID_IP_ADDRESS_ERROR_CODE, + convertIPv4BinaryToString, + convertIPv4MappedIPv6ToIPv4, + convertIPv4ToBinary, + convertIPv6BinaryToString, + convertIPv6ToBinary, + distinctRemoteAddr, + expandIPv6, + isIPv4MappedIPv6 +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/jwt/index.js b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8808f8a2fa986abd7366e40ff179c5d0d9db540d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/index.js @@ -0,0 +1,28 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jwt_exports = {}; +__export(jwt_exports, { + Jwt: () => Jwt +}); +module.exports = __toCommonJS(jwt_exports); +var import_jwt = require("./jwt"); +const Jwt = { sign: import_jwt.sign, verify: import_jwt.verify, decode: import_jwt.decode, verifyWithJwks: import_jwt.verifyWithJwks }; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Jwt +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jwa.js b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jwa.js new file mode 100644 index 0000000000000000000000000000000000000000..b264f4be293db4d59262e66d5c9b0036df5841c4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jwa.js @@ -0,0 +1,42 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jwa_exports = {}; +__export(jwa_exports, { + AlgorithmTypes: () => AlgorithmTypes +}); +module.exports = __toCommonJS(jwa_exports); +var AlgorithmTypes = /* @__PURE__ */ ((AlgorithmTypes2) => { + AlgorithmTypes2["HS256"] = "HS256"; + AlgorithmTypes2["HS384"] = "HS384"; + AlgorithmTypes2["HS512"] = "HS512"; + AlgorithmTypes2["RS256"] = "RS256"; + AlgorithmTypes2["RS384"] = "RS384"; + AlgorithmTypes2["RS512"] = "RS512"; + AlgorithmTypes2["PS256"] = "PS256"; + AlgorithmTypes2["PS384"] = "PS384"; + AlgorithmTypes2["PS512"] = "PS512"; + AlgorithmTypes2["ES256"] = "ES256"; + AlgorithmTypes2["ES384"] = "ES384"; + AlgorithmTypes2["ES512"] = "ES512"; + AlgorithmTypes2["EdDSA"] = "EdDSA"; + return AlgorithmTypes2; +})(AlgorithmTypes || {}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + AlgorithmTypes +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jws.js b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jws.js new file mode 100644 index 0000000000000000000000000000000000000000..19ffd346e25b2f8a09d44102c0e7be4d4a61a0ae --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jws.js @@ -0,0 +1,215 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jws_exports = {}; +__export(jws_exports, { + signing: () => signing, + verifying: () => verifying +}); +module.exports = __toCommonJS(jws_exports); +var import_adapter = require("../../helper/adapter"); +var import_encode = require("../encode"); +var import_types = require("./types"); +var import_utf8 = require("./utf8"); +async function signing(privateKey, alg, data) { + const algorithm = getKeyAlgorithm(alg); + const cryptoKey = await importPrivateKey(privateKey, algorithm); + return await crypto.subtle.sign(algorithm, cryptoKey, data); +} +async function verifying(publicKey, alg, signature, data) { + const algorithm = getKeyAlgorithm(alg); + const cryptoKey = await importPublicKey(publicKey, algorithm); + return await crypto.subtle.verify(algorithm, cryptoKey, signature, data); +} +function pemToBinary(pem) { + return (0, import_encode.decodeBase64)(pem.replace(/-+(BEGIN|END).*?-+/g, "").replace(/\s/g, "")); +} +async function importPrivateKey(key, alg) { + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); + } + if (isCryptoKey(key)) { + if (key.type !== "private" && key.type !== "secret") { + throw new Error( + `unexpected key type: CryptoKey.type is ${key.type}, expected private or secret` + ); + } + return key; + } + const usages = [import_types.CryptoKeyUsage.Sign]; + if (typeof key === "object") { + return await crypto.subtle.importKey("jwk", key, alg, false, usages); + } + if (key.includes("PRIVATE")) { + return await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, false, usages); + } + return await crypto.subtle.importKey("raw", import_utf8.utf8Encoder.encode(key), alg, false, usages); +} +async function importPublicKey(key, alg) { + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); + } + if (isCryptoKey(key)) { + if (key.type === "public" || key.type === "secret") { + return key; + } + key = await exportPublicJwkFrom(key); + } + if (typeof key === "string" && key.includes("PRIVATE")) { + const privateKey = await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, true, [ + import_types.CryptoKeyUsage.Sign + ]); + key = await exportPublicJwkFrom(privateKey); + } + const usages = [import_types.CryptoKeyUsage.Verify]; + if (typeof key === "object") { + return await crypto.subtle.importKey("jwk", key, alg, false, usages); + } + if (key.includes("PUBLIC")) { + return await crypto.subtle.importKey("spki", pemToBinary(key), alg, false, usages); + } + return await crypto.subtle.importKey("raw", import_utf8.utf8Encoder.encode(key), alg, false, usages); +} +async function exportPublicJwkFrom(privateKey) { + if (privateKey.type !== "private") { + throw new Error(`unexpected key type: ${privateKey.type}`); + } + if (!privateKey.extractable) { + throw new Error("unexpected private key is unextractable"); + } + const jwk = await crypto.subtle.exportKey("jwk", privateKey); + const { kty } = jwk; + const { alg, e, n } = jwk; + const { crv, x, y } = jwk; + return { kty, alg, e, n, crv, x, y, key_ops: [import_types.CryptoKeyUsage.Verify] }; +} +function getKeyAlgorithm(name) { + switch (name) { + case "HS256": + return { + name: "HMAC", + hash: { + name: "SHA-256" + } + }; + case "HS384": + return { + name: "HMAC", + hash: { + name: "SHA-384" + } + }; + case "HS512": + return { + name: "HMAC", + hash: { + name: "SHA-512" + } + }; + case "RS256": + return { + name: "RSASSA-PKCS1-v1_5", + hash: { + name: "SHA-256" + } + }; + case "RS384": + return { + name: "RSASSA-PKCS1-v1_5", + hash: { + name: "SHA-384" + } + }; + case "RS512": + return { + name: "RSASSA-PKCS1-v1_5", + hash: { + name: "SHA-512" + } + }; + case "PS256": + return { + name: "RSA-PSS", + hash: { + name: "SHA-256" + }, + saltLength: 32 + // 256 >> 3 + }; + case "PS384": + return { + name: "RSA-PSS", + hash: { + name: "SHA-384" + }, + saltLength: 48 + // 384 >> 3 + }; + case "PS512": + return { + name: "RSA-PSS", + hash: { + name: "SHA-512" + }, + saltLength: 64 + // 512 >> 3, + }; + case "ES256": + return { + name: "ECDSA", + hash: { + name: "SHA-256" + }, + namedCurve: "P-256" + }; + case "ES384": + return { + name: "ECDSA", + hash: { + name: "SHA-384" + }, + namedCurve: "P-384" + }; + case "ES512": + return { + name: "ECDSA", + hash: { + name: "SHA-512" + }, + namedCurve: "P-521" + }; + case "EdDSA": + return { + name: "Ed25519", + namedCurve: "Ed25519" + }; + default: + throw new import_types.JwtAlgorithmNotImplemented(name); + } +} +function isCryptoKey(key) { + const runtime = (0, import_adapter.getRuntimeKey)(); + if (runtime === "node" && !!crypto.webcrypto) { + return key instanceof crypto.webcrypto.CryptoKey; + } + return key instanceof CryptoKey; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + signing, + verifying +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jwt.js b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jwt.js new file mode 100644 index 0000000000000000000000000000000000000000..acd1ddfc0b3d378ddf3b2121d27a20373451142a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/jwt.js @@ -0,0 +1,219 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var jwt_exports = {}; +__export(jwt_exports, { + decode: () => decode, + decodeHeader: () => decodeHeader, + isTokenHeader: () => isTokenHeader, + sign: () => sign, + verify: () => verify, + verifyWithJwks: () => verifyWithJwks +}); +module.exports = __toCommonJS(jwt_exports); +var import_encode = require("../../utils/encode"); +var import_jwa = require("./jwa"); +var import_jws = require("./jws"); +var import_types = require("./types"); +var import_utf8 = require("./utf8"); +const encodeJwtPart = (part) => (0, import_encode.encodeBase64Url)(import_utf8.utf8Encoder.encode(JSON.stringify(part)).buffer).replace(/=/g, ""); +const encodeSignaturePart = (buf) => (0, import_encode.encodeBase64Url)(buf).replace(/=/g, ""); +const decodeJwtPart = (part) => JSON.parse(import_utf8.utf8Decoder.decode((0, import_encode.decodeBase64Url)(part))); +function isTokenHeader(obj) { + if (typeof obj === "object" && obj !== null) { + const objWithAlg = obj; + return "alg" in objWithAlg && Object.values(import_jwa.AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT"); + } + return false; +} +const sign = async (payload, privateKey, alg = "HS256") => { + const encodedPayload = encodeJwtPart(payload); + let encodedHeader; + if (typeof privateKey === "object" && "alg" in privateKey) { + alg = privateKey.alg; + encodedHeader = encodeJwtPart({ alg, typ: "JWT", kid: privateKey.kid }); + } else { + encodedHeader = encodeJwtPart({ alg, typ: "JWT" }); + } + const partialToken = `${encodedHeader}.${encodedPayload}`; + const signaturePart = await (0, import_jws.signing)(privateKey, alg, import_utf8.utf8Encoder.encode(partialToken)); + const signature = encodeSignaturePart(signaturePart); + return `${partialToken}.${signature}`; +}; +const verify = async (token, publicKey, algOrOptions) => { + if (!algOrOptions) { + throw new import_types.JwtAlgorithmRequired(); + } + const { + alg, + iss, + nbf = true, + exp = true, + iat = true, + aud + } = typeof algOrOptions === "string" ? { alg: algOrOptions } : algOrOptions; + if (!alg) { + throw new import_types.JwtAlgorithmRequired(); + } + const tokenParts = token.split("."); + if (tokenParts.length !== 3) { + throw new import_types.JwtTokenInvalid(token); + } + const { header, payload } = decode(token); + if (!isTokenHeader(header)) { + throw new import_types.JwtHeaderInvalid(header); + } + if (header.alg !== alg) { + throw new import_types.JwtAlgorithmMismatch(alg, header.alg); + } + const now = Math.floor(Date.now() / 1e3); + if (nbf && payload.nbf !== void 0) { + if (typeof payload.nbf !== "number" || !Number.isFinite(payload.nbf) || payload.nbf > now) { + throw new import_types.JwtTokenNotBefore(token); + } + } + if (exp && payload.exp !== void 0) { + if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp) || payload.exp <= now) { + throw new import_types.JwtTokenExpired(token); + } + } + if (iat && payload.iat !== void 0) { + if (typeof payload.iat !== "number" || !Number.isFinite(payload.iat) || now < payload.iat) { + throw new import_types.JwtTokenIssuedAt(now, payload.iat); + } + } + if (iss) { + if (!payload.iss) { + throw new import_types.JwtTokenIssuer(iss, null); + } + if (typeof iss === "string" && payload.iss !== iss) { + throw new import_types.JwtTokenIssuer(iss, payload.iss); + } + if (iss instanceof RegExp && !iss.test(payload.iss)) { + throw new import_types.JwtTokenIssuer(iss, payload.iss); + } + } + if (aud) { + if (!payload.aud) { + throw new import_types.JwtPayloadRequiresAud(payload); + } + const audiences = Array.isArray(payload.aud) ? payload.aud : [payload.aud]; + const matched = audiences.some( + (payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud) + ); + if (!matched) { + throw new import_types.JwtTokenAudience(aud, payload.aud); + } + } + const headerPayload = token.substring(0, token.lastIndexOf(".")); + const verified = await (0, import_jws.verifying)( + publicKey, + alg, + (0, import_encode.decodeBase64Url)(tokenParts[2]), + import_utf8.utf8Encoder.encode(headerPayload) + ); + if (!verified) { + throw new import_types.JwtTokenSignatureMismatched(token); + } + return payload; +}; +const symmetricAlgorithms = [ + import_jwa.AlgorithmTypes.HS256, + import_jwa.AlgorithmTypes.HS384, + import_jwa.AlgorithmTypes.HS512 +]; +const verifyWithJwks = async (token, options, init) => { + const verifyOpts = options.verification || {}; + const header = decodeHeader(token); + if (!isTokenHeader(header)) { + throw new import_types.JwtHeaderInvalid(header); + } + if (!header.kid) { + throw new import_types.JwtHeaderRequiresKid(header); + } + if (symmetricAlgorithms.includes(header.alg)) { + throw new import_types.JwtSymmetricAlgorithmNotAllowed(header.alg); + } + if (!options.allowedAlgorithms.includes(header.alg)) { + throw new import_types.JwtAlgorithmNotAllowed(header.alg, options.allowedAlgorithms); + } + let verifyKeys = options.keys ? [...options.keys] : void 0; + if (options.jwks_uri) { + const response = await fetch(options.jwks_uri, init); + if (!response.ok) { + throw new Error(`failed to fetch JWKS from ${options.jwks_uri}`); + } + const data = await response.json(); + if (!data.keys) { + throw new Error('invalid JWKS response. "keys" field is missing'); + } + if (!Array.isArray(data.keys)) { + throw new Error('invalid JWKS response. "keys" field is not an array'); + } + verifyKeys ??= []; + verifyKeys.push(...data.keys); + } else if (!verifyKeys) { + throw new Error('verifyWithJwks requires options for either "keys" or "jwks_uri" or both'); + } + const matchingKey = verifyKeys.find((key) => key.kid === header.kid); + if (!matchingKey) { + throw new import_types.JwtTokenInvalid(token); + } + if (matchingKey.alg && matchingKey.alg !== header.alg) { + throw new import_types.JwtAlgorithmMismatch(matchingKey.alg, header.alg); + } + return await verify(token, matchingKey, { + alg: header.alg, + ...verifyOpts + }); +}; +const decode = (token) => { + const parts = token.split("."); + if (parts.length !== 3) { + throw new import_types.JwtTokenInvalid(token); + } + try { + const header = decodeJwtPart(parts[0]); + const payload = decodeJwtPart(parts[1]); + return { + header, + payload + }; + } catch { + throw new import_types.JwtTokenInvalid(token); + } +}; +const decodeHeader = (token) => { + const parts = token.split("."); + if (parts.length !== 3) { + throw new import_types.JwtTokenInvalid(token); + } + try { + return decodeJwtPart(parts[0]); + } catch { + throw new import_types.JwtTokenInvalid(token); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + decode, + decodeHeader, + isTokenHeader, + sign, + verify, + verifyWithJwks +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/jwt/types.js b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/types.js new file mode 100644 index 0000000000000000000000000000000000000000..8200ee58b009d7a7eca88eb9f33ef3286e4125a6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/types.js @@ -0,0 +1,161 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +__export(types_exports, { + CryptoKeyUsage: () => CryptoKeyUsage, + JwtAlgorithmMismatch: () => JwtAlgorithmMismatch, + JwtAlgorithmNotAllowed: () => JwtAlgorithmNotAllowed, + JwtAlgorithmNotImplemented: () => JwtAlgorithmNotImplemented, + JwtAlgorithmRequired: () => JwtAlgorithmRequired, + JwtHeaderInvalid: () => JwtHeaderInvalid, + JwtHeaderRequiresKid: () => JwtHeaderRequiresKid, + JwtPayloadRequiresAud: () => JwtPayloadRequiresAud, + JwtSymmetricAlgorithmNotAllowed: () => JwtSymmetricAlgorithmNotAllowed, + JwtTokenAudience: () => JwtTokenAudience, + JwtTokenExpired: () => JwtTokenExpired, + JwtTokenInvalid: () => JwtTokenInvalid, + JwtTokenIssuedAt: () => JwtTokenIssuedAt, + JwtTokenIssuer: () => JwtTokenIssuer, + JwtTokenNotBefore: () => JwtTokenNotBefore, + JwtTokenSignatureMismatched: () => JwtTokenSignatureMismatched +}); +module.exports = __toCommonJS(types_exports); +class JwtAlgorithmNotImplemented extends Error { + constructor(alg) { + super(`${alg} is not an implemented algorithm`); + this.name = "JwtAlgorithmNotImplemented"; + } +} +class JwtAlgorithmRequired extends Error { + constructor() { + super('JWT verification requires "alg" option to be specified'); + this.name = "JwtAlgorithmRequired"; + } +} +class JwtAlgorithmMismatch extends Error { + constructor(expected, actual) { + super(`JWT algorithm mismatch: expected "${expected}", got "${actual}"`); + this.name = "JwtAlgorithmMismatch"; + } +} +class JwtTokenInvalid extends Error { + constructor(token) { + super(`invalid JWT token: ${token}`); + this.name = "JwtTokenInvalid"; + } +} +class JwtTokenNotBefore extends Error { + constructor(token) { + super(`token (${token}) is being used before it's valid`); + this.name = "JwtTokenNotBefore"; + } +} +class JwtTokenExpired extends Error { + constructor(token) { + super(`token (${token}) expired`); + this.name = "JwtTokenExpired"; + } +} +class JwtTokenIssuedAt extends Error { + constructor(currentTimestamp, iat) { + super( + `Invalid "iat" claim, must be a valid number lower than "${currentTimestamp}" (iat: "${iat}")` + ); + this.name = "JwtTokenIssuedAt"; + } +} +class JwtTokenIssuer extends Error { + constructor(expected, iss) { + super(`expected issuer "${expected}", got ${iss ? `"${iss}"` : "none"} `); + this.name = "JwtTokenIssuer"; + } +} +class JwtHeaderInvalid extends Error { + constructor(header) { + super(`jwt header is invalid: ${JSON.stringify(header)}`); + this.name = "JwtHeaderInvalid"; + } +} +class JwtHeaderRequiresKid extends Error { + constructor(header) { + super(`required "kid" in jwt header: ${JSON.stringify(header)}`); + this.name = "JwtHeaderRequiresKid"; + } +} +class JwtSymmetricAlgorithmNotAllowed extends Error { + constructor(alg) { + super(`symmetric algorithm "${alg}" is not allowed for JWK verification`); + this.name = "JwtSymmetricAlgorithmNotAllowed"; + } +} +class JwtAlgorithmNotAllowed extends Error { + constructor(alg, allowedAlgorithms) { + super(`algorithm "${alg}" is not in the allowed list: [${allowedAlgorithms.join(", ")}]`); + this.name = "JwtAlgorithmNotAllowed"; + } +} +class JwtTokenSignatureMismatched extends Error { + constructor(token) { + super(`token(${token}) signature mismatched`); + this.name = "JwtTokenSignatureMismatched"; + } +} +class JwtPayloadRequiresAud extends Error { + constructor(payload) { + super(`required "aud" in jwt payload: ${JSON.stringify(payload)}`); + this.name = "JwtPayloadRequiresAud"; + } +} +class JwtTokenAudience extends Error { + constructor(expected, aud) { + super( + `expected audience "${Array.isArray(expected) ? expected.join(", ") : expected}", got "${aud}"` + ); + this.name = "JwtTokenAudience"; + } +} +var CryptoKeyUsage = /* @__PURE__ */ ((CryptoKeyUsage2) => { + CryptoKeyUsage2["Encrypt"] = "encrypt"; + CryptoKeyUsage2["Decrypt"] = "decrypt"; + CryptoKeyUsage2["Sign"] = "sign"; + CryptoKeyUsage2["Verify"] = "verify"; + CryptoKeyUsage2["DeriveKey"] = "deriveKey"; + CryptoKeyUsage2["DeriveBits"] = "deriveBits"; + CryptoKeyUsage2["WrapKey"] = "wrapKey"; + CryptoKeyUsage2["UnwrapKey"] = "unwrapKey"; + return CryptoKeyUsage2; +})(CryptoKeyUsage || {}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + CryptoKeyUsage, + JwtAlgorithmMismatch, + JwtAlgorithmNotAllowed, + JwtAlgorithmNotImplemented, + JwtAlgorithmRequired, + JwtHeaderInvalid, + JwtHeaderRequiresKid, + JwtPayloadRequiresAud, + JwtSymmetricAlgorithmNotAllowed, + JwtTokenAudience, + JwtTokenExpired, + JwtTokenInvalid, + JwtTokenIssuedAt, + JwtTokenIssuer, + JwtTokenNotBefore, + JwtTokenSignatureMismatched +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/jwt/utf8.js b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/utf8.js new file mode 100644 index 0000000000000000000000000000000000000000..e7839601f97da6d8ff1c212c6124508a44cdbde0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/jwt/utf8.js @@ -0,0 +1,30 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utf8_exports = {}; +__export(utf8_exports, { + utf8Decoder: () => utf8Decoder, + utf8Encoder: () => utf8Encoder +}); +module.exports = __toCommonJS(utf8_exports); +const utf8Encoder = new TextEncoder(); +const utf8Decoder = new TextDecoder(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + utf8Decoder, + utf8Encoder +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/mime.js b/tools/ui/node_modules/hono/dist/cjs/utils/mime.js new file mode 100644 index 0000000000000000000000000000000000000000..34c0520d6190e673ba5b062aa4e9f8048e487a78 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/mime.js @@ -0,0 +1,106 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var mime_exports = {}; +__export(mime_exports, { + getExtension: () => getExtension, + getMimeType: () => getMimeType, + mimes: () => baseMimes +}); +module.exports = __toCommonJS(mime_exports); +const getMimeType = (filename, mimes = baseMimes) => { + const regexp = /\.([a-zA-Z0-9]+?)$/; + const match = filename.match(regexp); + if (!match) { + return; + } + return mimes[match[1].toLowerCase()]; +}; +const getExtension = (mimeType) => { + const baseType = mimeType.split(";", 1)[0].trim(); + for (const ext in baseMimes) { + const stored = baseMimes[ext]; + if (stored === mimeType || stored.split(";", 1)[0].trim() === baseType) { + return ext; + } + } +}; +const _baseMimes = { + aac: "audio/aac", + avi: "video/x-msvideo", + avif: "image/avif", + av1: "video/av1", + bin: "application/octet-stream", + bmp: "image/bmp", + css: "text/css; charset=utf-8", + csv: "text/csv; charset=utf-8", + eot: "application/vnd.ms-fontobject", + epub: "application/epub+zip", + gif: "image/gif", + gz: "application/gzip", + htm: "text/html; charset=utf-8", + html: "text/html; charset=utf-8", + ico: "image/x-icon", + ics: "text/calendar; charset=utf-8", + jpeg: "image/jpeg", + jpg: "image/jpeg", + js: "text/javascript; charset=utf-8", + json: "application/json", + jsonld: "application/ld+json", + map: "application/json", + mid: "audio/x-midi", + midi: "audio/x-midi", + mjs: "text/javascript; charset=utf-8", + mp3: "audio/mpeg", + mp4: "video/mp4", + mpeg: "video/mpeg", + oga: "audio/ogg", + ogv: "video/ogg", + ogx: "application/ogg", + opus: "audio/opus", + otf: "font/otf", + pdf: "application/pdf", + png: "image/png", + rtf: "application/rtf", + svg: "image/svg+xml; charset=utf-8", + tif: "image/tiff", + tiff: "image/tiff", + ts: "video/mp2t", + ttf: "font/ttf", + txt: "text/plain; charset=utf-8", + wasm: "application/wasm", + webm: "video/webm", + weba: "audio/webm", + webmanifest: "application/manifest+json", + webp: "image/webp", + woff: "font/woff", + woff2: "font/woff2", + xhtml: "application/xhtml+xml; charset=utf-8", + xml: "application/xml; charset=utf-8", + zip: "application/zip", + "3gp": "video/3gpp", + "3g2": "video/3gpp2", + gltf: "model/gltf+json", + glb: "model/gltf-binary" +}; +const baseMimes = _baseMimes; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + getExtension, + getMimeType, + mimes +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/stream.js b/tools/ui/node_modules/hono/dist/cjs/utils/stream.js new file mode 100644 index 0000000000000000000000000000000000000000..d44f24e30a82613ab689a2b090a7096f8dc6d9bc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/stream.js @@ -0,0 +1,103 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var stream_exports = {}; +__export(stream_exports, { + StreamingApi: () => StreamingApi +}); +module.exports = __toCommonJS(stream_exports); +class StreamingApi { + writer; + encoder; + writable; + abortSubscribers = []; + responseReadable; + /** + * Whether the stream has been aborted. + */ + aborted = false; + /** + * Whether the stream has been closed normally. + */ + closed = false; + constructor(writable, _readable) { + this.writable = writable; + this.writer = writable.getWriter(); + this.encoder = new TextEncoder(); + const reader = _readable.getReader(); + this.abortSubscribers.push(async () => { + await reader.cancel(); + }); + this.responseReadable = new ReadableStream({ + async pull(controller) { + const { done, value } = await reader.read(); + done ? controller.close() : controller.enqueue(value); + }, + cancel: () => { + if (!this.closed) { + this.abort(); + } + } + }); + } + async write(input) { + try { + if (typeof input === "string") { + input = this.encoder.encode(input); + } + await this.writer.write(input); + } catch { + } + return this; + } + async writeln(input) { + await this.write(input + "\n"); + return this; + } + sleep(ms) { + return new Promise((res) => setTimeout(res, ms)); + } + async close() { + this.closed = true; + try { + await this.writer.close(); + } catch { + } + } + async pipe(body) { + this.writer.releaseLock(); + await body.pipeTo(this.writable, { preventClose: true }); + this.writer = this.writable.getWriter(); + } + onAbort(listener) { + this.abortSubscribers.push(listener); + } + /** + * Abort the stream. + * You can call this method when stream is aborted by external event. + */ + abort() { + if (!this.aborted) { + this.aborted = true; + this.abortSubscribers.forEach((subscriber) => subscriber()); + } + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + StreamingApi +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/types.js b/tools/ui/node_modules/hono/dist/cjs/utils/types.js new file mode 100644 index 0000000000000000000000000000000000000000..81f4408be55bf33a4b69221862e2856a0c1dfa05 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/types.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/utils/url.js b/tools/ui/node_modules/hono/dist/cjs/utils/url.js new file mode 100644 index 0000000000000000000000000000000000000000..9ae683c47aeeb54a2c3c664636ff5f4bc462a06e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/utils/url.js @@ -0,0 +1,256 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var url_exports = {}; +__export(url_exports, { + checkOptionalParameter: () => checkOptionalParameter, + decodeURIComponent_: () => decodeURIComponent_, + getPath: () => getPath, + getPathNoStrict: () => getPathNoStrict, + getPattern: () => getPattern, + getQueryParam: () => getQueryParam, + getQueryParams: () => getQueryParams, + getQueryStrings: () => getQueryStrings, + mergePath: () => mergePath, + splitPath: () => splitPath, + splitRoutingPath: () => splitRoutingPath, + tryDecode: () => tryDecode, + tryDecodeURI: () => tryDecodeURI, + tryDecodeURIComponent: () => tryDecodeURIComponent +}); +module.exports = __toCommonJS(url_exports); +const splitPath = (path) => { + const paths = path.split("/"); + if (paths[0] === "") { + paths.shift(); + } + return paths; +}; +const splitRoutingPath = (routePath) => { + const { groups, path } = extractGroupsFromPath(routePath); + const paths = splitPath(path); + return replaceGroupMarks(paths, groups); +}; +const extractGroupsFromPath = (path) => { + const groups = []; + path = path.replace(/\{[^}]+\}/g, (match, index) => { + const mark = `@${index}`; + groups.push([mark, match]); + return mark; + }); + return { groups, path }; +}; +const replaceGroupMarks = (paths, groups) => { + for (let i = groups.length - 1; i >= 0; i--) { + const [mark] = groups[i]; + for (let j = paths.length - 1; j >= 0; j--) { + if (paths[j].includes(mark)) { + paths[j] = paths[j].replace(mark, groups[i][1]); + break; + } + } + } + return paths; +}; +const patternCache = {}; +const getPattern = (label, next) => { + if (label === "*") { + return "*"; + } + const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); + if (match) { + const cacheKey = `${label}#${next}`; + if (!patternCache[cacheKey]) { + if (match[2]) { + patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match[1], new RegExp(`^${match[2]}(?=/${next})`)] : [label, match[1], new RegExp(`^${match[2]}$`)]; + } else { + patternCache[cacheKey] = [label, match[1], true]; + } + } + return patternCache[cacheKey]; + } + return null; +}; +const tryDecode = (str, decoder) => { + try { + return decoder(str); + } catch { + return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => { + try { + return decoder(match); + } catch { + return match; + } + }); + } +}; +const tryDecodeURI = (str) => tryDecode(str, decodeURI); +const getPath = (request) => { + const url = request.url; + const start = url.indexOf("/", url.indexOf(":") + 4); + let i = start; + for (; i < url.length; i++) { + const charCode = url.charCodeAt(i); + if (charCode === 37) { + const queryIndex = url.indexOf("?", i); + const hashIndex = url.indexOf("#", i); + const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex); + const path = url.slice(start, end); + return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path); + } else if (charCode === 63 || charCode === 35) { + break; + } + } + return url.slice(start, i); +}; +const getQueryStrings = (url) => { + const queryIndex = url.indexOf("?", 8); + return queryIndex === -1 ? "" : "?" + url.slice(queryIndex + 1); +}; +const getPathNoStrict = (request) => { + const result = getPath(request); + return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result; +}; +const mergePath = (base, sub, ...rest) => { + if (rest.length) { + sub = mergePath(sub, ...rest); + } + return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`; +}; +const checkOptionalParameter = (path) => { + if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) { + return null; + } + const segments = path.split("/"); + const results = []; + let basePath = ""; + segments.forEach((segment) => { + if (segment !== "" && !/\:/.test(segment)) { + basePath += "/" + segment; + } else if (/\:/.test(segment)) { + if (/\?/.test(segment)) { + if (results.length === 0 && basePath === "") { + results.push("/"); + } else { + results.push(basePath); + } + const optionalSegment = segment.replace("?", ""); + basePath += "/" + optionalSegment; + results.push(basePath); + } else { + basePath += "/" + segment; + } + } + }); + return results.filter((v, i, a) => a.indexOf(v) === i); +}; +const tryDecodeURIComponent = (str) => str.indexOf("%") !== -1 ? tryDecode(str, decodeURIComponent_) : str; +const _decodeURI = (value) => { + if (value.indexOf("+") !== -1) { + value = value.replace(/\+/g, " "); + } + return tryDecodeURIComponent(value); +}; +const _getQueryParam = (url, key, multiple) => { + let encoded; + if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) { + let keyIndex2 = url.indexOf("?", 8); + if (keyIndex2 === -1) { + return void 0; + } + if (!url.startsWith(key, keyIndex2 + 1)) { + keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); + } + while (keyIndex2 !== -1) { + const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1); + if (trailingKeyCode === 61) { + const valueIndex = keyIndex2 + key.length + 2; + const endIndex = url.indexOf("&", valueIndex); + return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex)); + } else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) { + return ""; + } + keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); + } + encoded = /[%+]/.test(url); + if (!encoded) { + return void 0; + } + } + const results = /* @__PURE__ */ Object.create(null); + encoded ??= /[%+]/.test(url); + let keyIndex = url.indexOf("?", 8); + while (keyIndex !== -1) { + const nextKeyIndex = url.indexOf("&", keyIndex + 1); + let valueIndex = url.indexOf("=", keyIndex); + if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) { + valueIndex = -1; + } + let name = url.slice( + keyIndex + 1, + valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex + ); + if (encoded) { + name = _decodeURI(name); + } + keyIndex = nextKeyIndex; + if (name === "") { + continue; + } + let value; + if (valueIndex === -1) { + value = ""; + } else { + value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex); + if (encoded) { + value = _decodeURI(value); + } + } + if (multiple) { + if (!(results[name] && Array.isArray(results[name]))) { + results[name] = []; + } + ; + results[name].push(value); + } else { + results[name] ??= value; + } + } + return key ? results[key] : results; +}; +const getQueryParam = _getQueryParam; +const getQueryParams = (url, key) => { + return _getQueryParam(url, key, true); +}; +const decodeURIComponent_ = decodeURIComponent; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + checkOptionalParameter, + decodeURIComponent_, + getPath, + getPathNoStrict, + getPattern, + getQueryParam, + getQueryParams, + getQueryStrings, + mergePath, + splitPath, + splitRoutingPath, + tryDecode, + tryDecodeURI, + tryDecodeURIComponent +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/validator/index.js b/tools/ui/node_modules/hono/dist/cjs/validator/index.js new file mode 100644 index 0000000000000000000000000000000000000000..06c73017b4f42177493b2c2c44ce4ef56e5c1071 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/validator/index.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var validator_exports = {}; +__export(validator_exports, { + validator: () => import_validator.validator +}); +module.exports = __toCommonJS(validator_exports); +var import_validator = require("./validator"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + validator +}); diff --git a/tools/ui/node_modules/hono/dist/cjs/validator/utils.js b/tools/ui/node_modules/hono/dist/cjs/validator/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..de3c652d1de26d4bfd74f418997c8e976d071913 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/validator/utils.js @@ -0,0 +1,15 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +module.exports = __toCommonJS(utils_exports); diff --git a/tools/ui/node_modules/hono/dist/cjs/validator/validator.js b/tools/ui/node_modules/hono/dist/cjs/validator/validator.js new file mode 100644 index 0000000000000000000000000000000000000000..cdb51ba902efaaebfa10f3704ff697130c0a10f6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/cjs/validator/validator.js @@ -0,0 +1,108 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var validator_exports = {}; +__export(validator_exports, { + validator: () => validator +}); +module.exports = __toCommonJS(validator_exports); +var import_cookie = require("../helper/cookie"); +var import_http_exception = require("../http-exception"); +var import_buffer = require("../utils/buffer"); +const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i; +const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i; +const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i; +const validator = (target, validationFunc) => { + return async (c, next) => { + let value = {}; + const contentType = c.req.header("Content-Type"); + switch (target) { + case "json": + if (!contentType || !jsonRegex.test(contentType)) { + break; + } + try { + value = await c.req.json(); + } catch { + const message = "Malformed JSON in request body"; + throw new import_http_exception.HTTPException(400, { message }); + } + break; + case "form": { + if (!contentType || !(multipartRegex.test(contentType) || urlencodedRegex.test(contentType))) { + break; + } + let formData; + if (c.req.bodyCache.formData) { + formData = await c.req.bodyCache.formData; + } else { + try { + const arrayBuffer = await c.req.arrayBuffer(); + formData = await (0, import_buffer.bufferToFormData)(arrayBuffer, contentType); + c.req.bodyCache.formData = formData; + } catch (e) { + let message = "Malformed FormData request."; + message += e instanceof Error ? ` ${e.message}` : ` ${String(e)}`; + throw new import_http_exception.HTTPException(400, { message }); + } + } + const form = /* @__PURE__ */ Object.create(null); + formData.forEach((value2, key) => { + if (key.endsWith("[]")) { + ; + (form[key] ??= []).push(value2); + } else if (Array.isArray(form[key])) { + ; + form[key].push(value2); + } else if (Object.hasOwn(form, key)) { + form[key] = [form[key], value2]; + } else { + form[key] = value2; + } + }); + value = form; + break; + } + case "query": + value = Object.fromEntries( + Object.entries(c.req.queries()).map(([k, v]) => { + return v.length === 1 ? [k, v[0]] : [k, v]; + }) + ); + break; + case "param": + value = c.req.param(); + break; + case "header": + value = c.req.header(); + break; + case "cookie": + value = (0, import_cookie.getCookie)(c); + break; + } + const res = await validationFunc(value, c); + if (res instanceof Response) { + return res; + } + c.req.addValidatedData(target, res); + return await next(); + }; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + validator +}); diff --git a/tools/ui/node_modules/hono/dist/client/client.js b/tools/ui/node_modules/hono/dist/client/client.js new file mode 100644 index 0000000000000000000000000000000000000000..404e7d016d93d7e8fd592dbabef92aa2d72b628e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/client/client.js @@ -0,0 +1,189 @@ +// src/client/client.ts +import { serialize } from "../utils/cookie.js"; +import { + buildSearchParams, + deepMerge, + mergePath, + removeIndexString, + replaceUrlParam, + replaceUrlProtocol +} from "./utils.js"; +var createProxy = (callback, path) => { + const proxy = new Proxy(() => { + }, { + get(_obj, key) { + if (typeof key !== "string" || key === "then") { + return void 0; + } + return createProxy(callback, [...path, key]); + }, + apply(_1, _2, args) { + return callback({ + path, + args + }); + } + }); + return proxy; +}; +var ClientRequestImpl = class { + url; + method; + buildSearchParams; + queryParams = void 0; + pathParams = {}; + rBody; + cType = void 0; + constructor(url, method, options) { + this.url = url; + this.method = method; + this.buildSearchParams = options.buildSearchParams; + } + fetch = async (args, opt) => { + if (args) { + if (args.query) { + this.queryParams = this.buildSearchParams(args.query); + } + if (args.form) { + const form = new FormData(); + for (const [k, v] of Object.entries(args.form)) { + if (v === void 0) { + continue; + } + if (Array.isArray(v)) { + for (const v2 of v) { + form.append(k, v2); + } + } else { + form.append(k, v); + } + } + this.rBody = form; + } + if (args.json) { + this.rBody = JSON.stringify(args.json); + this.cType = "application/json"; + } + if (args.param) { + this.pathParams = args.param; + } + } + let methodUpperCase = this.method.toUpperCase(); + const headerValues = { + ...args?.header, + ...typeof opt?.headers === "function" ? await opt.headers() : opt?.headers + }; + if (args?.cookie) { + const cookies = []; + for (const [key, value] of Object.entries(args.cookie)) { + cookies.push(serialize(key, value, { path: "/" })); + } + headerValues["Cookie"] = cookies.join(","); + } + if (this.cType) { + headerValues["Content-Type"] = this.cType; + } + const headers = new Headers(headerValues ?? void 0); + let url = this.url; + url = removeIndexString(url); + url = replaceUrlParam(url, this.pathParams); + if (this.queryParams) { + url = url + "?" + this.queryParams.toString(); + } + methodUpperCase = this.method.toUpperCase(); + const setBody = !(methodUpperCase === "GET" || methodUpperCase === "HEAD"); + return (opt?.fetch || fetch)(url, { + body: setBody ? this.rBody : void 0, + method: methodUpperCase, + headers, + ...opt?.init + }); + }; +}; +var hc = (baseUrl, options) => createProxy(function proxyCallback(opts) { + const buildSearchParamsOption = options?.buildSearchParams ?? buildSearchParams; + const parts = [...opts.path]; + const lastParts = parts.slice(-3).reverse(); + if (lastParts[0] === "toString") { + if (lastParts[1] === "name") { + return lastParts[2] || ""; + } + return proxyCallback.toString(); + } + if (lastParts[0] === "valueOf") { + if (lastParts[1] === "name") { + return lastParts[2] || ""; + } + return proxyCallback; + } + let method = ""; + if (/^\$/.test(lastParts[0])) { + const last = parts.pop(); + if (last) { + method = last.replace(/^\$/, ""); + } + } + const path = parts.join("/"); + const url = mergePath(baseUrl, path); + if (method === "url" || method === "path") { + let result = url; + if (opts.args[0]) { + if (opts.args[0].param) { + result = replaceUrlParam(url, opts.args[0].param); + } + if (opts.args[0].query) { + result = result + "?" + buildSearchParamsOption(opts.args[0].query).toString(); + } + } + result = removeIndexString(result); + if (method === "url") { + return new URL(result); + } + return result.slice(baseUrl.replace(/\/+$/, "").length).replace(/^\/?/, "/"); + } + if (method === "ws") { + const webSocketUrl = replaceUrlProtocol( + opts.args[0] && opts.args[0].param ? replaceUrlParam(url, opts.args[0].param) : url, + "ws" + ); + const targetUrl = new URL(webSocketUrl); + const queryParams = opts.args[0]?.query; + if (queryParams) { + Object.entries(queryParams).forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach((item) => targetUrl.searchParams.append(key, item)); + } else { + targetUrl.searchParams.set(key, value); + } + }); + } + const establishWebSocket = (...args) => { + if (options?.webSocket !== void 0 && typeof options.webSocket === "function") { + return options.webSocket(...args); + } + return new WebSocket(...args); + }; + return establishWebSocket(targetUrl.toString()); + } + const req = new ClientRequestImpl(url, method, { + buildSearchParams: buildSearchParamsOption + }); + if (method) { + options ??= {}; + const reqOptions = { ...opts.args[1] }; + const baseHeaders = options.headers; + const reqHeaders = reqOptions.headers; + if (baseHeaders && reqHeaders) { + reqOptions.headers = async () => ({ + ...typeof baseHeaders === "function" ? await baseHeaders() : baseHeaders, + ...typeof reqHeaders === "function" ? await reqHeaders() : reqHeaders + }); + } + const args = deepMerge(options, reqOptions); + return req.fetch(opts.args[0], args); + } + return req; +}, []); +export { + hc +}; diff --git a/tools/ui/node_modules/hono/dist/client/fetch-result-please.js b/tools/ui/node_modules/hono/dist/client/fetch-result-please.js new file mode 100644 index 0000000000000000000000000000000000000000..9f7a813455b8ef59bf9280e13f0ba75ef0be3147 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/client/fetch-result-please.js @@ -0,0 +1,62 @@ +// src/client/fetch-result-please.ts +var nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]); +async function fetchRP(fetchRes) { + const _fetchRes = await fetchRes; + const hasBody = (_fetchRes.body || _fetchRes._bodyInit) && !nullBodyResponses.has(_fetchRes.status); + if (hasBody) { + const responseType = detectResponseType(_fetchRes); + _fetchRes._data = await _fetchRes[responseType](); + } + if (!_fetchRes.ok) { + throw new DetailedError(`${_fetchRes.status} ${_fetchRes.statusText}`, { + statusCode: _fetchRes?.status, + detail: { + data: _fetchRes?._data, + statusText: _fetchRes?.statusText + } + }); + } + return _fetchRes._data; +} +var DetailedError = class extends Error { + /** + * Additional `message` that will be logged AND returned to client + */ + detail; + /** + * Additional `code` that will be logged AND returned to client + */ + code; + /** + * Additional value that will be logged AND NOT returned to client + */ + log; + /** + * Optionally set the status code to return, in a web server context + */ + statusCode; + constructor(message, options = {}) { + super(message); + this.name = "DetailedError"; + this.log = options.log; + this.detail = options.detail; + this.code = options.code; + this.statusCode = options.statusCode; + } +}; +var jsonRegex = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(?:;.+)?$/i; +function detectResponseType(response) { + const _contentType = response.headers.get("content-type"); + if (!_contentType) { + return "text"; + } + const contentType = _contentType.split(";").shift(); + if (jsonRegex.test(contentType)) { + return "json"; + } + return "text"; +} +export { + DetailedError, + fetchRP +}; diff --git a/tools/ui/node_modules/hono/dist/client/index.js b/tools/ui/node_modules/hono/dist/client/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e133afaf28b3a25f0143cacae2c3c35e2c9d1a09 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/client/index.js @@ -0,0 +1,8 @@ +// src/client/index.ts +import { hc } from "./client.js"; +import { parseResponse, DetailedError } from "./utils.js"; +export { + DetailedError, + hc, + parseResponse +}; diff --git a/tools/ui/node_modules/hono/dist/client/types.js b/tools/ui/node_modules/hono/dist/client/types.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/client/utils.js b/tools/ui/node_modules/hono/dist/client/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..aa9dd5a026b5277d8052bbcc747a09cdd10ea42e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/client/utils.js @@ -0,0 +1,76 @@ +// src/client/utils.ts +import { fetchRP, DetailedError } from "./fetch-result-please.js"; +var mergePath = (base, path) => { + base = base.replace(/\/+$/, ""); + base = base + "/"; + path = path.replace(/^\/+/, ""); + return base + path; +}; +var replaceUrlParam = (urlString, params) => { + for (const [k, v] of Object.entries(params)) { + const reg = new RegExp("/:" + k + "(?:{[^/]+})?\\??(?=/|$)"); + urlString = urlString.replace(reg, v ? `/${v}` : ""); + } + return urlString; +}; +var buildSearchParams = (query) => { + const searchParams = new URLSearchParams(); + for (const [k, v] of Object.entries(query)) { + if (v === void 0) { + continue; + } + if (Array.isArray(v)) { + for (const v2 of v) { + searchParams.append(k, v2); + } + } else { + searchParams.set(k, v); + } + } + return searchParams; +}; +var replaceUrlProtocol = (urlString, protocol) => { + switch (protocol) { + case "ws": + return urlString.replace(/^http/, "ws"); + case "http": + return urlString.replace(/^ws/, "http"); + } +}; +var removeIndexString = (urlString) => { + if (/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(urlString)) { + return urlString.replace(/\/index(?=\?|$)/, "/"); + } + return urlString.replace(/\/index(?=\?|$)/, ""); +}; +function isObject(item) { + return typeof item === "object" && item !== null && !Array.isArray(item); +} +function deepMerge(target, source) { + if (!isObject(target) && !isObject(source)) { + return source; + } + const merged = { ...target }; + for (const key in source) { + const value = source[key]; + if (isObject(merged[key]) && isObject(value)) { + merged[key] = deepMerge(merged[key], value); + } else { + merged[key] = value; + } + } + return merged; +} +async function parseResponse(fetchRes) { + return fetchRP(fetchRes); +} +export { + DetailedError, + buildSearchParams, + deepMerge, + mergePath, + parseResponse, + removeIndexString, + replaceUrlParam, + replaceUrlProtocol +}; diff --git a/tools/ui/node_modules/hono/dist/compose.js b/tools/ui/node_modules/hono/dist/compose.js new file mode 100644 index 0000000000000000000000000000000000000000..8e1326fc3a3c1677c93d4eeee555600e538f835a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/compose.js @@ -0,0 +1,46 @@ +// src/compose.ts +var compose = (middleware, onError, onNotFound) => { + return (context, next) => { + let index = -1; + return dispatch(0); + async function dispatch(i) { + if (i <= index) { + throw new Error("next() called multiple times"); + } + index = i; + let res; + let isError = false; + let handler; + if (middleware[i]) { + handler = middleware[i][0][0]; + context.req.routeIndex = i; + } else { + handler = i === middleware.length && next || void 0; + } + if (handler) { + try { + res = await handler(context, () => dispatch(i + 1)); + } catch (err) { + if (err instanceof Error && onError) { + context.error = err; + res = await onError(err, context); + isError = true; + } else { + throw err; + } + } + } else { + if (context.finalized === false && onNotFound) { + res = await onNotFound(context); + } + } + if (res && (context.finalized === false || isError)) { + context.res = res; + } + return context; + } + }; +}; +export { + compose +}; diff --git a/tools/ui/node_modules/hono/dist/context.js b/tools/ui/node_modules/hono/dist/context.js new file mode 100644 index 0000000000000000000000000000000000000000..66aeb7054754623fbceba06344ad7db1cae802a5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/context.js @@ -0,0 +1,427 @@ +// src/context.ts +import { HonoRequest } from "./request.js"; +import { HtmlEscapedCallbackPhase, resolveCallback } from "./utils/html.js"; +var TEXT_PLAIN = "text/plain; charset=UTF-8"; +var setDefaultContentType = (contentType, headers) => { + return { + "Content-Type": contentType, + ...headers + }; +}; +var createResponseInstance = (body, init) => new Response(body, init); +var Context = class { + #rawRequest; + #req; + /** + * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers. + * + * @see {@link https://hono.dev/docs/api/context#env} + * + * @example + * ```ts + * // Environment object for Cloudflare Workers + * app.get('*', async c => { + * const counter = c.env.COUNTER + * }) + * ``` + */ + env = {}; + #var; + finalized = false; + /** + * `.error` can get the error object from the middleware if the Handler throws an error. + * + * @see {@link https://hono.dev/docs/api/context#error} + * + * @example + * ```ts + * app.use('*', async (c, next) => { + * await next() + * if (c.error) { + * // do something... + * } + * }) + * ``` + */ + error; + #status; + #executionCtx; + #res; + #layout; + #renderer; + #notFoundHandler; + #preparedHeaders; + #matchResult; + #path; + /** + * Creates an instance of the Context class. + * + * @param req - The Request object. + * @param options - Optional configuration options for the context. + */ + constructor(req, options) { + this.#rawRequest = req; + if (options) { + this.#executionCtx = options.executionCtx; + this.env = options.env; + this.#notFoundHandler = options.notFoundHandler; + this.#path = options.path; + this.#matchResult = options.matchResult; + } + } + /** + * `.req` is the instance of {@link HonoRequest}. + */ + get req() { + this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult); + return this.#req; + } + /** + * @see {@link https://hono.dev/docs/api/context#event} + * The FetchEvent associated with the current request. + * + * @throws Will throw an error if the context does not have a FetchEvent. + */ + get event() { + if (this.#executionCtx && "respondWith" in this.#executionCtx) { + return this.#executionCtx; + } else { + throw Error("This context has no FetchEvent"); + } + } + /** + * @see {@link https://hono.dev/docs/api/context#executionctx} + * The ExecutionContext associated with the current request. + * + * @throws Will throw an error if the context does not have an ExecutionContext. + */ + get executionCtx() { + if (this.#executionCtx) { + return this.#executionCtx; + } else { + throw Error("This context has no ExecutionContext"); + } + } + /** + * @see {@link https://hono.dev/docs/api/context#res} + * The Response object for the current request. + */ + get res() { + return this.#res ||= createResponseInstance(null, { + headers: this.#preparedHeaders ??= new Headers() + }); + } + /** + * Sets the Response object for the current request. + * + * @param _res - The Response object to set. + */ + set res(_res) { + if (this.#res && _res) { + _res = createResponseInstance(_res.body, _res); + for (const [k, v] of this.#res.headers.entries()) { + if (k === "content-type") { + continue; + } + if (k === "set-cookie") { + const cookies = this.#res.headers.getSetCookie(); + _res.headers.delete("set-cookie"); + for (const cookie of cookies) { + _res.headers.append("set-cookie", cookie); + } + } else { + _res.headers.set(k, v); + } + } + } + this.#res = _res; + this.finalized = true; + } + /** + * `.render()` can create a response within a layout. + * + * @see {@link https://hono.dev/docs/api/context#render-setrenderer} + * + * @example + * ```ts + * app.get('/', (c) => { + * return c.render('Hello!') + * }) + * ``` + */ + render = (...args) => { + this.#renderer ??= (content) => this.html(content); + return this.#renderer(...args); + }; + /** + * Sets the layout for the response. + * + * @param layout - The layout to set. + * @returns The layout function. + */ + setLayout = (layout) => this.#layout = layout; + /** + * Gets the current layout for the response. + * + * @returns The current layout function. + */ + getLayout = () => this.#layout; + /** + * `.setRenderer()` can set the layout in the custom middleware. + * + * @see {@link https://hono.dev/docs/api/context#render-setrenderer} + * + * @example + * ```tsx + * app.use('*', async (c, next) => { + * c.setRenderer((content) => { + * return c.html( + * + * + *

{content}

+ * + * + * ) + * }) + * await next() + * }) + * ``` + */ + setRenderer = (renderer) => { + this.#renderer = renderer; + }; + /** + * `.header()` can set headers. + * + * @see {@link https://hono.dev/docs/api/context#header} + * + * @example + * ```ts + * app.get('/welcome', (c) => { + * // Set headers + * c.header('X-Message', 'Hello!') + * c.header('Content-Type', 'text/plain') + * + * return c.body('Thank you for coming') + * }) + * ``` + */ + header = (name, value, options) => { + if (this.finalized) { + this.#res = createResponseInstance(this.#res.body, this.#res); + } + const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers(); + if (value === void 0) { + headers.delete(name); + } else if (options?.append) { + headers.append(name, value); + } else { + headers.set(name, value); + } + }; + status = (status) => { + this.#status = status; + }; + /** + * `.set()` can set the value specified by the key. + * + * @see {@link https://hono.dev/docs/api/context#set-get} + * + * @example + * ```ts + * app.use('*', async (c, next) => { + * c.set('message', 'Hono is hot!!') + * await next() + * }) + * ``` + */ + set = (key, value) => { + this.#var ??= /* @__PURE__ */ new Map(); + this.#var.set(key, value); + }; + /** + * `.get()` can use the value specified by the key. + * + * @see {@link https://hono.dev/docs/api/context#set-get} + * + * @example + * ```ts + * app.get('/', (c) => { + * const message = c.get('message') + * return c.text(`The message is "${message}"`) + * }) + * ``` + */ + get = (key) => { + return this.#var ? this.#var.get(key) : void 0; + }; + /** + * `.var` can access the value of a variable. + * + * @see {@link https://hono.dev/docs/api/context#var} + * + * @example + * ```ts + * const result = c.var.client.oneMethod() + * ``` + */ + // c.var.propName is a read-only + get var() { + if (!this.#var) { + return {}; + } + return Object.fromEntries(this.#var); + } + #newResponse(data, arg, headers) { + let responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders; + if (typeof arg === "object" && arg.headers) { + responseHeaders ??= new Headers(); + for (const [key, value] of new Headers(arg.headers)) { + if (key === "set-cookie") { + responseHeaders.append(key, value); + } else { + responseHeaders.set(key, value); + } + } + } + if (headers) { + if (!responseHeaders) { + let count = 0; + for (const k in headers) { + if (++count > 1 || typeof headers[k] !== "string") { + responseHeaders = new Headers(); + break; + } + } + } + if (responseHeaders) { + for (const k in headers) { + const v = headers[k]; + if (typeof v === "string") { + responseHeaders.set(k, v); + } else { + responseHeaders.delete(k); + for (const v2 of v) { + responseHeaders.append(k, v2); + } + } + } + } + } + const status = typeof arg === "number" ? arg : arg?.status ?? this.#status; + return createResponseInstance(data, { + status, + headers: responseHeaders ?? headers + }); + } + newResponse = (...args) => this.#newResponse(...args); + /** + * `.body()` can return the HTTP response. + * You can set headers with `.header()` and set HTTP status code with `.status`. + * This can also be set in `.text()`, `.json()` and so on. + * + * @see {@link https://hono.dev/docs/api/context#body} + * + * @example + * ```ts + * app.get('/welcome', (c) => { + * // Set headers + * c.header('X-Message', 'Hello!') + * c.header('Content-Type', 'text/plain') + * // Set HTTP status code + * c.status(201) + * + * // Return the response body + * return c.body('Thank you for coming') + * }) + * ``` + */ + body = (data, arg, headers) => this.#newResponse(data, arg, headers); + /** + * `.text()` can render text as `Content-Type:text/plain`. + * + * @see {@link https://hono.dev/docs/api/context#text} + * + * @example + * ```ts + * app.get('/say', (c) => { + * return c.text('Hello!') + * }) + * ``` + */ + text = (text, arg, headers) => { + return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse( + text, + arg, + setDefaultContentType(TEXT_PLAIN, headers) + ); + }; + /** + * `.json()` can render JSON as `Content-Type:application/json`. + * + * @see {@link https://hono.dev/docs/api/context#json} + * + * @example + * ```ts + * app.get('/api', (c) => { + * return c.json({ message: 'Hello!' }) + * }) + * ``` + */ + json = (object, arg, headers) => { + return this.#newResponse( + JSON.stringify(object), + arg, + setDefaultContentType("application/json", headers) + ); + }; + html = (html, arg, headers) => { + const res = (html2) => this.#newResponse(html2, arg, setDefaultContentType("text/html; charset=UTF-8", headers)); + return typeof html === "object" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html); + }; + /** + * `.redirect()` can Redirect, default status code is 302. + * + * @see {@link https://hono.dev/docs/api/context#redirect} + * + * @example + * ```ts + * app.get('/redirect', (c) => { + * return c.redirect('/') + * }) + * app.get('/redirect-permanently', (c) => { + * return c.redirect('/', 301) + * }) + * ``` + */ + redirect = (location, status) => { + const locationString = String(location); + this.header( + "Location", + // Multibyes should be encoded + // eslint-disable-next-line no-control-regex + !/[^\x00-\xFF]/.test(locationString) ? locationString : encodeURI(locationString) + ); + return this.newResponse(null, status ?? 302); + }; + /** + * `.notFound()` can return the Not Found Response. + * + * @see {@link https://hono.dev/docs/api/context#notfound} + * + * @example + * ```ts + * app.get('/notfound', (c) => { + * return c.notFound() + * }) + * ``` + */ + notFound = () => { + this.#notFoundHandler ??= () => createResponseInstance(); + return this.#notFoundHandler(this); + }; +}; +export { + Context, + TEXT_PLAIN +}; diff --git a/tools/ui/node_modules/hono/dist/helper/accepts/accepts.js b/tools/ui/node_modules/hono/dist/helper/accepts/accepts.js new file mode 100644 index 0000000000000000000000000000000000000000..fd87c4cf68b828cf115c17bcd87eca07520ef5f1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/accepts/accepts.js @@ -0,0 +1,20 @@ +// src/helper/accepts/accepts.ts +import { parseAccept } from "../../utils/accept.js"; +var defaultMatch = (accepts2, config) => { + const { supports, default: defaultSupport } = config; + const accept = accepts2.sort((a, b) => b.q - a.q).find((accept2) => supports.includes(accept2.type)); + return accept ? accept.type : defaultSupport; +}; +var accepts = (c, options) => { + const acceptHeader = c.req.header(options.header); + if (!acceptHeader) { + return options.default; + } + const accepts2 = parseAccept(acceptHeader); + const match = options.match || defaultMatch; + return match(accepts2, options); +}; +export { + accepts, + defaultMatch +}; diff --git a/tools/ui/node_modules/hono/dist/helper/accepts/index.js b/tools/ui/node_modules/hono/dist/helper/accepts/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f80f3c80e02d20f331792fbe2f6a06014aa3f42d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/accepts/index.js @@ -0,0 +1,5 @@ +// src/helper/accepts/index.ts +import { accepts } from "./accepts.js"; +export { + accepts +}; diff --git a/tools/ui/node_modules/hono/dist/helper/adapter/index.js b/tools/ui/node_modules/hono/dist/helper/adapter/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7eb7803de63c66212eb0b6c902e38419dde18232 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/adapter/index.js @@ -0,0 +1,56 @@ +// src/helper/adapter/index.ts +var env = (c, runtime) => { + const global = globalThis; + const globalEnv = global?.process?.env; + runtime ??= getRuntimeKey(); + const runtimeEnvHandlers = { + bun: () => globalEnv, + node: () => globalEnv, + "edge-light": () => globalEnv, + deno: () => { + return Deno.env.toObject(); + }, + workerd: () => c.env, + // On Fastly Compute, you can use the ConfigStore to manage user-defined data. + fastly: () => ({}), + other: () => ({}) + }; + return runtimeEnvHandlers[runtime](); +}; +var knownUserAgents = { + deno: "Deno", + bun: "Bun", + workerd: "Cloudflare-Workers", + node: "Node.js" +}; +var getRuntimeKey = () => { + const global = globalThis; + const userAgentSupported = typeof navigator !== "undefined" && typeof navigator.userAgent === "string"; + if (userAgentSupported) { + for (const [runtimeKey, userAgent] of Object.entries(knownUserAgents)) { + if (checkUserAgentEquals(userAgent)) { + return runtimeKey; + } + } + } + if (typeof global?.EdgeRuntime === "string") { + return "edge-light"; + } + if (global?.fastly !== void 0) { + return "fastly"; + } + if (global?.process?.release?.name === "node") { + return "node"; + } + return "other"; +}; +var checkUserAgentEquals = (platform) => { + const userAgent = navigator.userAgent; + return userAgent.startsWith(platform); +}; +export { + checkUserAgentEquals, + env, + getRuntimeKey, + knownUserAgents +}; diff --git a/tools/ui/node_modules/hono/dist/helper/conninfo/index.js b/tools/ui/node_modules/hono/dist/helper/conninfo/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/helper/conninfo/types.js b/tools/ui/node_modules/hono/dist/helper/conninfo/types.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/helper/cookie/index.js b/tools/ui/node_modules/hono/dist/helper/cookie/index.js new file mode 100644 index 0000000000000000000000000000000000000000..59f996837807e2b57b923393de51039af7e2a641 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/cookie/index.js @@ -0,0 +1,102 @@ +// src/helper/cookie/index.ts +import { parse, parseSigned, serialize, serializeSigned } from "../../utils/cookie.js"; +var getCookie = (c, key, prefix) => { + const cookie = c.req.raw.headers.get("Cookie"); + if (typeof key === "string") { + if (!cookie) { + return void 0; + } + let finalKey = key; + if (prefix === "secure") { + finalKey = "__Secure-" + key; + } else if (prefix === "host") { + finalKey = "__Host-" + key; + } + const obj2 = parse(cookie, finalKey); + return obj2[finalKey]; + } + if (!cookie) { + return {}; + } + const obj = parse(cookie); + return obj; +}; +var getSignedCookie = async (c, secret, key, prefix) => { + const cookie = c.req.raw.headers.get("Cookie"); + if (typeof key === "string") { + if (!cookie) { + return void 0; + } + let finalKey = key; + if (prefix === "secure") { + finalKey = "__Secure-" + key; + } else if (prefix === "host") { + finalKey = "__Host-" + key; + } + const obj2 = await parseSigned(cookie, secret, finalKey); + return obj2[finalKey]; + } + if (!cookie) { + return {}; + } + const obj = await parseSigned(cookie, secret); + return obj; +}; +var generateCookie = (name, value, opt) => { + let cookie; + if (opt?.prefix === "secure") { + cookie = serialize("__Secure-" + name, value, { path: "/", ...opt, secure: true }); + } else if (opt?.prefix === "host") { + cookie = serialize("__Host-" + name, value, { + ...opt, + path: "/", + secure: true, + domain: void 0 + }); + } else { + cookie = serialize(name, value, { path: "/", ...opt }); + } + return cookie; +}; +var setCookie = (c, name, value, opt) => { + const cookie = generateCookie(name, value, opt); + c.header("Set-Cookie", cookie, { append: true }); +}; +var generateSignedCookie = async (name, value, secret, opt) => { + let cookie; + if (opt?.prefix === "secure") { + cookie = await serializeSigned("__Secure-" + name, value, secret, { + path: "/", + ...opt, + secure: true + }); + } else if (opt?.prefix === "host") { + cookie = await serializeSigned("__Host-" + name, value, secret, { + ...opt, + path: "/", + secure: true, + domain: void 0 + }); + } else { + cookie = await serializeSigned(name, value, secret, { path: "/", ...opt }); + } + return cookie; +}; +var setSignedCookie = async (c, name, value, secret, opt) => { + const cookie = await generateSignedCookie(name, value, secret, opt); + c.header("set-cookie", cookie, { append: true }); +}; +var deleteCookie = (c, name, opt) => { + const deletedCookie = getCookie(c, name, opt?.prefix); + setCookie(c, name, "", { ...opt, maxAge: 0 }); + return deletedCookie; +}; +export { + deleteCookie, + generateCookie, + generateSignedCookie, + getCookie, + getSignedCookie, + setCookie, + setSignedCookie +}; diff --git a/tools/ui/node_modules/hono/dist/helper/css/common.js b/tools/ui/node_modules/hono/dist/helper/css/common.js new file mode 100644 index 0000000000000000000000000000000000000000..2363e5891620cfcb95885310309212024e6bd95c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/css/common.js @@ -0,0 +1,236 @@ +// src/helper/css/common.ts +var PSEUDO_GLOBAL_SELECTOR = ":-hono-global"; +var isPseudoGlobalSelectorRe = new RegExp(`^${PSEUDO_GLOBAL_SELECTOR}{(.*)}$`); +var DEFAULT_STYLE_ID = "hono-css"; +var SELECTOR = /* @__PURE__ */ Symbol(); +var CLASS_NAME = /* @__PURE__ */ Symbol(); +var STYLE_STRING = /* @__PURE__ */ Symbol(); +var SELECTORS = /* @__PURE__ */ Symbol(); +var EXTERNAL_CLASS_NAMES = /* @__PURE__ */ Symbol(); +var CSS_ESCAPED = /* @__PURE__ */ Symbol(); +var IS_CSS_ESCAPED = /* @__PURE__ */ Symbol(); +var rawCssString = (value) => { + return { + [CSS_ESCAPED]: value + }; +}; +var toHash = (str) => { + let i = 0, out = 11; + while (i < str.length) { + out = 101 * out + str.charCodeAt(i++) >>> 0; + } + return "css-" + out; +}; +var normalizeLabel = (label) => { + return label.trim().replace(/\s+/g, "-"); +}; +var isValidClassName = (name) => /^-?[_a-zA-Z][_a-zA-Z0-9-]*$/.test(name); +var hasUnsafeSelectorChar = (name) => /[<{}]/.test(name); +var RESERVED_KEYFRAME_NAMES = /* @__PURE__ */ new Set([ + "default", + "inherit", + "initial", + "none", + "revert", + "revert-layer", + "unset" +]); +var isValidKeyframeName = (name) => isValidClassName(name) && !RESERVED_KEYFRAME_NAMES.has(name.toLowerCase()); +var defaultOnInvalidSlug = (slug) => { + console.warn(`Invalid slug: ${slug}`); +}; +var cssStringReStr = [ + '"(?:(?:\\\\[\\s\\S]|[^"\\\\])*)"', + // double quoted string + "'(?:(?:\\\\[\\s\\S]|[^'\\\\])*)'" + // single quoted string +].join("|"); +var minifyCssRe = new RegExp( + [ + "(" + cssStringReStr + ")", + // $1: quoted string + "(?:" + [ + "^\\s+", + // head whitespace + "\\/\\*.*?\\*\\/\\s*", + // multi-line comment + "\\/\\/.*\\n\\s*", + // single-line comment + "\\s+$" + // tail whitespace + ].join("|") + ")", + "\\s*;\\s*(}|$)\\s*", + // $2: trailing semicolon + "\\s*([{};:,])\\s*", + // $3: whitespace around { } : , ; + "(\\s)\\s+" + // $4: 2+ spaces + ].join("|"), + "g" +); +var minify = (css) => { + return css.replace(minifyCssRe, (_, $1, $2, $3, $4) => $1 || $2 || $3 || $4 || ""); +}; +var buildStyleString = (strings, values) => { + const selectors = []; + const externalClassNames = []; + const label = strings[0].match(/^\s*\/\*(.*?)\*\//)?.[1] || ""; + let styleString = ""; + for (let i = 0, len = strings.length; i < len; i++) { + styleString += strings[i]; + let vArray = values[i]; + if (typeof vArray === "boolean" || vArray === null || vArray === void 0) { + continue; + } + if (!Array.isArray(vArray)) { + vArray = [vArray]; + } + for (let j = 0, len2 = vArray.length; j < len2; j++) { + let value = vArray[j]; + if (typeof value === "boolean" || value === null || value === void 0) { + continue; + } + if (typeof value === "string") { + if (/([\\"'\/])/.test(value)) { + styleString += value.replace(/([\\"']|(?<=<)\/)/g, "\\$1"); + } else { + styleString += value; + } + } else if (typeof value === "number") { + styleString += value; + } else if (value[CSS_ESCAPED]) { + styleString += value[CSS_ESCAPED]; + } else if (value[CLASS_NAME].startsWith("@keyframes ")) { + selectors.push(value); + styleString += ` ${value[CLASS_NAME].substring(11)} `; + } else { + if (strings[i + 1]?.match(/^\s*{/)) { + selectors.push(value); + value = `.${value[CLASS_NAME]}`; + } else { + selectors.push(...value[SELECTORS]); + externalClassNames.push(...value[EXTERNAL_CLASS_NAMES]); + value = value[STYLE_STRING]; + const valueLen = value.length; + if (valueLen > 0) { + const lastChar = value[valueLen - 1]; + if (lastChar !== ";" && lastChar !== "}") { + value += ";"; + } + } + } + styleString += `${value || ""}`; + } + } + } + return [label, minify(styleString), selectors, externalClassNames]; +}; +var cssCommon = (strings, values, classNameSlug, onInvalidSlug) => { + let [label, thisStyleString, selectors, externalClassNames] = buildStyleString(strings, values); + const isPseudoGlobal = isPseudoGlobalSelectorRe.exec(thisStyleString); + if (isPseudoGlobal) { + thisStyleString = isPseudoGlobal[1]; + } + const hash = toHash(label + thisStyleString); + let customSlug; + if (classNameSlug) { + const slug = classNameSlug(hash, normalizeLabel(label), thisStyleString); + if (slug) { + if (isValidClassName(slug)) { + customSlug = slug; + } else { + ; + (onInvalidSlug || defaultOnInvalidSlug)(slug); + } + } + } + const selector = (isPseudoGlobal ? PSEUDO_GLOBAL_SELECTOR : "") + (customSlug || hash); + const className = (isPseudoGlobal ? selectors.map((s) => s[CLASS_NAME]) : [selector, ...externalClassNames]).join(" "); + return { + [SELECTOR]: selector, + [CLASS_NAME]: className, + [STYLE_STRING]: thisStyleString, + [SELECTORS]: selectors, + [EXTERNAL_CLASS_NAMES]: externalClassNames + }; +}; +var cxCommon = (args) => { + for (let i = 0, len = args.length; i < len; i++) { + const arg = args[i]; + if (typeof arg === "string") { + args[i] = { + [SELECTOR]: "", + [CLASS_NAME]: "", + [STYLE_STRING]: "", + [SELECTORS]: [], + // drop names that are unsafe to emit as a selector + [EXTERNAL_CLASS_NAMES]: hasUnsafeSelectorChar(arg) ? [] : [arg] + }; + } + } + return args; +}; +var keyframesCommon = (strings, values, classNameSlug, onInvalidSlug) => { + const [label, styleString] = buildStyleString(strings, values); + const hash = toHash(label + styleString); + let customSlug; + if (classNameSlug) { + const slug = classNameSlug(hash, normalizeLabel(label), styleString); + if (slug) { + if (isValidKeyframeName(slug)) { + customSlug = slug; + } else { + ; + (onInvalidSlug || defaultOnInvalidSlug)(slug); + } + } + } + return { + [SELECTOR]: "", + [CLASS_NAME]: `@keyframes ${customSlug || hash}`, + [STYLE_STRING]: styleString, + [SELECTORS]: [], + [EXTERNAL_CLASS_NAMES]: [] + }; +}; +var viewTransitionNameIndex = 0; +var viewTransitionCommon = ((strings, values, classNameSlug, onInvalidSlug) => { + if (!strings) { + strings = [`/* h-v-t ${viewTransitionNameIndex++} */`]; + } + const content = Array.isArray(strings) ? cssCommon(strings, values, classNameSlug, onInvalidSlug) : strings; + const transitionName = content[CLASS_NAME]; + const res = cssCommon( + ["view-transition-name:", ""], + // eslint-disable-line @typescript-eslint/no-explicit-any + [transitionName], + classNameSlug, + onInvalidSlug + ); + content[CLASS_NAME] = PSEUDO_GLOBAL_SELECTOR + content[CLASS_NAME]; + content[STYLE_STRING] = content[STYLE_STRING].replace( + /(?<=::view-transition(?:[a-z-]*)\()(?=\))/g, + transitionName + ); + res[CLASS_NAME] = res[SELECTOR] = transitionName; + res[SELECTORS] = [...content[SELECTORS], content]; + return res; +}); +export { + CLASS_NAME, + DEFAULT_STYLE_ID, + EXTERNAL_CLASS_NAMES, + IS_CSS_ESCAPED, + PSEUDO_GLOBAL_SELECTOR, + SELECTOR, + SELECTORS, + STYLE_STRING, + buildStyleString, + cssCommon, + cxCommon, + isPseudoGlobalSelectorRe, + keyframesCommon, + minify, + rawCssString, + viewTransitionCommon +}; diff --git a/tools/ui/node_modules/hono/dist/helper/css/index.js b/tools/ui/node_modules/hono/dist/helper/css/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bc9934374529cd353198851afd3a663a12c33ed6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/css/index.js @@ -0,0 +1,140 @@ +// src/helper/css/index.ts +import { raw } from "../../helper/html/index.js"; +import { DOM_RENDERER } from "../../jsx/constants.js"; +import { createCssJsxDomObjects } from "../../jsx/dom/css.js"; +import { escapeToBuffer } from "../../utils/html.js"; +import { + CLASS_NAME, + DEFAULT_STYLE_ID, + PSEUDO_GLOBAL_SELECTOR, + SELECTOR, + SELECTORS, + STYLE_STRING, + cssCommon, + cxCommon, + keyframesCommon, + viewTransitionCommon +} from "./common.js"; +import { rawCssString } from "./common.js"; +var createCssContext = ({ + id, + classNameSlug, + onInvalidSlug +}) => { + const [cssJsxDomObject, StyleRenderToDom] = createCssJsxDomObjects({ id }); + const contextMap = /* @__PURE__ */ new WeakMap(); + const nonceMap = /* @__PURE__ */ new WeakMap(); + const replaceStyleRe = new RegExp(`()`); + const newCssClassNameObject = (cssClassName) => { + const appendStyle = ({ buffer, context }) => { + const [toAdd, added] = contextMap.get(context); + const names = Object.keys(toAdd); + if (!names.length) { + return; + } + let stylesStr = ""; + names.forEach((className2) => { + added[className2] = true; + stylesStr += className2.startsWith(PSEUDO_GLOBAL_SELECTOR) ? toAdd[className2] : `${className2[0] === "@" ? "" : "."}${className2}{${toAdd[className2]}}`; + }); + contextMap.set(context, [{}, added]); + if (buffer && replaceStyleRe.test(buffer[0])) { + buffer[0] = buffer[0].replace(replaceStyleRe, (_, pre, post) => `${pre}${stylesStr}${post}`); + return; + } + const nonce = nonceMap.get(context); + const appendStyleScript = `document.querySelector('#${id}').textContent+=${JSON.stringify(stylesStr)}`; + if (buffer) { + buffer[0] = `${appendStyleScript}${buffer[0]}`; + return; + } + return Promise.resolve(appendStyleScript); + }; + const addClassNameToContext = ({ context }) => { + if (!contextMap.has(context)) { + contextMap.set(context, [{}, {}]); + } + const [toAdd, added] = contextMap.get(context); + let allAdded = true; + if (!added[cssClassName[SELECTOR]]) { + allAdded = false; + toAdd[cssClassName[SELECTOR]] = cssClassName[STYLE_STRING]; + } + cssClassName[SELECTORS].forEach( + ({ [CLASS_NAME]: className2, [STYLE_STRING]: styleString }) => { + if (!added[className2]) { + allAdded = false; + toAdd[className2] = styleString; + } + } + ); + if (allAdded) { + return; + } + return Promise.resolve(raw("", [appendStyle])); + }; + const rawClassName = cssClassName[CLASS_NAME]; + let escapedClassName = rawClassName; + if (/[&<>'"]/.test(rawClassName)) { + const escapedBuffer = [""]; + escapeToBuffer(rawClassName, escapedBuffer); + escapedClassName = escapedBuffer[0]; + } + const className = new String(escapedClassName); + Object.assign(className, cssClassName); + className.isEscaped = true; + className.callbacks = [addClassNameToContext]; + const promise = Promise.resolve(className); + Object.assign(promise, cssClassName); + promise.toString = cssJsxDomObject.toString; + return promise; + }; + const css2 = (strings, ...values) => { + return newCssClassNameObject(cssCommon(strings, values, classNameSlug, onInvalidSlug)); + }; + const cx2 = (...args) => { + args = cxCommon(args); + return css2(Array(args.length).fill(""), ...args); + }; + const keyframes2 = (strings, ...values) => keyframesCommon(strings, values, classNameSlug, onInvalidSlug); + const viewTransition2 = ((strings, ...values) => { + return newCssClassNameObject( + viewTransitionCommon(strings, values, classNameSlug, onInvalidSlug) + // eslint-disable-line @typescript-eslint/no-explicit-any + ); + }); + const Style2 = ({ children, nonce } = {}) => raw( + ``, + [ + ({ context }) => { + nonceMap.set(context, nonce); + return void 0; + } + ] + ); + Style2[DOM_RENDERER] = StyleRenderToDom; + return { + css: css2, + cx: cx2, + keyframes: keyframes2, + viewTransition: viewTransition2, + Style: Style2 + }; +}; +var defaultContext = createCssContext({ + id: DEFAULT_STYLE_ID +}); +var css = defaultContext.css; +var cx = defaultContext.cx; +var keyframes = defaultContext.keyframes; +var viewTransition = defaultContext.viewTransition; +var Style = defaultContext.Style; +export { + Style, + createCssContext, + css, + cx, + keyframes, + rawCssString, + viewTransition +}; diff --git a/tools/ui/node_modules/hono/dist/helper/dev/index.js b/tools/ui/node_modules/hono/dist/helper/dev/index.js new file mode 100644 index 0000000000000000000000000000000000000000..98244efeba41803f2f5b2b5fc5ac27159aea9c68 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/dev/index.js @@ -0,0 +1,55 @@ +// src/helper/dev/index.ts +import { getColorEnabled } from "../../utils/color.js"; +import { findTargetHandler, isMiddleware } from "../../utils/handler.js"; +var handlerName = (handler) => { + return handler.name || (isMiddleware(handler) ? "[middleware]" : "[handler]"); +}; +var inspectRoutes = (hono) => { + return hono.routes.map(({ path, method, handler }) => { + const targetHandler = findTargetHandler(handler); + return { + path, + method, + name: handlerName(targetHandler), + isMiddleware: isMiddleware(targetHandler) + }; + }); +}; +var showRoutes = (hono, opts) => { + const colorEnabled = opts?.colorize ?? getColorEnabled(); + const routeData = {}; + let maxMethodLength = 0; + let maxPathLength = 0; + inspectRoutes(hono).filter(({ isMiddleware: isMiddleware2 }) => opts?.verbose || !isMiddleware2).map((route) => { + const key = `${route.method}-${route.path}`; + (routeData[key] ||= []).push(route); + if (routeData[key].length > 1) { + return; + } + maxMethodLength = Math.max(maxMethodLength, route.method.length); + maxPathLength = Math.max(maxPathLength, route.path.length); + return { method: route.method, path: route.path, routes: routeData[key] }; + }).forEach((data) => { + if (!data) { + return; + } + const { method, path, routes } = data; + const methodStr = colorEnabled ? `\x1B[32m${method}\x1B[0m` : method; + console.log(`${methodStr} ${" ".repeat(maxMethodLength - method.length)} ${path}`); + if (!opts?.verbose) { + return; + } + routes.forEach(({ name }) => { + console.log(`${" ".repeat(maxMethodLength + 3)} ${name}`); + }); + }); +}; +var getRouterName = (app) => { + app.router.match("GET", "/"); + return app.router.name; +}; +export { + getRouterName, + inspectRoutes, + showRoutes +}; diff --git a/tools/ui/node_modules/hono/dist/helper/factory/index.js b/tools/ui/node_modules/hono/dist/helper/factory/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6b48e91797089ead023d7e62b4a723061cf9d856 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/factory/index.js @@ -0,0 +1,30 @@ +// src/helper/factory/index.ts +import { Hono } from "../../hono.js"; +var Factory = class { + initApp; + #defaultAppOptions; + constructor(init) { + this.initApp = init?.initApp; + this.#defaultAppOptions = init?.defaultAppOptions; + } + createApp = (options) => { + const app = new Hono( + options && this.#defaultAppOptions ? { ...this.#defaultAppOptions, ...options } : options ?? this.#defaultAppOptions + ); + if (this.initApp) { + this.initApp(app); + } + return app; + }; + createMiddleware = (middleware) => middleware; + createHandlers = (...handlers) => { + return handlers.filter((handler) => handler !== void 0); + }; +}; +var createFactory = (init) => new Factory(init); +var createMiddleware = (middleware) => middleware; +export { + Factory, + createFactory, + createMiddleware +}; diff --git a/tools/ui/node_modules/hono/dist/helper/html/index.js b/tools/ui/node_modules/hono/dist/helper/html/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d5726ca22091b2d1232097dc12e19e5146e9df45 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/html/index.js @@ -0,0 +1,41 @@ +// src/helper/html/index.ts +import { escapeToBuffer, raw, resolveCallbackSync, stringBufferToString } from "../../utils/html.js"; +var html = (strings, ...values) => { + const buffer = [""]; + for (let i = 0, len = strings.length - 1; i < len; i++) { + buffer[0] += strings[i]; + const children = Array.isArray(values[i]) ? values[i].flat(Infinity) : [values[i]]; + for (let i2 = 0, len2 = children.length; i2 < len2; i2++) { + const child = children[i2]; + if (typeof child === "string") { + escapeToBuffer(child, buffer); + } else if (typeof child === "number") { + ; + buffer[0] += child; + } else if (typeof child === "boolean" || child === null || child === void 0) { + continue; + } else if (typeof child === "object" && child.isEscaped) { + if (child.callbacks) { + buffer.unshift("", child); + } else { + const tmp = child.toString(); + if (tmp instanceof Promise) { + buffer.unshift("", tmp); + } else { + buffer[0] += tmp; + } + } + } else if (child instanceof Promise) { + buffer.unshift("", child); + } else { + escapeToBuffer(child.toString(), buffer); + } + } + } + buffer[0] += strings.at(-1); + return buffer.length === 1 ? "callbacks" in buffer ? raw(resolveCallbackSync(raw(buffer[0], buffer.callbacks))) : raw(buffer[0]) : stringBufferToString(buffer, buffer.callbacks); +}; +export { + html, + raw +}; diff --git a/tools/ui/node_modules/hono/dist/helper/proxy/index.js b/tools/ui/node_modules/hono/dist/helper/proxy/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c73b51ffd3b01e3e05312209b2367266645adfdb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/proxy/index.js @@ -0,0 +1,93 @@ +// src/helper/proxy/index.ts +import { HTTPException } from "../../http-exception.js"; +var hopByHopHeaders = [ + "connection", + "keep-alive", + "proxy-authenticate", + "proxy-authorization", + "te", + "trailer", + "transfer-encoding", + "upgrade" +]; +var ALLOWED_TOKEN_PATTERN = /^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/; +var buildRequestInitFromRequest = (request, strictConnectionProcessing) => { + if (!request) { + return {}; + } + const headers = new Headers(request.headers); + if (strictConnectionProcessing) { + const connectionValue = headers.get("connection"); + if (connectionValue) { + const headerNames = connectionValue.split(",").map((h) => h.trim()); + const invalidHeaders = headerNames.filter((h) => !ALLOWED_TOKEN_PATTERN.test(h)); + if (invalidHeaders.length > 0) { + throw new HTTPException(400, { + message: `Invalid Connection header value: ${invalidHeaders.join(", ")}` + }); + } + headerNames.forEach((headerName) => { + headers.delete(headerName); + }); + } + } + hopByHopHeaders.forEach((header) => { + headers.delete(header); + }); + return { + method: request.method, + body: request.body, + duplex: request.body ? "half" : void 0, + headers, + signal: request.signal + }; +}; +var preprocessRequestInit = (requestInit) => { + if (!requestInit.headers || Array.isArray(requestInit.headers) || requestInit.headers instanceof Headers) { + return requestInit; + } + const headers = new Headers(); + for (const [key, value] of Object.entries(requestInit.headers)) { + if (value == null) { + headers.delete(key); + } else { + headers.set(key, value); + } + } + requestInit.headers = headers; + return requestInit; +}; +var proxy = async (input, proxyInit) => { + const { + raw, + customFetch, + strictConnectionProcessing = false, + ...requestInit + } = proxyInit instanceof Request ? { raw: proxyInit } : proxyInit ?? {}; + const req = new Request(input, { + ...buildRequestInitFromRequest(raw, strictConnectionProcessing), + ...preprocessRequestInit(requestInit) + }); + req.headers.delete("accept-encoding"); + const res = await (customFetch || fetch)(req); + const resHeaders = new Headers(res.headers); + const connectionValue = resHeaders.get("connection"); + if (connectionValue) { + connectionValue.split(",").map((h) => h.trim()).filter((h) => ALLOWED_TOKEN_PATTERN.test(h)).forEach((h) => resHeaders.delete(h)); + } + hopByHopHeaders.forEach((header) => { + resHeaders.delete(header); + }); + if (resHeaders.has("content-encoding")) { + resHeaders.delete("content-encoding"); + resHeaders.delete("content-length"); + } + return new Response(res.body, { + status: res.status, + statusText: res.statusText, + headers: resHeaders + }); +}; +export { + proxy +}; diff --git a/tools/ui/node_modules/hono/dist/helper/route/index.js b/tools/ui/node_modules/hono/dist/helper/route/index.js new file mode 100644 index 0000000000000000000000000000000000000000..457d362d2b09d27bbac3cc4206c417142e66f614 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/route/index.js @@ -0,0 +1,46 @@ +// src/helper/route/index.ts +import { GET_MATCH_RESULT } from "../../request/constants.js"; +import { getPattern, splitRoutingPath } from "../../utils/url.js"; +var matchedRoutes = (c) => ( + // @ts-expect-error c.req[GET_MATCH_RESULT] is not typed + c.req[GET_MATCH_RESULT][0].map(([[, route]]) => route) +); +var routePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.path ?? ""; +var baseRoutePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.basePath ?? ""; +var basePathCacheMap = /* @__PURE__ */ new WeakMap(); +var basePath = (c, index) => { + index ??= c.req.routeIndex; + const cache = basePathCacheMap.get(c) || []; + if (typeof cache[index] === "string") { + return cache[index]; + } + let result; + const rp = baseRoutePath(c, index); + if (!/[:*]/.test(rp)) { + result = rp; + } else { + const paths = splitRoutingPath(rp); + const reqPath = c.req.path; + let basePathLength = 0; + for (let i = 0, len = paths.length; i < len; i++) { + const pattern = getPattern(paths[i], paths[i + 1]); + if (pattern) { + const re = pattern[2] === true || pattern === "*" ? /[^\/]+/ : pattern[2]; + basePathLength += reqPath.substring(basePathLength + 1).match(re)?.[0].length || 0; + } else { + basePathLength += paths[i].length; + } + basePathLength += 1; + } + result = reqPath.substring(0, basePathLength); + } + cache[index] = result; + basePathCacheMap.set(c, cache); + return result; +}; +export { + basePath, + baseRoutePath, + matchedRoutes, + routePath +}; diff --git a/tools/ui/node_modules/hono/dist/helper/ssg/index.js b/tools/ui/node_modules/hono/dist/helper/ssg/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a86bed849d40f93ed1ac88340cef05514bf75c9e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/ssg/index.js @@ -0,0 +1,19 @@ +// src/helper/ssg/index.ts +export * from "./ssg.js"; +import { + X_HONO_DISABLE_SSG_HEADER_KEY, + ssgParams, + isSSGContext, + disableSSG, + onlySSG +} from "./middleware.js"; +import { defaultPlugin, redirectPlugin } from "./plugins.js"; +export { + X_HONO_DISABLE_SSG_HEADER_KEY, + defaultPlugin, + disableSSG, + isSSGContext, + onlySSG, + redirectPlugin, + ssgParams +}; diff --git a/tools/ui/node_modules/hono/dist/helper/ssg/middleware.js b/tools/ui/node_modules/hono/dist/helper/ssg/middleware.js new file mode 100644 index 0000000000000000000000000000000000000000..ddb59bd6bee2cb23bb9a54edf503f31604d69aa0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/ssg/middleware.js @@ -0,0 +1,45 @@ +// src/helper/ssg/middleware.ts +import { isDynamicRoute } from "./utils.js"; +var SSG_CONTEXT = "HONO_SSG_CONTEXT"; +var X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg"; +var SSG_DISABLED_RESPONSE = (() => { + try { + return new Response("SSG is disabled", { + status: 404, + headers: { [X_HONO_DISABLE_SSG_HEADER_KEY]: "true" } + }); + } catch { + return null; + } +})(); +var ssgParams = (params) => async (c, next) => { + if (isDynamicRoute(c.req.path)) { + ; + c.req.raw.ssgParams = Array.isArray(params) ? params : await params(c); + return c.notFound(); + } + await next(); +}; +var isSSGContext = (c) => !!c.env?.[SSG_CONTEXT]; +var disableSSG = () => async function disableSSG2(c, next) { + if (isSSGContext(c)) { + c.header(X_HONO_DISABLE_SSG_HEADER_KEY, "true"); + return c.notFound(); + } + await next(); +}; +var onlySSG = () => async function onlySSG2(c, next) { + if (!isSSGContext(c)) { + return c.notFound(); + } + await next(); +}; +export { + SSG_CONTEXT, + SSG_DISABLED_RESPONSE, + X_HONO_DISABLE_SSG_HEADER_KEY, + disableSSG, + isSSGContext, + onlySSG, + ssgParams +}; diff --git a/tools/ui/node_modules/hono/dist/helper/ssg/plugins.js b/tools/ui/node_modules/hono/dist/helper/ssg/plugins.js new file mode 100644 index 0000000000000000000000000000000000000000..9693fa36d852e4effdd12ff07448f7e54566e24e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/ssg/plugins.js @@ -0,0 +1,47 @@ +// src/helper/ssg/plugins.ts +import { html } from "../html/index.js"; +var defaultPlugin = () => { + return { + afterResponseHook: (res) => { + if (res.status !== 200) { + return false; + } + return res; + } + }; +}; +var REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]); +var generateRedirectHtml = (location) => { + const content = html` +Redirecting to: ${location} + + + + +Redirecting to ${location} + +`; + return content.toString().replace(/\n/g, ""); +}; +var redirectPlugin = () => { + return { + afterResponseHook: (res) => { + if (REDIRECT_STATUS_CODES.has(res.status)) { + const location = res.headers.get("Location"); + if (!location) { + return false; + } + const htmlBody = generateRedirectHtml(location); + return new Response(htmlBody, { + status: 200, + headers: { "Content-Type": "text/html; charset=utf-8" } + }); + } + return res; + } + }; +}; +export { + defaultPlugin, + redirectPlugin +}; diff --git a/tools/ui/node_modules/hono/dist/helper/ssg/ssg.js b/tools/ui/node_modules/hono/dist/helper/ssg/ssg.js new file mode 100644 index 0000000000000000000000000000000000000000..65ecb69913b9f16713be0453a2b5502339b4421f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/ssg/ssg.js @@ -0,0 +1,297 @@ +// src/helper/ssg/ssg.ts +import { replaceUrlParam } from "../../client/utils.js"; +import { createPool } from "../../utils/concurrent.js"; +import { getExtension } from "../../utils/mime.js"; +import { SSG_CONTEXT, X_HONO_DISABLE_SSG_HEADER_KEY } from "./middleware.js"; +import { defaultPlugin } from "./plugins.js"; +import { + dirname, + ensureWithinOutDir, + filterStaticGenerateRoutes, + isDynamicRoute, + joinPaths +} from "./utils.js"; +var DEFAULT_CONCURRENCY = 2; +var DEFAULT_CONTENT_TYPE = "text/plain"; +var DEFAULT_OUTPUT_DIR = "./static"; +var generateFilePath = (routePath, outDir, mimeType, extensionMap) => { + const extension = determineExtension(mimeType, extensionMap); + let filePath; + if (routePath.endsWith(`.${extension}`)) { + filePath = joinPaths(outDir, routePath); + } else if (routePath === "/") { + filePath = joinPaths(outDir, `index.${extension}`); + } else if (routePath.endsWith("/")) { + filePath = joinPaths(outDir, routePath, `index.${extension}`); + } else { + filePath = joinPaths(outDir, `${routePath}.${extension}`); + } + ensureWithinOutDir(outDir, filePath); + return filePath; +}; +var parseResponseContent = async (response) => { + const contentType = response.headers.get("Content-Type"); + try { + if (contentType?.includes("text") || contentType?.includes("json")) { + return await response.text(); + } else { + return await response.arrayBuffer(); + } + } catch (error) { + throw new Error( + `Error processing response: ${error instanceof Error ? error.message : "Unknown error"}` + ); + } +}; +var defaultExtensionMap = { + "text/html": "html", + "text/xml": "xml", + "application/xml": "xml", + "application/atom+xml": "xml", + "application/rss+xml": "xml", + "application/yaml": "yaml" +}; +var determineExtension = (mimeType, userExtensionMap) => { + const extensionMap = userExtensionMap || defaultExtensionMap; + if (mimeType in extensionMap) { + return extensionMap[mimeType]; + } + return getExtension(mimeType) || "html"; +}; +var combineBeforeRequestHooks = (hooks) => { + if (!Array.isArray(hooks)) { + return hooks; + } + return async (req) => { + let currentReq = req; + for (const hook of hooks) { + const result = await hook(currentReq); + if (result === false) { + return false; + } + if (result instanceof Request) { + currentReq = result; + } + } + return currentReq; + }; +}; +var combineAfterResponseHooks = (hooks) => { + if (!Array.isArray(hooks)) { + return hooks; + } + return async (res) => { + let currentRes = res; + for (const hook of hooks) { + const result = await hook(currentRes); + if (result === false) { + return false; + } + if (result instanceof Response) { + currentRes = result; + } + } + return currentRes; + }; +}; +var combineAfterGenerateHooks = (hooks, fsModule, options) => { + if (!Array.isArray(hooks)) { + return hooks; + } + return async (result) => { + for (const hook of hooks) { + await hook(result, fsModule, options); + } + }; +}; +var fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook, concurrency) { + const baseURL = "http://localhost"; + const pool = createPool({ concurrency }); + for (const route of filterStaticGenerateRoutes(app)) { + const thisRouteBaseURL = new URL(route.path, baseURL).toString(); + let forGetInfoURLRequest = new Request(thisRouteBaseURL); + yield new Promise(async (resolveGetInfo, rejectGetInfo) => { + try { + if (beforeRequestHook) { + const maybeRequest = await beforeRequestHook(forGetInfoURLRequest); + if (!maybeRequest) { + resolveGetInfo(void 0); + return; + } + forGetInfoURLRequest = maybeRequest; + } + await pool.run(() => app.fetch(forGetInfoURLRequest, { [SSG_CONTEXT]: true })); + if (!forGetInfoURLRequest.ssgParams) { + if (isDynamicRoute(route.path)) { + resolveGetInfo(void 0); + return; + } + forGetInfoURLRequest.ssgParams = [{}]; + } + const requestInit = { + method: forGetInfoURLRequest.method, + headers: forGetInfoURLRequest.headers + }; + resolveGetInfo( + (function* () { + for (const param of forGetInfoURLRequest.ssgParams) { + yield new Promise(async (resolveReq, rejectReq) => { + try { + const replacedUrlParam = replaceUrlParam(route.path, param); + let response = await pool.run( + () => app.request(replacedUrlParam, requestInit, { + [SSG_CONTEXT]: true + }) + ); + if (response.headers.get(X_HONO_DISABLE_SSG_HEADER_KEY)) { + resolveReq(void 0); + return; + } + if (afterResponseHook) { + const maybeResponse = await afterResponseHook(response); + if (!maybeResponse) { + resolveReq(void 0); + return; + } + response = maybeResponse; + } + const mimeType = response.headers.get("Content-Type")?.split(";")[0] || DEFAULT_CONTENT_TYPE; + const content = await parseResponseContent(response); + resolveReq({ + routePath: replacedUrlParam, + mimeType, + content + }); + } catch (error) { + rejectReq(error); + } + }); + } + })() + ); + } catch (error) { + rejectGetInfo(error); + } + }); + } +}; +var createdDirs = /* @__PURE__ */ new Set(); +var saveContentToFile = async (data, fsModule, outDir, extensionMap) => { + const awaitedData = await data; + if (!awaitedData) { + return; + } + const { routePath, content, mimeType } = awaitedData; + const filePath = generateFilePath(routePath, outDir, mimeType, extensionMap); + const dirPath = dirname(filePath); + if (!createdDirs.has(dirPath)) { + await fsModule.mkdir(dirPath, { recursive: true }); + createdDirs.add(dirPath); + } + if (typeof content === "string") { + await fsModule.writeFile(filePath, content); + } else if (content instanceof ArrayBuffer) { + await fsModule.writeFile(filePath, new Uint8Array(content)); + } + return filePath; +}; +var toSSG = async (app, fs, options) => { + let result; + const getInfoPromises = []; + const savePromises = []; + const plugins = options?.plugins || [defaultPlugin()]; + const beforeRequestHooks = []; + const afterResponseHooks = []; + const afterGenerateHooks = []; + if (options?.beforeRequestHook) { + beforeRequestHooks.push( + ...Array.isArray(options.beforeRequestHook) ? options.beforeRequestHook : [options.beforeRequestHook] + ); + } + if (options?.afterResponseHook) { + afterResponseHooks.push( + ...Array.isArray(options.afterResponseHook) ? options.afterResponseHook : [options.afterResponseHook] + ); + } + if (options?.afterGenerateHook) { + afterGenerateHooks.push( + ...Array.isArray(options.afterGenerateHook) ? options.afterGenerateHook : [options.afterGenerateHook] + ); + } + for (const plugin of plugins) { + if (plugin.beforeRequestHook) { + beforeRequestHooks.push( + ...Array.isArray(plugin.beforeRequestHook) ? plugin.beforeRequestHook : [plugin.beforeRequestHook] + ); + } + if (plugin.afterResponseHook) { + afterResponseHooks.push( + ...Array.isArray(plugin.afterResponseHook) ? plugin.afterResponseHook : [plugin.afterResponseHook] + ); + } + if (plugin.afterGenerateHook) { + afterGenerateHooks.push( + ...Array.isArray(plugin.afterGenerateHook) ? plugin.afterGenerateHook : [plugin.afterGenerateHook] + ); + } + } + try { + const outputDir = options?.dir ?? DEFAULT_OUTPUT_DIR; + const concurrency = options?.concurrency ?? DEFAULT_CONCURRENCY; + const combinedBeforeRequestHook = combineBeforeRequestHooks( + beforeRequestHooks.length > 0 ? beforeRequestHooks : [(req) => req] + ); + const combinedAfterResponseHook = combineAfterResponseHooks( + afterResponseHooks.length > 0 ? afterResponseHooks : [(req) => req] + ); + const getInfoGen = fetchRoutesContent( + app, + combinedBeforeRequestHook, + combinedAfterResponseHook, + concurrency + ); + for (const getInfo of getInfoGen) { + getInfoPromises.push( + getInfo.then((getContentGen) => { + if (!getContentGen) { + return; + } + for (const content of getContentGen) { + savePromises.push( + saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e) + ); + } + }) + ); + } + await Promise.all(getInfoPromises); + const files = []; + for (const savePromise of savePromises) { + const fileOrError = await savePromise; + if (typeof fileOrError === "string") { + files.push(fileOrError); + } else if (fileOrError) { + throw fileOrError; + } + } + result = { success: true, files }; + } catch (error) { + const errorObj = error instanceof Error ? error : new Error(String(error)); + result = { success: false, files: [], error: errorObj }; + } + if (afterGenerateHooks.length > 0) { + const combinedAfterGenerateHooks = combineAfterGenerateHooks(afterGenerateHooks, fs, options); + await combinedAfterGenerateHooks(result, fs, options); + } + return result; +}; +export { + DEFAULT_OUTPUT_DIR, + combineAfterGenerateHooks, + combineAfterResponseHooks, + combineBeforeRequestHooks, + defaultExtensionMap, + fetchRoutesContent, + saveContentToFile, + toSSG +}; diff --git a/tools/ui/node_modules/hono/dist/helper/ssg/utils.js b/tools/ui/node_modules/hono/dist/helper/ssg/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..0e717e9d5993e3eaf93c7ad7207691d823bb1531 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/ssg/utils.js @@ -0,0 +1,67 @@ +// src/helper/ssg/utils.ts +import { METHOD_NAME_ALL } from "../../router.js"; +import { findTargetHandler, isMiddleware } from "../../utils/handler.js"; +var dirname = (path) => { + const separatedPath = path.split(/[\/\\]/); + return separatedPath.slice(0, -1).join("/"); +}; +var normalizePath = (path) => { + return path.replace(/(\\)/g, "/").replace(/\/$/g, ""); +}; +var handleParent = (resultPaths, beforeParentFlag) => { + if (resultPaths.length === 0 || beforeParentFlag) { + resultPaths.push(".."); + } else { + resultPaths.pop(); + } +}; +var handleNonDot = (path, resultPaths) => { + path = path.replace(/^\.(?!.)/, ""); + if (path !== "") { + resultPaths.push(path); + } +}; +var handleSegments = (paths, resultPaths) => { + let beforeParentFlag = false; + for (const path of paths) { + if (path === "..") { + handleParent(resultPaths, beforeParentFlag); + beforeParentFlag = true; + } else { + handleNonDot(path, resultPaths); + beforeParentFlag = false; + } + } +}; +var joinPaths = (...paths) => { + paths = paths.map(normalizePath); + const resultPaths = []; + handleSegments(paths.join("/").split("/"), resultPaths); + return (paths[0][0] === "/" ? "/" : "") + resultPaths.join("/"); +}; +var filterStaticGenerateRoutes = (hono) => { + return hono.routes.reduce((acc, { method, handler, path }) => { + const targetHandler = findTargetHandler(handler); + if (["GET", METHOD_NAME_ALL].includes(method) && !isMiddleware(targetHandler)) { + acc.push({ path }); + } + return acc; + }, []); +}; +var isDynamicRoute = (path) => { + return path.split("/").some((segment) => segment.startsWith(":") || segment.includes("*")); +}; +var ensureWithinOutDir = (outDir, filePath) => { + const normalizedOutDir = joinPaths("/", outDir); + const normalizedFilePath = joinPaths("/", filePath); + if (normalizedFilePath !== normalizedOutDir && !normalizedFilePath.startsWith(`${normalizedOutDir}/`)) { + throw new Error(`Path traversal detected: "${filePath}" is outside the output directory`); + } +}; +export { + dirname, + ensureWithinOutDir, + filterStaticGenerateRoutes, + isDynamicRoute, + joinPaths +}; diff --git a/tools/ui/node_modules/hono/dist/helper/streaming/index.js b/tools/ui/node_modules/hono/dist/helper/streaming/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c59a2d0072387152a55ceb81eb8acb0b44e8a99a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/streaming/index.js @@ -0,0 +1,10 @@ +// src/helper/streaming/index.ts +import { stream } from "./stream.js"; +import { streamSSE, SSEStreamingApi } from "./sse.js"; +import { streamText } from "./text.js"; +export { + SSEStreamingApi, + stream, + streamSSE, + streamText +}; diff --git a/tools/ui/node_modules/hono/dist/helper/streaming/sse.js b/tools/ui/node_modules/hono/dist/helper/streaming/sse.js new file mode 100644 index 0000000000000000000000000000000000000000..2aafd9026cc05f9409745ac99a6f1d8bf4838770 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/streaming/sse.js @@ -0,0 +1,68 @@ +// src/helper/streaming/sse.ts +import { HtmlEscapedCallbackPhase, resolveCallback } from "../../utils/html.js"; +import { StreamingApi } from "../../utils/stream.js"; +import { isOldBunVersion } from "./utils.js"; +var SSEStreamingApi = class extends StreamingApi { + constructor(writable, readable) { + super(writable, readable); + } + async writeSSE(message) { + const data = await resolveCallback(message.data, HtmlEscapedCallbackPhase.Stringify, false, {}); + const dataLines = data.split(/\r\n|\r|\n/).map((line) => { + return `data: ${line}`; + }).join("\n"); + for (const key of ["event", "id"]) { + const value = message[key]; + if (value && /[\r\n]/.test(value)) { + throw new Error(`${key} must not contain "\\r" or "\\n"`); + } + } + const sseData = [ + message.event && `event: ${message.event}`, + dataLines, + message.id !== void 0 && `id: ${message.id}`, + message.retry !== void 0 && `retry: ${message.retry}` + ].filter(Boolean).join("\n") + "\n\n"; + await this.write(sseData); + } +}; +var run = async (stream, cb, onError) => { + try { + await cb(stream); + } catch (e) { + if (e instanceof Error && onError) { + await onError(e, stream); + await stream.writeSSE({ + event: "error", + data: e.message + }); + } else { + console.error(e); + } + } finally { + stream.close(); + } +}; +var contextStash = /* @__PURE__ */ new WeakMap(); +var streamSSE = (c, cb, onError) => { + const { readable, writable } = new TransformStream(); + const stream = new SSEStreamingApi(writable, readable); + if (isOldBunVersion()) { + c.req.raw.signal.addEventListener("abort", () => { + if (!stream.closed) { + stream.abort(); + } + }); + } + contextStash.set(stream.responseReadable, c); + c.header("Transfer-Encoding", "chunked"); + c.header("Content-Type", "text/event-stream"); + c.header("Cache-Control", "no-cache"); + c.header("Connection", "keep-alive"); + run(stream, cb, onError); + return c.newResponse(stream.responseReadable); +}; +export { + SSEStreamingApi, + streamSSE +}; diff --git a/tools/ui/node_modules/hono/dist/helper/streaming/stream.js b/tools/ui/node_modules/hono/dist/helper/streaming/stream.js new file mode 100644 index 0000000000000000000000000000000000000000..8a3feb45a975109a715c101f21c57eada19a0018 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/streaming/stream.js @@ -0,0 +1,34 @@ +// src/helper/streaming/stream.ts +import { StreamingApi } from "../../utils/stream.js"; +import { isOldBunVersion } from "./utils.js"; +var contextStash = /* @__PURE__ */ new WeakMap(); +var stream = (c, cb, onError) => { + const { readable, writable } = new TransformStream(); + const stream2 = new StreamingApi(writable, readable); + if (isOldBunVersion()) { + c.req.raw.signal.addEventListener("abort", () => { + if (!stream2.closed) { + stream2.abort(); + } + }); + } + contextStash.set(stream2.responseReadable, c); + (async () => { + try { + await cb(stream2); + } catch (e) { + if (e === void 0) { + } else if (e instanceof Error && onError) { + await onError(e, stream2); + } else { + console.error(e); + } + } finally { + stream2.close(); + } + })(); + return c.newResponse(stream2.responseReadable); +}; +export { + stream +}; diff --git a/tools/ui/node_modules/hono/dist/helper/streaming/text.js b/tools/ui/node_modules/hono/dist/helper/streaming/text.js new file mode 100644 index 0000000000000000000000000000000000000000..9e93cabdd4fa7760bf13df16425056c323c4019a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/streaming/text.js @@ -0,0 +1,12 @@ +// src/helper/streaming/text.ts +import { TEXT_PLAIN } from "../../context.js"; +import { stream } from "./index.js"; +var streamText = (c, cb, onError) => { + c.header("Content-Type", TEXT_PLAIN); + c.header("X-Content-Type-Options", "nosniff"); + c.header("Transfer-Encoding", "chunked"); + return stream(c, cb, onError); +}; +export { + streamText +}; diff --git a/tools/ui/node_modules/hono/dist/helper/streaming/utils.js b/tools/ui/node_modules/hono/dist/helper/streaming/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..671f4412f4e7b6fbee190bfb58683bb71f4498cc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/streaming/utils.js @@ -0,0 +1,13 @@ +// src/helper/streaming/utils.ts +var isOldBunVersion = () => { + const version = typeof Bun !== "undefined" ? Bun.version : void 0; + if (version === void 0) { + return false; + } + const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0."); + isOldBunVersion = () => result; + return result; +}; +export { + isOldBunVersion +}; diff --git a/tools/ui/node_modules/hono/dist/helper/testing/index.js b/tools/ui/node_modules/hono/dist/helper/testing/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7ba10346a18933e75a265019004de91d5bea0fac --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/testing/index.js @@ -0,0 +1,11 @@ +// src/helper/testing/index.ts +import { hc } from "../../client/index.js"; +var testClient = (app, Env, executionCtx, options) => { + const customFetch = (input, init) => { + return app.request(input, init, Env, executionCtx); + }; + return hc("http://localhost", { ...options, fetch: customFetch }); +}; +export { + testClient +}; diff --git a/tools/ui/node_modules/hono/dist/helper/websocket/index.js b/tools/ui/node_modules/hono/dist/helper/websocket/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1225415b7477b59227790e6d84e334c580c913b2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/helper/websocket/index.js @@ -0,0 +1,57 @@ +// src/helper/websocket/index.ts +var WSContext = class { + #init; + constructor(init) { + this.#init = init; + this.raw = init.raw; + this.url = init.url ? new URL(init.url) : null; + this.protocol = init.protocol ?? null; + } + send(source, options) { + this.#init.send(source, options ?? {}); + } + raw; + binaryType = "arraybuffer"; + get readyState() { + return this.#init.readyState; + } + url; + protocol; + close(code, reason) { + this.#init.close(code, reason); + } +}; +var createWSMessageEvent = (source) => { + return new MessageEvent("message", { + data: source + }); +}; +var defineWebSocketHelper = (handler) => { + return ((...args) => { + if (typeof args[0] === "function") { + const [createEvents, options] = args; + return async function upgradeWebSocket(c, next) { + const events = await createEvents(c); + const result = await handler(c, events, options); + if (result) { + return result; + } + await next(); + }; + } else { + const [c, events, options] = args; + return (async () => { + const upgraded = await handler(c, events, options); + if (!upgraded) { + throw new Error("Failed to upgrade WebSocket"); + } + return upgraded; + })(); + } + }); +}; +export { + WSContext, + createWSMessageEvent, + defineWebSocketHelper +}; diff --git a/tools/ui/node_modules/hono/dist/hono-base.js b/tools/ui/node_modules/hono/dist/hono-base.js new file mode 100644 index 0000000000000000000000000000000000000000..9cbf89d5cd50c90ddbcb681c52b7e8c4bb5a6e43 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/hono-base.js @@ -0,0 +1,384 @@ +// src/hono-base.ts +import { compose } from "./compose.js"; +import { Context } from "./context.js"; +import { METHODS, METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE } from "./router.js"; +import { COMPOSED_HANDLER } from "./utils/constants.js"; +import { getPath, getPathNoStrict, mergePath } from "./utils/url.js"; +var notFoundHandler = (c) => { + return c.text("404 Not Found", 404); +}; +var errorHandler = (err, c) => { + if ("getResponse" in err) { + const res = err.getResponse(); + return c.newResponse(res.body, res); + } + console.error(err); + return c.text("Internal Server Error", 500); +}; +var Hono = class _Hono { + get; + post; + put; + delete; + options; + patch; + query; + all; + on; + use; + /* + This class is like an abstract class and does not have a router. + To use it, inherit the class and implement router in the constructor. + */ + router; + getPath; + // Cannot use `#` because it requires visibility at JavaScript runtime. + _basePath = "/"; + #path = "/"; + routes = []; + constructor(options = {}) { + const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE]; + allMethods.forEach((method) => { + this[method] = (args1, ...args) => { + if (typeof args1 === "string") { + this.#path = args1; + } else { + this.#addRoute(method, this.#path, args1); + } + args.forEach((handler) => { + this.#addRoute(method, this.#path, handler); + }); + return this; + }; + }); + this.on = (method, path, ...handlers) => { + for (const p of [path].flat()) { + this.#path = p; + for (const m of [method].flat()) { + handlers.map((handler) => { + this.#addRoute(m.toUpperCase(), this.#path, handler); + }); + } + } + return this; + }; + this.use = (arg1, ...handlers) => { + if (typeof arg1 === "string") { + this.#path = arg1; + } else { + this.#path = "*"; + handlers.unshift(arg1); + } + handlers.forEach((handler) => { + this.#addRoute(METHOD_NAME_ALL, this.#path, handler); + }); + return this; + }; + const { strict, ...optionsWithoutStrict } = options; + Object.assign(this, optionsWithoutStrict); + this.getPath = strict ?? true ? options.getPath ?? getPath : getPathNoStrict; + } + #clone() { + const clone = new _Hono({ + router: this.router, + getPath: this.getPath + }); + clone.errorHandler = this.errorHandler; + clone.#notFoundHandler = this.#notFoundHandler; + clone.routes = this.routes; + return clone; + } + #notFoundHandler = notFoundHandler; + // Cannot use `#` because it requires visibility at JavaScript runtime. + errorHandler = errorHandler; + /** + * `.route()` allows grouping other Hono instance in routes. + * + * @see {@link https://hono.dev/docs/api/routing#grouping} + * + * @param {string} path - base Path + * @param {Hono} app - other Hono instance + * @returns {Hono} routed Hono instance + * + * @example + * ```ts + * const app = new Hono() + * const app2 = new Hono() + * + * app2.get("/user", (c) => c.text("user")) + * app.route("/api", app2) // GET /api/user + * ``` + */ + route(path, app) { + const subApp = this.basePath(path); + app.routes.map((r) => { + let handler; + if (app.errorHandler === errorHandler) { + handler = r.handler; + } else { + handler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res; + handler[COMPOSED_HANDLER] = r.handler; + } + subApp.#addRoute(r.method, r.path, handler, r.basePath); + }); + return this; + } + /** + * `.basePath()` allows base paths to be specified. + * + * @see {@link https://hono.dev/docs/api/routing#base-path} + * + * @param {string} path - base Path + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * const api = new Hono().basePath('/api') + * ``` + */ + basePath(path) { + const subApp = this.#clone(); + subApp._basePath = mergePath(this._basePath, path); + return subApp; + } + /** + * `.onError()` handles an error and returns a customized Response. + * + * @see {@link https://hono.dev/docs/api/hono#error-handling} + * + * @param {ErrorHandler} handler - request Handler for error + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * app.onError((err, c) => { + * console.error(`${err}`) + * return c.text('Custom Error Message', 500) + * }) + * ``` + */ + onError = (handler) => { + this.errorHandler = handler; + return this; + }; + /** + * `.notFound()` allows you to customize a Not Found Response. + * + * @see {@link https://hono.dev/docs/api/hono#not-found} + * + * @param {NotFoundHandler} handler - request handler for not-found + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * app.notFound((c) => { + * return c.text('Custom 404 Message', 404) + * }) + * ``` + */ + notFound = (handler) => { + this.#notFoundHandler = handler; + return this; + }; + /** + * `.mount()` allows you to mount applications built with other frameworks into your Hono application. + * + * @see {@link https://hono.dev/docs/api/hono#mount} + * + * @param {string} path - base Path + * @param {Function} applicationHandler - other Request Handler + * @param {MountOptions} [options] - options of `.mount()` + * @returns {Hono} mounted Hono instance + * + * @example + * ```ts + * import { Router as IttyRouter } from 'itty-router' + * import { Hono } from 'hono' + * // Create itty-router application + * const ittyRouter = IttyRouter() + * // GET /itty-router/hello + * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) + * + * const app = new Hono() + * app.mount('/itty-router', ittyRouter.handle) + * ``` + * + * @example + * ```ts + * const app = new Hono() + * // Send the request to another application without modification. + * app.mount('/app', anotherApp, { + * replaceRequest: (req) => req, + * }) + * ``` + */ + mount(path, applicationHandler, options) { + let replaceRequest; + let optionHandler; + if (options) { + if (typeof options === "function") { + optionHandler = options; + } else { + optionHandler = options.optionHandler; + if (options.replaceRequest === false) { + replaceRequest = (request) => request; + } else { + replaceRequest = options.replaceRequest; + } + } + } + const getOptions = optionHandler ? (c) => { + const options2 = optionHandler(c); + return Array.isArray(options2) ? options2 : [options2]; + } : (c) => { + let executionContext = void 0; + try { + executionContext = c.executionCtx; + } catch { + } + return [c.env, executionContext]; + }; + replaceRequest ||= (() => { + const mergedPath = mergePath(this._basePath, path); + const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length; + return (request) => { + const url = new URL(request.url); + url.pathname = this.getPath(request).slice(pathPrefixLength) || "/"; + return new Request(url, request); + }; + })(); + const handler = async (c, next) => { + const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c)); + if (res) { + return res; + } + await next(); + }; + this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler); + return this; + } + #addRoute(method, path, handler, baseRoutePath) { + method = method.toUpperCase(); + path = mergePath(this._basePath, path); + const r = { + basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath, + path, + method, + handler + }; + this.router.add(method, path, [handler, r]); + this.routes.push(r); + } + #handleError(err, c) { + if (err instanceof Error) { + return this.errorHandler(err, c); + } + throw err; + } + #dispatch(request, executionCtx, env, method) { + if (method === "HEAD") { + return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))(); + } + const path = this.getPath(request, { env }); + const matchResult = this.router.match(method, path); + const c = new Context(request, { + path, + matchResult, + env, + executionCtx, + notFoundHandler: this.#notFoundHandler + }); + if (matchResult[0].length === 1) { + let res; + try { + res = matchResult[0][0][0][0](c, async () => { + c.res = await this.#notFoundHandler(c); + }); + } catch (err) { + return this.#handleError(err, c); + } + return res instanceof Promise ? res.then( + (resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c)) + ).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c); + } + const composed = compose(matchResult[0], this.errorHandler, this.#notFoundHandler); + return (async () => { + try { + const context = await composed(c); + if (!context.finalized) { + throw new Error( + "Context is not finalized. Did you forget to return a Response object or `await next()`?" + ); + } + return context.res; + } catch (err) { + return this.#handleError(err, c); + } + })(); + } + /** + * `.fetch()` will be entry point of your app. + * + * @see {@link https://hono.dev/docs/api/hono#fetch} + * + * @param {Request} request - request Object of request + * @param {Env} env - env Object + * @param {ExecutionContext} executionCtx - context of execution + * @returns {Response | Promise} response of request + * + */ + fetch = (request, ...rest) => { + return this.#dispatch(request, rest[1], rest[0], request.method); + }; + /** + * `.request()` is a useful method for testing. + * You can pass a URL or pathname to send a GET request. + * app will return a Response object. + * ```ts + * test('GET /hello is ok', async () => { + * const res = await app.request('/hello') + * expect(res.status).toBe(200) + * }) + * ``` + * @see https://hono.dev/docs/api/hono#request + */ + request = (input, requestInit, Env, executionCtx) => { + if (input instanceof Request) { + return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx); + } + input = input.toString(); + return this.fetch( + new Request( + /^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`, + requestInit + ), + Env, + executionCtx + ); + }; + /** + * `.fire()` automatically adds a global fetch event listener. + * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. + * @deprecated + * Use `fire` from `hono/service-worker` instead. + * ```ts + * import { Hono } from 'hono' + * import { fire } from 'hono/service-worker' + * + * const app = new Hono() + * // ... + * fire(app) + * ``` + * @see https://hono.dev/docs/api/hono#fire + * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API + * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ + */ + fire = () => { + addEventListener("fetch", (event) => { + event.respondWith(this.#dispatch(event.request, event, void 0, event.request.method)); + }); + }; +}; +export { + Hono as HonoBase +}; diff --git a/tools/ui/node_modules/hono/dist/hono.js b/tools/ui/node_modules/hono/dist/hono.js new file mode 100644 index 0000000000000000000000000000000000000000..ff633868033d2a2bb342e483f05ee1b188647d9b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/hono.js @@ -0,0 +1,21 @@ +// src/hono.ts +import { HonoBase } from "./hono-base.js"; +import { RegExpRouter } from "./router/reg-exp-router/index.js"; +import { SmartRouter } from "./router/smart-router/index.js"; +import { TrieRouter } from "./router/trie-router/index.js"; +var Hono = class extends HonoBase { + /** + * Creates an instance of the Hono class. + * + * @param options - Optional configuration options for the Hono instance. + */ + constructor(options = {}) { + super(options); + this.router = options.router ?? new SmartRouter({ + routers: [new RegExpRouter(), new TrieRouter()] + }); + } +}; +export { + Hono +}; diff --git a/tools/ui/node_modules/hono/dist/http-exception.js b/tools/ui/node_modules/hono/dist/http-exception.js new file mode 100644 index 0000000000000000000000000000000000000000..070a51ff87907a058ad317e02b00afd46bc56eae --- /dev/null +++ b/tools/ui/node_modules/hono/dist/http-exception.js @@ -0,0 +1,35 @@ +// src/http-exception.ts +var HTTPException = class extends Error { + res; + status; + /** + * Creates an instance of `HTTPException`. + * @param status - HTTP status code for the exception. Defaults to 500. + * @param options - Additional options for the exception. + */ + constructor(status = 500, options) { + super(options?.message, { cause: options?.cause }); + this.res = options?.res; + this.status = status; + } + /** + * Returns the response object associated with the exception. + * If a response object is not provided, a new response is created with the error message and status code. + * @returns The response object. + */ + getResponse() { + if (this.res) { + const newResponse = new Response(this.res.body, { + status: this.status, + headers: this.res.headers + }); + return newResponse; + } + return new Response(this.message, { + status: this.status + }); + } +}; +export { + HTTPException +}; diff --git a/tools/ui/node_modules/hono/dist/index.js b/tools/ui/node_modules/hono/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8e8d2883b7e502c2ba1f32abf8343daefdf6b682 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/index.js @@ -0,0 +1,7 @@ +// src/index.ts +import { Hono } from "./hono.js"; +import { Context } from "./context.js"; +export { + Context, + Hono +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/base.js b/tools/ui/node_modules/hono/dist/jsx/base.js new file mode 100644 index 0000000000000000000000000000000000000000..65c44c7b659063f505cc41aafaa3becd48528f46 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/base.js @@ -0,0 +1,346 @@ +// src/jsx/base.ts +import { raw } from "../helper/html/index.js"; +import { escapeToBuffer, resolveCallbackSync, stringBufferToString } from "../utils/html.js"; +import { DOM_RENDERER, DOM_MEMO } from "./constants.js"; +import { + captureRenderContext, + createContext, + globalContexts, + runWithRenderContext, + useContext +} from "./context.js"; +import { domRenderers } from "./intrinsic-element/common.js"; +import * as intrinsicElementTags from "./intrinsic-element/components.js"; +import { + isValidAttributeName, + isValidTagName, + normalizeIntrinsicElementKey, + styleObjectForEach +} from "./utils.js"; +var nameSpaceContext = void 0; +var getNameSpaceContext = () => nameSpaceContext; +var toSVGAttributeName = (key) => /[A-Z]/.test(key) && // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. +// Or other un-deprecated kebab-case attributes. "overline-position", "paint-order", "strikethrough-position", etc. +key.match( + /^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/ +) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; +var emptyTags = [ + "area", + "base", + "br", + "col", + "embed", + "hr", + "img", + "input", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr" +]; +var booleanAttributes = [ + "allowfullscreen", + "async", + "autofocus", + "autoplay", + "checked", + "controls", + "default", + "defer", + "disabled", + "download", + "formnovalidate", + "hidden", + "inert", + "ismap", + "itemscope", + "loop", + "multiple", + "muted", + "nomodule", + "novalidate", + "open", + "playsinline", + "readonly", + "required", + "reversed", + "selected" +]; +var resolveFunctionComponentResult = (result, suspendedContext) => result.then((resolved) => { + if (!Array.isArray(resolved) && !(resolved instanceof JSXNode)) { + return resolved; + } + const children = Array.isArray(resolved) ? resolved : [resolved]; + const render = () => { + const buffer = [""]; + childrenToStringToBuffer(children, buffer); + return buffer.length === 1 ? raw(buffer[0], buffer.callbacks) : stringBufferToString(buffer, buffer.callbacks); + }; + return suspendedContext ? suspendedContext(render) : runWithRenderContext(render); +}); +var childrenToStringToBuffer = (children, buffer) => { + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if (typeof child === "string") { + escapeToBuffer(child, buffer); + } else if (typeof child === "boolean" || child === null || child === void 0) { + continue; + } else if (child instanceof JSXNode) { + child.toStringToBuffer(buffer); + } else if (typeof child === "number") { + ; + buffer[0] += child; + } else if (child.isEscaped) { + ; + buffer[0] += child; + const callbacks = child.callbacks; + if (callbacks) { + buffer.callbacks ||= []; + buffer.callbacks.push(...callbacks); + } + } else if (child instanceof Promise) { + buffer.unshift("", child); + } else { + childrenToStringToBuffer(child, buffer); + } + } +}; +var JSXNode = class { + tag; + props; + key; + children; + isEscaped = true; + constructor(tag, props, children) { + if (typeof tag !== "function" && !isValidTagName(tag)) { + throw new Error(`Invalid JSX tag name: ${tag}`); + } + this.tag = tag; + this.props = props; + this.children = children; + } + get type() { + return this.tag; + } + // Added for compatibility with libraries that rely on React's internal structure + // eslint-disable-next-line @typescript-eslint/no-explicit-any + get ref() { + return this.props.ref || null; + } + toString() { + const render = () => { + const buffer = [""]; + this.toStringToBuffer(buffer); + return buffer.length === 1 ? "callbacks" in buffer ? resolveCallbackSync(raw(buffer[0], buffer.callbacks)).toString() : buffer[0] : stringBufferToString(buffer, buffer.callbacks); + }; + return runWithRenderContext(render); + } + toStringToBuffer(buffer) { + const tag = this.tag; + const props = this.props; + let { children } = this; + buffer[0] += `<${tag}`; + const normalizeKey = tag === "svg" || nameSpaceContext && useContext(nameSpaceContext) === "svg" ? (key) => toSVGAttributeName(normalizeIntrinsicElementKey(key)) : (key) => normalizeIntrinsicElementKey(key); + for (let [key, v] of Object.entries(props)) { + key = normalizeKey(key); + if (!isValidAttributeName(key)) { + continue; + } + if (key === "children") { + } else if (key === "style" && typeof v === "object") { + let styleStr = ""; + styleObjectForEach(v, (property, value) => { + if (value != null) { + styleStr += `${styleStr ? ";" : ""}${property}:${value}`; + } + }); + buffer[0] += ' style="'; + escapeToBuffer(styleStr, buffer); + buffer[0] += '"'; + } else if (typeof v === "string") { + buffer[0] += ` ${key}="`; + escapeToBuffer(v, buffer); + buffer[0] += '"'; + } else if (v === null || v === void 0) { + } else if (typeof v === "number" || v.isEscaped) { + buffer[0] += ` ${key}="${v}"`; + } else if (typeof v === "boolean" && booleanAttributes.includes(key)) { + if (v) { + buffer[0] += ` ${key}=""`; + } + } else if (key === "dangerouslySetInnerHTML") { + if (children.length > 0) { + throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); + } + children = [raw(v.__html)]; + } else if (v instanceof Promise) { + buffer[0] += ` ${key}="`; + buffer.unshift('"', v); + } else if (typeof v === "function") { + if (!key.startsWith("on") && key !== "ref") { + throw new Error(`Invalid prop '${key}' of type 'function' supplied to '${tag}'.`); + } + } else { + buffer[0] += ` ${key}="`; + escapeToBuffer(v.toString(), buffer); + buffer[0] += '"'; + } + } + if (emptyTags.includes(tag) && children.length === 0) { + buffer[0] += "/>"; + return; + } + buffer[0] += ">"; + childrenToStringToBuffer(children, buffer); + buffer[0] += ``; + } +}; +var JSXFunctionNode = class extends JSXNode { + toStringToBuffer(buffer) { + const { children } = this; + const props = { ...this.props }; + if (children.length) { + props.children = children.length === 1 ? children[0] : children; + } + const res = this.tag.call(null, props); + if (typeof res === "boolean" || res == null) { + return; + } else if (res instanceof Promise) { + if (globalContexts.length === 0) { + buffer.unshift("", resolveFunctionComponentResult(res)); + } else { + buffer.unshift("", resolveFunctionComponentResult(res, captureRenderContext())); + } + } else if (res instanceof JSXNode) { + res.toStringToBuffer(buffer); + } else if (Array.isArray(res)) { + childrenToStringToBuffer(res, buffer); + } else if (typeof res === "number" || res.isEscaped) { + buffer[0] += res; + if (res.callbacks) { + buffer.callbacks ||= []; + buffer.callbacks.push(...res.callbacks); + } + } else { + escapeToBuffer(res, buffer); + } + } +}; +var JSXFragmentNode = class extends JSXNode { + toStringToBuffer(buffer) { + childrenToStringToBuffer(this.children, buffer); + } +}; +var jsx = (tag, props, ...children) => { + props ??= {}; + if (children.length) { + props.children = children.length === 1 ? children[0] : children; + } + const key = props.key; + delete props["key"]; + const node = jsxFn(tag, props, children); + node.key = key; + return node; +}; +var initDomRenderer = false; +var jsxFn = (tag, props, children) => { + if (!initDomRenderer) { + for (const k in domRenderers) { + ; + intrinsicElementTags[k][DOM_RENDERER] = domRenderers[k]; + } + initDomRenderer = true; + } + if (typeof tag === "function") { + return new JSXFunctionNode(tag, props, children); + } else if (intrinsicElementTags[tag]) { + return new JSXFunctionNode( + intrinsicElementTags[tag], + props, + children + ); + } else if (tag === "svg" || tag === "head") { + nameSpaceContext ||= createContext(""); + return new JSXNode(tag, props, [ + new JSXFunctionNode( + nameSpaceContext, + { + value: tag + }, + children + ) + ]); + } else { + return new JSXNode(tag, props, children); + } +}; +var shallowEqual = (a, b) => { + if (a === b) { + return true; + } + const aKeys = Object.keys(a).sort(); + const bKeys = Object.keys(b).sort(); + if (aKeys.length !== bKeys.length) { + return false; + } + for (let i = 0, len = aKeys.length; i < len; i++) { + if (aKeys[i] === "children" && bKeys[i] === "children" && !a.children?.length && !b.children?.length) { + continue; + } else if (a[aKeys[i]] !== b[aKeys[i]]) { + return false; + } + } + return true; +}; +var memo = (component, propsAreEqual = shallowEqual) => { + const wrapper = ((props) => component(props)); + wrapper[DOM_MEMO] = propsAreEqual; + wrapper[DOM_RENDERER] = component; + return wrapper; +}; +var Fragment = ({ + children +}) => { + return new JSXFragmentNode( + "", + { + children + }, + Array.isArray(children) ? children : children ? [children] : [] + ); +}; +var isValidElement = (element) => { + return !!(element && typeof element === "object" && "tag" in element && "props" in element); +}; +var cloneElement = (element, props, ...children) => { + let childrenToClone; + if (children.length > 0) { + childrenToClone = children; + } else { + const c = element.props.children; + childrenToClone = Array.isArray(c) ? c : [c]; + } + return jsx( + element.tag, + { ...element.props, ...props }, + ...childrenToClone + ); +}; +var reactAPICompatVersion = "19.0.0-hono-jsx"; +export { + Fragment, + JSXFragmentNode, + JSXNode, + booleanAttributes, + cloneElement, + getNameSpaceContext, + isValidElement, + jsx, + jsxFn, + memo, + reactAPICompatVersion, + shallowEqual +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/children.js b/tools/ui/node_modules/hono/dist/jsx/children.js new file mode 100644 index 0000000000000000000000000000000000000000..12ad951533843f50faf28a7353a84db074bee77b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/children.js @@ -0,0 +1,21 @@ +// src/jsx/children.ts +var toArray = (children) => Array.isArray(children) ? children : [children]; +var Children = { + map: (children, fn) => toArray(children).map(fn), + forEach: (children, fn) => { + toArray(children).forEach(fn); + }, + count: (children) => toArray(children).length, + only: (_children) => { + const children = toArray(_children); + if (children.length !== 1) { + throw new Error("Children.only() expects only one child"); + } + return children[0]; + }, + toArray +}; +export { + Children, + toArray +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/components.js b/tools/ui/node_modules/hono/dist/jsx/components.js new file mode 100644 index 0000000000000000000000000000000000000000..edabd532ba69ef3f719b155a23a33952b6e98a41 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/components.js @@ -0,0 +1,198 @@ +// src/jsx/components.ts +import { raw } from "../helper/html/index.js"; +import { HtmlEscapedCallbackPhase, resolveCallback } from "../utils/html.js"; +import { jsx, Fragment } from "./base.js"; +import { DOM_RENDERER } from "./constants.js"; +import { captureRenderContext, useContext } from "./context.js"; +import { ErrorBoundary as ErrorBoundaryDomRenderer } from "./dom/components.js"; +import { StreamingContext } from "./streaming.js"; +var errorBoundaryCounter = 0; +var childrenToString = async (children) => { + try { + return children.flat().map((c) => c == null || typeof c === "boolean" ? "" : c.toString()); + } catch (e) { + if (e instanceof Promise) { + const resume = captureRenderContext(); + await e; + return resume(() => childrenToString(children)); + } else { + throw e; + } + } +}; +var resolveChildEarly = (c) => { + if (c == null || typeof c === "boolean") { + return ""; + } else if (typeof c === "string") { + return c; + } else { + const str = c.toString(); + if (!(str instanceof Promise)) { + return raw(str); + } else { + return str; + } + } +}; +var ErrorBoundary = async ({ children, fallback, fallbackRender, onError }) => { + if (!children) { + return raw(""); + } + if (!Array.isArray(children)) { + children = [children]; + } + const nonce = useContext(StreamingContext)?.scriptNonce; + let resume; + const getResume = () => resume ||= captureRenderContext(); + let fallbackStrPromise; + const resolveFallbackStr = () => fallbackStrPromise ||= (async () => { + const awaitedFallback = await fallback; + if (typeof awaitedFallback === "string") { + return awaitedFallback; + } else { + const fallbackResult = await getResume()(() => awaitedFallback?.toString()); + if (typeof fallbackResult === "string") { + return raw( + fallbackResult, + fallbackResult.callbacks || awaitedFallback?.callbacks + ); + } + } + })(); + const renderFallback = async (error) => { + const fallbackStr = await resolveFallbackStr(); + return getResume()(async () => { + onError?.(error); + const fallbackRes = fallbackStr !== void 0 ? fallbackStr : fallbackRender && jsx(Fragment, {}, fallbackRender(error)) || ""; + const fallbackResString = await Fragment({ + children: fallbackRes + }).toString(); + return raw( + fallbackResString, + fallbackResString.callbacks || fallbackRes.callbacks + ); + }); + }; + let resArray = []; + try { + resArray = children.map(resolveChildEarly); + } catch (e) { + const resume2 = getResume(); + if (e instanceof Promise) { + resArray = [ + e.then(() => resume2(() => childrenToString(children))).catch((e2) => renderFallback(e2)) + ]; + } else { + resArray = [await renderFallback(e)]; + } + } + if (resArray.some((res) => res instanceof Promise)) { + getResume(); + const index = errorBoundaryCounter++; + const replaceRe = RegExp(`(.*?)(.*?)()`); + let caught = false; + const catchCallback = async ({ error: error2, buffer }) => { + if (caught) { + return ""; + } + caught = true; + const fallbackResString = await renderFallback(error2); + const fallbackCallbacks = fallbackResString.callbacks; + if (buffer) { + buffer[0] = buffer[0].replace(replaceRe, fallbackResString); + return fallbackCallbacks?.length ? raw("", fallbackCallbacks) : ""; + } + return raw( + ``, + fallbackCallbacks + ); + }; + let error; + const promiseAll = Promise.all(resArray).catch((e) => error = e); + return raw(``, [ + ({ phase, buffer, context }) => { + if (phase === HtmlEscapedCallbackPhase.BeforeStream) { + return; + } + return promiseAll.then(async (htmlArray) => { + if (error) { + throw error; + } + htmlArray = htmlArray.flat(); + const content = htmlArray.join(""); + let html = buffer ? "" : ` +((d,c) => { +c=d.currentScript.previousSibling +d=d.getElementById('E:${index}') +if(!d)return +d.parentElement.insertBefore(c.content,d.nextSibling) +})(document) +`; + if (htmlArray.every((html2) => !html2.callbacks?.length)) { + if (buffer) { + buffer[0] = buffer[0].replace(replaceRe, content); + } + return html; + } + if (buffer) { + buffer[0] = buffer[0].replace( + replaceRe, + (_all, pre, _, post) => `${pre}${content}${post}` + ); + } + const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); + if (phase === HtmlEscapedCallbackPhase.Stream) { + html = await resolveCallback( + html, + HtmlEscapedCallbackPhase.BeforeStream, + true, + context + ); + } + let resolvedCount = 0; + const promises = callbacks.map( + (c) => (...args) => c(...args)?.then((content2) => { + resolvedCount++; + if (buffer) { + if (resolvedCount === callbacks.length) { + buffer[0] = buffer[0].replace(replaceRe, (_all, _pre, content3) => content3); + } + buffer[0] += content2; + return raw("", content2.callbacks); + } + return raw( + content2 + (resolvedCount !== callbacks.length ? "" : ``), + content2.callbacks + ); + }).catch((error2) => catchCallback({ error: error2, buffer })) + ); + return raw(html, promises); + }).catch((error2) => catchCallback({ error: error2, buffer })); + } + ]); + } else { + return Fragment({ children: resArray }); + } +}; +ErrorBoundary[DOM_RENDERER] = ErrorBoundaryDomRenderer; +export { + ErrorBoundary, + childrenToString +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/constants.js b/tools/ui/node_modules/hono/dist/jsx/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..872b4bb77cae54ea80c1b721e74333a7be9e981a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/constants.js @@ -0,0 +1,15 @@ +// src/jsx/constants.ts +var DOM_RENDERER = /* @__PURE__ */ Symbol("RENDERER"); +var DOM_ERROR_HANDLER = /* @__PURE__ */ Symbol("ERROR_HANDLER"); +var DOM_STASH = /* @__PURE__ */ Symbol("STASH"); +var DOM_INTERNAL_TAG = /* @__PURE__ */ Symbol("INTERNAL"); +var DOM_MEMO = /* @__PURE__ */ Symbol("MEMO"); +var PERMALINK = /* @__PURE__ */ Symbol("PERMALINK"); +export { + DOM_ERROR_HANDLER, + DOM_INTERNAL_TAG, + DOM_MEMO, + DOM_RENDERER, + DOM_STASH, + PERMALINK +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/context.js b/tools/ui/node_modules/hono/dist/jsx/context.js new file mode 100644 index 0000000000000000000000000000000000000000..fbf4c5414cf81bf4aceefdaebadfff35195bde64 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/context.js @@ -0,0 +1,162 @@ +// src/jsx/context.ts +import { raw } from "../helper/html/index.js"; +import { JSXFragmentNode } from "./base.js"; +import { DOM_RENDERER } from "./constants.js"; +import { createContextProviderFunction } from "./dom/context.js"; +var globalContexts = []; +var alsProbed = false; +var asyncLocalStorage; +var fallbackStore; +var fallbackRendersInFlight = 0; +var warnedFallbackDefault = false; +var loadAsyncLocalStorage = () => { + if (alsProbed) { + return asyncLocalStorage; + } + alsProbed = true; + const global = globalThis; + let AsyncLocalStorage; + for (const probe of [ + // Node.js >= 20.16, Deno, Bun, Cloudflare Workers (nodejs_compat). Property + // access only, so bundlers don't statically resolve `node:async_hooks`. + () => global.process?.getBuiltinModule?.("node:async_hooks")?.AsyncLocalStorage, + // Node.js < 20.16 has no `process.getBuiltinModule`, but a CJS entrypoint + // exposes the main module's `require` here. + () => global.process?.mainModule?.require?.("node:async_hooks")?.AsyncLocalStorage + ]) { + try { + AsyncLocalStorage = probe(); + } catch { + } + if (AsyncLocalStorage) { + break; + } + } + if (AsyncLocalStorage) { + asyncLocalStorage = new AsyncLocalStorage(); + } + return asyncLocalStorage; +}; +var getCurrentStore = () => { + return loadAsyncLocalStorage()?.getStore() || fallbackStore; +}; +var warnIfStorelessAccess = () => { + if (fallbackRendersInFlight > 0 && !warnedFallbackDefault) { + warnedFallbackDefault = true; + console.warn( + "hono/jsx: AsyncLocalStorage is unavailable in this runtime, so useContext() after an await in an async component falls back to the context default value during server-side rendering. To get provided values across await boundaries, use a runtime with AsyncLocalStorage (Node.js >= 20.16, Deno, Bun, or Cloudflare Workers with the nodejs_compat flag)." + ); + } +}; +var getContextValuesIn = (store, context) => { + if (!store) { + warnIfStorelessAccess(); + return context.values; + } + let values = store.get(context); + if (!values) { + values = [context.values[0]]; + store.set(context, values); + } + return values; +}; +var readContextValueIn = (store, context) => { + if (!store) { + warnIfStorelessAccess(); + return context.values.at(-1); + } + const values = store.get(context); + return values?.length ? values.at(-1) : context.values[0]; +}; +var captureContextValues = (store) => (store ? globalContexts.filter((c) => store.has(c)) : globalContexts).map((c) => [ + c, + readContextValueIn(store, c) +]); +var resumeWithContextValues = (callback, store, contexts) => runWithRenderContext(() => { + const currentStore = getCurrentStore(); + const valuesPerContext = contexts.map(([context, value]) => { + const values = getContextValuesIn(currentStore, context); + values.push(value); + return values; + }); + const popContextValues = () => { + valuesPerContext.forEach((values) => { + values.pop(); + }); + }; + try { + const result = callback(); + if (result instanceof Promise) { + return result.finally(popContextValues); + } + popContextValues(); + return result; + } catch (e) { + popContextValues(); + throw e; + } +}, store); +var runWithRenderContext = (callback, resumeStore) => { + if (getCurrentStore()) { + return callback(); + } + const store = resumeStore ?? /* @__PURE__ */ new WeakMap(); + const storage = loadAsyncLocalStorage(); + if (storage) { + return storage.run(store, callback); + } + fallbackStore = store; + let result; + try { + result = callback(); + } finally { + fallbackStore = void 0; + } + if (!warnedFallbackDefault && result instanceof Promise) { + fallbackRendersInFlight++; + result = result.finally(() => { + fallbackRendersInFlight--; + }); + } + return result; +}; +var captureRenderContext = () => { + const store = getCurrentStore(); + const contexts = captureContextValues(store); + return (callback) => resumeWithContextValues(callback, store, contexts); +}; +var createContext = (defaultValue) => { + const values = [defaultValue]; + const context = ((props) => { + const contextValues = getContextValuesIn(getCurrentStore(), context); + contextValues.push(props.value); + let string; + try { + string = props.children ? (Array.isArray(props.children) ? new JSXFragmentNode("", {}, props.children) : props.children).toString() : ""; + } catch (e) { + contextValues.pop(); + throw e; + } + if (string instanceof Promise) { + return string.finally(() => contextValues.pop()).then((resString) => raw(resString, resString.callbacks)); + } else { + contextValues.pop(); + return raw(string); + } + }); + context.values = values; + context.Provider = context; + context[DOM_RENDERER] = createContextProviderFunction(values); + globalContexts.push(context); + return context; +}; +var useContext = (context) => { + return readContextValueIn(getCurrentStore(), context); +}; +export { + captureRenderContext, + createContext, + globalContexts, + runWithRenderContext, + useContext +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/client.js b/tools/ui/node_modules/hono/dist/jsx/dom/client.js new file mode 100644 index 0000000000000000000000000000000000000000..4338249aa650c76bb29db9db9dafd152240b804c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/client.js @@ -0,0 +1,53 @@ +// src/jsx/dom/client.ts +import { useState } from "../hooks/index.js"; +import { buildNode, renderNode } from "./render.js"; +var createRoot = (element, options = {}) => { + let setJsxNode = ( + // unmounted + void 0 + ); + if (Object.keys(options).length > 0) { + console.warn("createRoot options are not supported yet"); + } + return { + render(jsxNode) { + if (setJsxNode === null) { + throw new Error("Cannot update an unmounted root"); + } + if (setJsxNode) { + setJsxNode(jsxNode); + } else { + renderNode( + buildNode({ + tag: () => { + const [_jsxNode, _setJsxNode] = useState(jsxNode); + setJsxNode = _setJsxNode; + return _jsxNode; + }, + props: {} + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }), + element + ); + } + }, + unmount() { + setJsxNode?.(null); + setJsxNode = null; + } + }; +}; +var hydrateRoot = (element, reactNode, options = {}) => { + const root = createRoot(element, options); + root.render(reactNode); + return root; +}; +var client_default = { + createRoot, + hydrateRoot +}; +export { + createRoot, + client_default as default, + hydrateRoot +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/components.js b/tools/ui/node_modules/hono/dist/jsx/dom/components.js new file mode 100644 index 0000000000000000000000000000000000000000..ad120be9bbb7e5419d605f64bebfab126553088a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/components.js @@ -0,0 +1,32 @@ +// src/jsx/dom/components.ts +import { DOM_ERROR_HANDLER } from "../constants.js"; +import { Fragment } from "./jsx-runtime.js"; +var ErrorBoundary = (({ children, fallback, fallbackRender, onError }) => { + const res = Fragment({ children }); + res[DOM_ERROR_HANDLER] = (err) => { + if (err instanceof Promise) { + throw err; + } + onError?.(err); + return fallbackRender?.(err) || fallback; + }; + return res; +}); +var Suspense = (({ + children, + fallback +}) => { + const res = Fragment({ children }); + res[DOM_ERROR_HANDLER] = (err, retry) => { + if (!(err instanceof Promise)) { + throw err; + } + err.finally(retry); + return fallback; + }; + return res; +}); +export { + ErrorBoundary, + Suspense +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/context.js b/tools/ui/node_modules/hono/dist/jsx/dom/context.js new file mode 100644 index 0000000000000000000000000000000000000000..5bc71a7ae83373150cf530caf08858ff2fb0a2e4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/context.js @@ -0,0 +1,48 @@ +// src/jsx/dom/context.ts +import { DOM_ERROR_HANDLER } from "../constants.js"; +import { globalContexts } from "../context.js"; +import { setInternalTagFlag } from "./utils.js"; +var createContextProviderFunction = (values) => ({ value, children }) => { + if (!children) { + return void 0; + } + const props = { + children: [ + { + tag: setInternalTagFlag(() => { + values.push(value); + }), + props: {} + } + ] + }; + if (Array.isArray(children)) { + props.children.push(...children.flat()); + } else { + props.children.push(children); + } + props.children.push({ + tag: setInternalTagFlag(() => { + values.pop(); + }), + props: {} + }); + const res = { tag: "", props, type: "" }; + res[DOM_ERROR_HANDLER] = (err) => { + values.pop(); + throw err; + }; + return res; +}; +var createContext = (defaultValue) => { + const values = [defaultValue]; + const context = createContextProviderFunction(values); + context.values = values; + context.Provider = context; + globalContexts.push(context); + return context; +}; +export { + createContext, + createContextProviderFunction +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/css.js b/tools/ui/node_modules/hono/dist/jsx/dom/css.js new file mode 100644 index 0000000000000000000000000000000000000000..fddecbc609da2a85f5e2319605fe134c7a3798ee --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/css.js @@ -0,0 +1,150 @@ +// src/jsx/dom/css.ts +import { + CLASS_NAME, + DEFAULT_STYLE_ID, + PSEUDO_GLOBAL_SELECTOR, + SELECTOR, + SELECTORS, + STYLE_STRING, + cssCommon, + cxCommon, + keyframesCommon, + viewTransitionCommon +} from "../../helper/css/common.js"; +import { rawCssString } from "../../helper/css/common.js"; +var splitRule = (rule) => { + const result = []; + let startPos = 0; + let depth = 0; + for (let i = 0, len = rule.length; i < len; i++) { + const char = rule[i]; + if (char === "'" || char === '"') { + const quote = char; + i++; + for (; i < len; i++) { + if (rule[i] === "\\") { + i++; + continue; + } + if (rule[i] === quote) { + break; + } + } + continue; + } + if (char === "{") { + depth++; + continue; + } + if (char === "}") { + depth--; + if (depth === 0) { + result.push(rule.slice(startPos, i + 1)); + startPos = i + 1; + } + continue; + } + } + return result; +}; +var createCssJsxDomObjects = ({ id }) => { + let styleSheet = void 0; + const findStyleSheet = () => { + if (!styleSheet) { + styleSheet = document.querySelector(`style#${id}`)?.sheet; + if (styleSheet) { + ; + styleSheet.addedStyles = /* @__PURE__ */ new Set(); + } + } + return styleSheet ? [styleSheet, styleSheet.addedStyles] : []; + }; + const insertRule = (className, styleString) => { + const [sheet, addedStyles] = findStyleSheet(); + if (!sheet || !addedStyles) { + Promise.resolve().then(() => { + if (!findStyleSheet()[0]) { + throw new Error("style sheet not found"); + } + insertRule(className, styleString); + }); + return; + } + if (!addedStyles.has(className)) { + addedStyles.add(className); + (className.startsWith(PSEUDO_GLOBAL_SELECTOR) ? splitRule(styleString) : [`${className[0] === "@" ? "" : "."}${className}{${styleString}}`]).forEach((rule) => { + sheet.insertRule(rule, sheet.cssRules.length); + }); + } + }; + const cssObject = { + toString() { + const selector = this[SELECTOR]; + insertRule(selector, this[STYLE_STRING]); + this[SELECTORS].forEach(({ [CLASS_NAME]: className, [STYLE_STRING]: styleString }) => { + insertRule(className, styleString); + }); + return this[CLASS_NAME]; + } + }; + const Style2 = ({ children, nonce }) => ({ + tag: "style", + props: { + id, + nonce, + children: children && (Array.isArray(children) ? children : [children]).map( + (c) => c[STYLE_STRING] + ) + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }); + return [cssObject, Style2]; +}; +var createCssContext = ({ + id, + classNameSlug, + onInvalidSlug +}) => { + const [cssObject, Style2] = createCssJsxDomObjects({ id }); + const newCssClassNameObject = (cssClassName) => { + cssClassName.toString = cssObject.toString; + return cssClassName; + }; + const css2 = (strings, ...values) => { + return newCssClassNameObject(cssCommon(strings, values, classNameSlug, onInvalidSlug)); + }; + const cx2 = (...args) => { + args = cxCommon(args); + return css2(Array(args.length).fill(""), ...args); + }; + const keyframes2 = (strings, ...values) => keyframesCommon(strings, values, classNameSlug, onInvalidSlug); + const viewTransition2 = ((strings, ...values) => { + return newCssClassNameObject( + viewTransitionCommon(strings, values, classNameSlug, onInvalidSlug) + // eslint-disable-line @typescript-eslint/no-explicit-any + ); + }); + return { + css: css2, + cx: cx2, + keyframes: keyframes2, + viewTransition: viewTransition2, + Style: Style2 + }; +}; +var defaultContext = createCssContext({ id: DEFAULT_STYLE_ID }); +var css = defaultContext.css; +var cx = defaultContext.cx; +var keyframes = defaultContext.keyframes; +var viewTransition = defaultContext.viewTransition; +var Style = defaultContext.Style; +export { + Style, + createCssContext, + createCssJsxDomObjects, + css, + cx, + keyframes, + rawCssString, + viewTransition +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/hooks/index.js b/tools/ui/node_modules/hono/dist/jsx/dom/hooks/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5eed9827dd3dbc43a71e7e50f99c7a765223616a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/hooks/index.js @@ -0,0 +1,48 @@ +// src/jsx/dom/hooks/index.ts +import { PERMALINK } from "../../constants.js"; +import { useContext } from "../../context.js"; +import { useCallback, useState } from "../../hooks/index.js"; +import { createContext } from "../context.js"; +var FormContext = createContext({ + pending: false, + data: null, + method: null, + action: null +}); +var actions = /* @__PURE__ */ new Set(); +var registerAction = (action) => { + actions.add(action); + action.finally(() => actions.delete(action)); +}; +var useFormStatus = () => { + return useContext(FormContext); +}; +var useOptimistic = (state, updateState) => { + const [optimisticState, setOptimisticState] = useState(state); + if (actions.size > 0) { + Promise.all(actions).finally(() => { + setOptimisticState(state); + }); + } else { + setOptimisticState(state); + } + const cb = useCallback((newData) => { + setOptimisticState((currentState) => updateState(currentState, newData)); + }, []); + return [optimisticState, cb]; +}; +var useActionState = (fn, initialState, permalink) => { + const [state, setState] = useState(initialState); + const actionState = async (data) => { + setState(await fn(state, data)); + }; + actionState[PERMALINK] = permalink; + return [state, actionState]; +}; +export { + FormContext, + registerAction, + useActionState, + useFormStatus, + useOptimistic +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/index.js b/tools/ui/node_modules/hono/dist/jsx/dom/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4e5fbd33ceb99884da9cc4d8d0e5124fcc7b5d94 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/index.js @@ -0,0 +1,142 @@ +// src/jsx/dom/index.ts +import { isValidElement, reactAPICompatVersion, shallowEqual } from "../base.js"; +import { Children } from "../children.js"; +import { DOM_MEMO } from "../constants.js"; +import { useContext } from "../context.js"; +import { + createRef, + forwardRef, + startTransition, + startViewTransition, + use, + useCallback, + useDebugValue, + useDeferredValue, + useEffect, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition +} from "../hooks/index.js"; +import { ErrorBoundary, Suspense } from "./components.js"; +import { createContext } from "./context.js"; +import { useActionState, useFormStatus, useOptimistic } from "./hooks/index.js"; +import { Fragment, jsx } from "./jsx-runtime.js"; +import { createPortal, flushSync } from "./render.js"; +import { render } from "./render.js"; +var createElement = (tag, props, ...children) => { + const jsxProps = props ? { ...props } : {}; + if (children.length) { + jsxProps.children = children.length === 1 ? children[0] : children; + } + let key = void 0; + if ("key" in jsxProps) { + key = jsxProps.key; + delete jsxProps.key; + } + return jsx(tag, jsxProps, key); +}; +var cloneElement = (element, props, ...children) => { + return jsx( + element.tag, + { + ...element.props, + ...props, + children: children.length ? children : element.props.children + }, + element.key + ); +}; +var memo = (component, propsAreEqual = shallowEqual) => { + const wrapper = ((props) => component(props)); + wrapper[DOM_MEMO] = propsAreEqual; + return wrapper; +}; +var dom_default = { + version: reactAPICompatVersion, + useState, + useEffect, + useRef, + useCallback, + use, + startTransition, + useTransition, + useDeferredValue, + startViewTransition, + useViewTransition, + useMemo, + useLayoutEffect, + useInsertionEffect, + useReducer, + useId, + useDebugValue, + createRef, + forwardRef, + useImperativeHandle, + useSyncExternalStore, + useFormStatus, + useActionState, + useOptimistic, + Suspense, + ErrorBoundary, + createContext, + useContext, + memo, + isValidElement, + createElement, + cloneElement, + Children, + Fragment, + StrictMode: Fragment, + flushSync, + createPortal +}; +export { + Children, + ErrorBoundary, + Fragment, + Fragment as StrictMode, + Suspense, + cloneElement, + createContext, + createElement, + createPortal, + createRef, + dom_default as default, + flushSync, + forwardRef, + isValidElement, + createElement as jsx, + memo, + render, + startTransition, + startViewTransition, + use, + useActionState, + useCallback, + useContext, + useDebugValue, + useDeferredValue, + useEffect, + useFormStatus, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useOptimistic, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition, + reactAPICompatVersion as version +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js b/tools/ui/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js new file mode 100644 index 0000000000000000000000000000000000000000..61dbb05120e3536f9d9eef7c658b26d2610e334c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js @@ -0,0 +1,374 @@ +// src/jsx/dom/intrinsic-element/components.ts +import { useContext } from "../../context.js"; +import { use, useCallback, useMemo, useState } from "../../hooks/index.js"; +import { + dataPrecedenceAttr, + deDupeKeyMap, + domRenderers, + isStylesheetLinkWithPrecedence, + shouldDeDupeByKey +} from "../../intrinsic-element/common.js"; +import { FormContext, registerAction } from "../hooks/index.js"; +import { createPortal, getNameSpaceContext } from "../render.js"; +var clearCache = () => { + blockingPromiseMap = /* @__PURE__ */ Object.create(null); + createdElements = /* @__PURE__ */ Object.create(null); +}; +var composeRef = (ref, cb) => { + return useMemo( + () => (e) => { + let refCleanup; + if (ref) { + if (typeof ref === "function") { + refCleanup = ref(e) || (() => { + ref(null); + }); + } else if (ref && "current" in ref) { + ref.current = e; + refCleanup = () => { + ref.current = null; + }; + } + } + const cbCleanup = cb(e); + return () => { + cbCleanup?.(); + refCleanup?.(); + }; + }, + [ref] + ); +}; +var blockingPromiseMap = /* @__PURE__ */ Object.create(null); +var createdElements = /* @__PURE__ */ Object.create(null); +var documentMetadataTag = (tag, props, preserveNodeType, supportSort, supportBlocking) => { + if (props?.itemProp) { + return { + tag, + props, + type: tag, + ref: props.ref + }; + } + const head = document.head; + let { onLoad, onError, precedence, blocking, ...restProps } = props; + let element = null; + let created = false; + const deDupeKeys = deDupeKeyMap[tag]; + const deDupeByKey = shouldDeDupeByKey(tag, supportSort); + const isDeDupeCandidateLink = (e) => e.getAttribute("rel") === "stylesheet" && e.getAttribute(dataPrecedenceAttr) !== null; + let existingElements = void 0; + if (deDupeByKey) { + const tags = head.querySelectorAll(tag); + LOOP: for (const e of tags) { + if (tag === "link" && !isDeDupeCandidateLink(e)) { + continue; + } + for (const key of deDupeKeys) { + if (e.getAttribute(key) === props[key]) { + element = e; + break LOOP; + } + } + } + if (!element) { + const cacheKey = deDupeKeys.reduce( + (acc, key) => props[key] === void 0 ? acc : `${acc}-${key}-${props[key]}`, + tag + ); + created = !createdElements[cacheKey]; + element = createdElements[cacheKey] ||= (() => { + const e = document.createElement(tag); + for (const key of deDupeKeys) { + if (props[key] !== void 0) { + e.setAttribute(key, props[key]); + } + } + if (props.rel) { + e.setAttribute("rel", props.rel); + } + return e; + })(); + } + } else { + existingElements = head.querySelectorAll(tag); + } + precedence = supportSort ? precedence ?? "" : void 0; + if (supportSort) { + restProps[dataPrecedenceAttr] = precedence; + } + const insert = useCallback( + (e) => { + if (deDupeByKey) { + if (tag === "link" && precedence !== void 0) { + let found2 = false; + for (const existingElement of head.querySelectorAll(tag)) { + const existingPrecedence = existingElement.getAttribute(dataPrecedenceAttr); + if (existingPrecedence === null) { + head.insertBefore(e, existingElement); + return; + } + if (found2 && existingPrecedence !== precedence) { + head.insertBefore(e, existingElement); + return; + } + if (existingPrecedence === precedence) { + found2 = true; + } + } + head.appendChild(e); + return; + } + let found = false; + for (const existingElement of head.querySelectorAll(tag)) { + if (found && existingElement.getAttribute(dataPrecedenceAttr) !== precedence) { + head.insertBefore(e, existingElement); + return; + } + if (existingElement.getAttribute(dataPrecedenceAttr) === precedence) { + found = true; + } + } + head.appendChild(e); + } else if (tag === "link") { + if (!head.contains(e)) { + head.appendChild(e); + } + } else if (existingElements) { + let found = false; + for (const existingElement of existingElements) { + if (existingElement === e) { + found = true; + break; + } + } + if (!found) { + head.insertBefore( + e, + head.contains(existingElements[0]) ? existingElements[0] : head.querySelector(tag) + ); + } + existingElements = void 0; + } + }, + [deDupeByKey, precedence, tag] + ); + const ref = composeRef(props.ref, (e) => { + const key = deDupeKeys[0]; + if (preserveNodeType === 2) { + e.innerHTML = ""; + } + if (created || existingElements) { + insert(e); + } + if (!onError && !onLoad) { + return; + } + if (!key) { + return; + } + let promise = blockingPromiseMap[e.getAttribute(key)] ||= new Promise( + (resolve, reject) => { + e.addEventListener("load", resolve); + e.addEventListener("error", reject); + } + ); + if (onLoad) { + promise = promise.then(onLoad); + } + if (onError) { + promise = promise.catch(onError); + } + promise.catch(() => { + }); + }); + if (supportBlocking && blocking === "render") { + const key = deDupeKeyMap[tag][0]; + if (key && props[key]) { + const value = props[key]; + const promise = blockingPromiseMap[value] ||= new Promise((resolve, reject) => { + insert(element); + element.addEventListener("load", resolve); + element.addEventListener("error", reject); + }); + use(promise); + } + } + const jsxNode = { + tag, + type: tag, + props: { + ...restProps, + ref + }, + ref + }; + jsxNode.p = preserveNodeType; + if (element) { + jsxNode.e = element; + } + return createPortal( + jsxNode, + head + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ); +}; +var title = (props) => { + const nameSpaceContext = getNameSpaceContext(); + const ns = nameSpaceContext && useContext(nameSpaceContext); + if (ns?.endsWith("svg")) { + return { + tag: "title", + props, + type: "title", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ref: props.ref + }; + } + return documentMetadataTag("title", props, void 0, false, false); +}; +var script = (props) => { + if (!props || ["src", "async"].some((k) => !props[k])) { + return { + tag: "script", + props, + type: "script", + ref: props.ref + }; + } + return documentMetadataTag("script", props, 1, false, true); +}; +var style = (props) => { + if (!props || !["href", "precedence"].every((k) => k in props)) { + return { + tag: "style", + props, + type: "style", + ref: props.ref + }; + } + props["data-href"] = props.href; + delete props.href; + return documentMetadataTag("style", props, 2, true, true); +}; +var link = (props) => { + if (!props || ["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { + return { + tag: "link", + props, + type: "link", + ref: props.ref + }; + } + return documentMetadataTag("link", props, 1, isStylesheetLinkWithPrecedence(props), true); +}; +var meta = (props) => { + return documentMetadataTag("meta", props, void 0, false, false); +}; +var customEventFormAction = /* @__PURE__ */ Symbol(); +var form = (props) => { + const { action, ...restProps } = props; + if (typeof action !== "function") { + ; + restProps.action = action; + } + const [state, setState] = useState([null, false]); + const onSubmit = useCallback( + async (ev) => { + const currentAction = ev.isTrusted ? action : ev.detail[customEventFormAction]; + if (typeof currentAction !== "function") { + return; + } + ev.preventDefault(); + const formData = new FormData(ev.target); + setState([formData, true]); + const actionRes = currentAction(formData); + if (actionRes instanceof Promise) { + registerAction(actionRes); + await actionRes; + } + setState([null, true]); + }, + [] + ); + const ref = composeRef(props.ref, (el) => { + el.addEventListener("submit", onSubmit); + return () => { + el.removeEventListener("submit", onSubmit); + }; + }); + const [data, isDirty] = state; + state[1] = false; + return { + tag: FormContext, + props: { + value: { + pending: data !== null, + data, + method: data ? "post" : null, + action: data ? action : null + }, + children: { + tag: "form", + props: { + ...restProps, + ref + }, + type: "form", + ref + } + }, + f: isDirty + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }; +}; +var formActionableElement = (tag, { + formAction, + ...props +}) => { + if (typeof formAction === "function") { + const onClick = useCallback((ev) => { + ev.preventDefault(); + ev.currentTarget.form.dispatchEvent( + new CustomEvent("submit", { detail: { [customEventFormAction]: formAction } }) + ); + }, []); + props.ref = composeRef(props.ref, (el) => { + el.addEventListener("click", onClick); + return () => { + el.removeEventListener("click", onClick); + }; + }); + } + return { + tag, + props, + type: tag, + ref: props.ref + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }; +}; +var input = (props) => formActionableElement("input", props); +var button = (props) => formActionableElement("button", props); +Object.assign(domRenderers, { + title, + script, + style, + link, + meta, + form, + input, + button +}); +export { + button, + clearCache, + composeRef, + form, + input, + link, + meta, + script, + style, + title +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js b/tools/ui/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..688a64245a47f63236b5b314dcd5902be31cef7b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js @@ -0,0 +1,19 @@ +// src/jsx/dom/jsx-dev-runtime.ts +import * as intrinsicElementTags from "./intrinsic-element/components.js"; +var jsxDEV = (tag, props, key) => { + if (typeof tag === "string" && intrinsicElementTags[tag]) { + tag = intrinsicElementTags[tag]; + } + return { + tag, + type: tag, + props, + key, + ref: props.ref + }; +}; +var Fragment = (props) => jsxDEV("", props, void 0); +export { + Fragment, + jsxDEV +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/jsx-runtime.js b/tools/ui/node_modules/hono/dist/jsx/dom/jsx-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..925d6dfd672a8bfd1b3ba30cc2ea67a6c3bb4b0c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/jsx-runtime.js @@ -0,0 +1,8 @@ +// src/jsx/dom/jsx-runtime.ts +import { jsxDEV, Fragment } from "./jsx-dev-runtime.js"; +import { jsxDEV as jsxDEV2 } from "./jsx-dev-runtime.js"; +export { + Fragment, + jsxDEV as jsx, + jsxDEV2 as jsxs +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/render.js b/tools/ui/node_modules/hono/dist/jsx/dom/render.js new file mode 100644 index 0000000000000000000000000000000000000000..7bef3bc9a5e51456358d94ee847b427cd4539ba7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/render.js @@ -0,0 +1,617 @@ +// src/jsx/dom/render.ts +import { toArray } from "../children.js"; +import { + DOM_ERROR_HANDLER, + DOM_INTERNAL_TAG, + DOM_MEMO, + DOM_RENDERER, + DOM_STASH +} from "../constants.js"; +import { globalContexts as globalJSXContexts, useContext } from "../context.js"; +import { STASH_EFFECT } from "../hooks/index.js"; +import { normalizeIntrinsicElementKey, styleObjectForEach } from "../utils.js"; +import { createContext } from "./context.js"; +var HONO_PORTAL_ELEMENT = "_hp"; +var eventAliasMap = { + Change: "Input", + DoubleClick: "DblClick" +}; +var nameSpaceMap = { + svg: "2000/svg", + math: "1998/Math/MathML" +}; +var buildDataStack = []; +var refCleanupMap = /* @__PURE__ */ new WeakMap(); +var nameSpaceContext = void 0; +var getNameSpaceContext = () => nameSpaceContext; +var isNodeString = (node) => "t" in node; +var eventCache = { + // pre-define events that are used very frequently + onClick: ["click", false] +}; +var getEventSpec = (key) => { + if (!key.startsWith("on")) { + return void 0; + } + if (eventCache[key]) { + return eventCache[key]; + } + const match = key.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/); + if (match) { + const [, eventName, capture] = match; + return eventCache[key] = [(eventAliasMap[eventName] || eventName).toLowerCase(), !!capture]; + } + return void 0; +}; +var toAttributeName = (element, key) => nameSpaceContext && element instanceof SVGElement && /[A-Z]/.test(key) && (key in element.style || // Presentation attributes are findable in style object. "clip-path", "font-size", "stroke-width", etc. +key.match(/^(?:o|pai|str|u|ve)/)) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key; +var normalizeFormValue = (value) => value === null || value === void 0 || value === false ? null : value; +var applySelectValue = (select, props) => { + if (!("value" in props)) { + return; + } + select.value = normalizeFormValue(props["value"]); + if (!select.multiple && select.selectedIndex === -1) { + select.selectedIndex = 0; + } +}; +var isIgnorableAttributeError = (error) => error instanceof DOMException && error.name === "InvalidCharacterError"; +var applyProps = (container, attributes, oldAttributes) => { + attributes ||= {}; + for (let key in attributes) { + const value = attributes[key]; + if (key !== "children" && (!oldAttributes || oldAttributes[key] !== value)) { + key = normalizeIntrinsicElementKey(key); + const eventSpec = getEventSpec(key); + if (eventSpec) { + if (oldAttributes?.[key] !== value) { + if (oldAttributes) { + container.removeEventListener(eventSpec[0], oldAttributes[key], eventSpec[1]); + } + if (value != null) { + if (typeof value !== "function") { + throw new Error(`Event handler for "${key}" is not a function`); + } + container.addEventListener(eventSpec[0], value, eventSpec[1]); + } + } + } else if (key === "dangerouslySetInnerHTML" && value) { + container.innerHTML = value.__html; + } else if (key === "ref") { + let cleanup; + if (typeof value === "function") { + cleanup = value(container) || (() => value(null)); + } else if (value && "current" in value) { + value.current = container; + cleanup = () => value.current = null; + } + refCleanupMap.set(container, cleanup); + } else if (key === "style") { + const style = container.style; + if (typeof value === "string") { + style.cssText = value; + } else { + style.cssText = ""; + if (value != null) { + styleObjectForEach(value, style.setProperty.bind(style)); + } + } + } else { + if (key === "value") { + const nodeName = container.nodeName; + if (nodeName === "SELECT") { + continue; + } else if (nodeName === "INPUT" || nodeName === "TEXTAREA") { + ; + container.value = normalizeFormValue(value); + if (nodeName === "TEXTAREA") { + container.textContent = value; + continue; + } + } + } else if (key === "checked" && container.nodeName === "INPUT" || key === "selected" && container.nodeName === "OPTION") { + ; + container[key] = value; + } + const k = toAttributeName(container, key); + try { + if (value === null || value === void 0 || value === false) { + container.removeAttribute(k); + } else if (value === true) { + container.setAttribute(k, ""); + } else if (typeof value === "string" || typeof value === "number") { + container.setAttribute(k, value); + } else { + container.setAttribute(k, value.toString()); + } + } catch (e) { + if (!isIgnorableAttributeError(e)) { + throw e; + } + } + } + } + } + if (oldAttributes) { + for (let key in oldAttributes) { + const value = oldAttributes[key]; + if (key !== "children" && !(key in attributes)) { + key = normalizeIntrinsicElementKey(key); + const eventSpec = getEventSpec(key); + if (eventSpec) { + container.removeEventListener(eventSpec[0], value, eventSpec[1]); + } else if (key === "ref") { + refCleanupMap.get(container)?.(); + } else { + try { + container.removeAttribute(toAttributeName(container, key)); + } catch (e) { + if (!isIgnorableAttributeError(e)) { + throw e; + } + } + } + } + } + } +}; +var invokeTag = (context, node) => { + node[DOM_STASH][0] = 0; + buildDataStack.push([context, node]); + const func = node.tag[DOM_RENDERER] || node.tag; + const props = func.defaultProps ? { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...func.defaultProps, + ...node.props + } : node.props; + try { + return [func.call(null, props)]; + } finally { + buildDataStack.pop(); + } +}; +var getNextChildren = (node, container, nextChildren, childrenToRemove, callbacks) => { + if (node.vR?.length) { + childrenToRemove.push(...node.vR); + delete node.vR; + } + if (typeof node.tag === "function") { + node[DOM_STASH][1][STASH_EFFECT]?.forEach((data) => callbacks.push(data)); + } + node.vC.forEach((child) => { + if (isNodeString(child)) { + nextChildren.push(child); + } else { + if (typeof child.tag === "function" || child.tag === "") { + child.c = container; + const currentNextChildrenIndex = nextChildren.length; + getNextChildren(child, container, nextChildren, childrenToRemove, callbacks); + if (child.s) { + for (let i = currentNextChildrenIndex; i < nextChildren.length; i++) { + nextChildren[i].s = true; + } + child.s = false; + } + } else { + nextChildren.push(child); + if (child.vR?.length) { + childrenToRemove.push(...child.vR); + delete child.vR; + } + } + } + }); +}; +var findInsertBefore = (node) => { + while (node && (node.tag === HONO_PORTAL_ELEMENT || !node.e)) { + node = node.tag === HONO_PORTAL_ELEMENT || !node.vC?.[0] ? node.nN : node.vC[0]; + } + return node?.e; +}; +var removeNode = (node) => { + if (!isNodeString(node)) { + node[DOM_STASH]?.[1][STASH_EFFECT]?.forEach((data) => data[2]?.()); + refCleanupMap.get(node.e)?.(); + if (node.p === 2) { + node.vC?.forEach((n) => n.p = 2); + } + node.vC?.forEach(removeNode); + } + if (!node.p) { + node.e?.remove(); + delete node.e; + } + if (typeof node.tag === "function") { + updateMap.delete(node); + fallbackUpdateFnArrayMap.delete(node); + delete node[DOM_STASH][3]; + node.a = true; + } +}; +var apply = (node, container, isNew) => { + node.c = container; + applyNodeObject(node, container, isNew); +}; +var findChildNodeIndex = (childNodes, child) => { + if (!child) { + return; + } + for (let i = 0, len = childNodes.length; i < len; i++) { + if (childNodes[i] === child) { + return i; + } + } + return; +}; +var cancelBuild = /* @__PURE__ */ Symbol(); +var applyNodeObject = (node, container, isNew) => { + const next = []; + const remove = []; + const callbacks = []; + getNextChildren(node, container, next, remove, callbacks); + remove.forEach(removeNode); + const childNodes = isNew ? void 0 : container.childNodes; + let offset; + let insertBeforeNode = null; + if (isNew) { + offset = -1; + } else if (!childNodes.length) { + offset = 0; + } else { + const offsetByNextNode = findChildNodeIndex(childNodes, findInsertBefore(node.nN)); + if (offsetByNextNode !== void 0) { + insertBeforeNode = childNodes[offsetByNextNode]; + offset = offsetByNextNode; + } else { + offset = findChildNodeIndex(childNodes, next.find((n) => n.tag !== HONO_PORTAL_ELEMENT && n.e)?.e) ?? -1; + } + if (offset === -1) { + isNew = true; + } + } + for (let i = 0, len = next.length; i < len; i++, offset++) { + const child = next[i]; + let el; + if (child.s && child.e) { + el = child.e; + child.s = false; + } else { + const isNewLocal = isNew || !child.e; + if (isNodeString(child)) { + if (child.e && child.d) { + child.e.textContent = child.t; + } + child.d = false; + el = child.e ||= document.createTextNode(child.t); + } else { + el = child.e ||= child.n ? document.createElementNS(child.n, child.tag) : document.createElement(child.tag); + applyProps(el, child.props, child.pP); + applyNodeObject(child, el, isNewLocal); + if (child.tag === "select") { + applySelectValue(el, child.props); + } + } + } + if (child.tag === HONO_PORTAL_ELEMENT) { + offset--; + } else if (isNew) { + if (!el.parentNode) { + container.appendChild(el); + } + } else if (childNodes[offset] !== el && childNodes[offset - 1] !== el) { + if (childNodes[offset + 1] === el) { + container.appendChild(childNodes[offset]); + } else { + container.insertBefore(el, insertBeforeNode || childNodes[offset] || null); + } + } + } + if (node.pP) { + node.pP = void 0; + } + if (callbacks.length) { + const useLayoutEffectCbs = []; + const useEffectCbs = []; + callbacks.forEach(([, useLayoutEffectCb, , useEffectCb, useInsertionEffectCb]) => { + if (useLayoutEffectCb) { + useLayoutEffectCbs.push(useLayoutEffectCb); + } + if (useEffectCb) { + useEffectCbs.push(useEffectCb); + } + useInsertionEffectCb?.(); + }); + useLayoutEffectCbs.forEach((cb) => cb()); + if (useEffectCbs.length) { + requestAnimationFrame(() => { + useEffectCbs.forEach((cb) => cb()); + }); + } + } +}; +var isSameContext = (oldContexts, newContexts) => !!(oldContexts && oldContexts.length === newContexts.length && oldContexts.every((ctx, i) => ctx[1] === newContexts[i][1])); +var fallbackUpdateFnArrayMap = /* @__PURE__ */ new WeakMap(); +var build = (context, node, children) => { + const buildWithPreviousChildren = !children && node.pC; + if (children) { + node.pC ||= node.vC; + } + let foundErrorHandler; + try { + children ||= typeof node.tag == "function" ? invokeTag(context, node) : toArray(node.props.children); + if (children[0]?.tag === "" && children[0][DOM_ERROR_HANDLER]) { + foundErrorHandler = children[0][DOM_ERROR_HANDLER]; + context[5].push([context, foundErrorHandler, node]); + } + const oldVChildren = buildWithPreviousChildren ? [...node.pC] : node.vC ? [...node.vC] : void 0; + const vChildren = []; + let prevNode; + for (let i = 0; i < children.length; i++) { + if (Array.isArray(children[i])) { + children.splice(i, 1, ...children[i].flat(Infinity)); + i--; + continue; + } + let child = buildNode(children[i]); + if (child) { + if (typeof child.tag === "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any + !child.tag[DOM_INTERNAL_TAG]) { + if (globalJSXContexts.length > 0) { + child[DOM_STASH][2] = globalJSXContexts.map((c) => [c, c.values.at(-1)]); + } + if (context[5]?.length) { + child[DOM_STASH][3] = context[5].at(-1); + } + } + let oldChild; + if (oldVChildren && oldVChildren.length) { + const i2 = oldVChildren.findIndex( + isNodeString(child) ? (c) => isNodeString(c) : child.key !== void 0 ? (c) => c.key === child.key && c.tag === child.tag : (c) => c.tag === child.tag + ); + if (i2 !== -1) { + oldChild = oldVChildren[i2]; + oldVChildren.splice(i2, 1); + } + } + if (oldChild) { + if (isNodeString(child)) { + if (oldChild.t !== child.t) { + ; + oldChild.t = child.t; + oldChild.d = true; + } + child = oldChild; + } else { + const pP = oldChild.pP = oldChild.props; + oldChild.props = child.props; + oldChild.f ||= child.f || node.f; + if (typeof child.tag === "function") { + const oldContexts = oldChild[DOM_STASH][2]; + oldChild[DOM_STASH][2] = child[DOM_STASH][2] || []; + oldChild[DOM_STASH][3] = child[DOM_STASH][3]; + if (!oldChild.f && ((oldChild.o || oldChild) === child.o || // The code generated by the react compiler is memoized under this condition. + oldChild.tag[DOM_MEMO]?.(pP, oldChild.props)) && // The `memo` function is memoized under this condition. + isSameContext(oldContexts, oldChild[DOM_STASH][2])) { + oldChild.s = true; + } + } + child = oldChild; + } + } else if (!isNodeString(child) && nameSpaceContext) { + const ns = useContext(nameSpaceContext); + if (ns) { + child.n = ns; + } + } + if (!isNodeString(child) && !child.s) { + build(context, child); + delete child.f; + } + vChildren.push(child); + if (prevNode && !prevNode.s && !child.s) { + for (let p = prevNode; p && !isNodeString(p); p = p.vC?.at(-1)) { + p.nN = child; + } + } + prevNode = child; + } + } + node.vR = buildWithPreviousChildren ? [...node.vC, ...oldVChildren || []] : oldVChildren || []; + node.vC = vChildren; + if (buildWithPreviousChildren) { + delete node.pC; + } + } catch (e) { + node.f = true; + if (e === cancelBuild) { + if (foundErrorHandler) { + return; + } else { + throw e; + } + } + const [errorHandlerContext, errorHandler, errorHandlerNode] = node[DOM_STASH]?.[3] || []; + if (errorHandler) { + const fallbackUpdateFn = () => update([0, false, context[2]], errorHandlerNode); + const fallbackUpdateFnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode) || []; + fallbackUpdateFnArray.push(fallbackUpdateFn); + fallbackUpdateFnArrayMap.set(errorHandlerNode, fallbackUpdateFnArray); + const fallback = errorHandler(e, () => { + const fnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode); + if (fnArray) { + const i = fnArray.indexOf(fallbackUpdateFn); + if (i !== -1) { + fnArray.splice(i, 1); + return fallbackUpdateFn(); + } + } + }); + if (fallback) { + if (context[0] === 1) { + context[1] = true; + } else { + build(context, errorHandlerNode, [fallback]); + if ((errorHandler.length === 1 || context !== errorHandlerContext) && errorHandlerNode.c) { + apply(errorHandlerNode, errorHandlerNode.c, false); + return; + } + } + throw cancelBuild; + } + } + throw e; + } finally { + if (foundErrorHandler) { + context[5].pop(); + } + } +}; +var buildNode = (node) => { + if (node === void 0 || node === null || typeof node === "boolean") { + return void 0; + } else if (typeof node === "string" || typeof node === "number") { + return { t: node.toString(), d: true }; + } else { + if ("vR" in node) { + node = { + tag: node.tag, + props: node.props, + key: node.key, + f: node.f, + type: node.tag, + ref: node.props.ref, + o: node.o || node + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }; + } + if (typeof node.tag === "function") { + ; + node[DOM_STASH] = [0, []]; + } else { + const ns = nameSpaceMap[node.tag]; + if (ns) { + nameSpaceContext ||= createContext(""); + node.props.children = [ + { + tag: nameSpaceContext, + props: { + value: node.n = `http://www.w3.org/${ns}`, + children: node.props.children + } + } + ]; + } + } + return node; + } +}; +var replaceContainer = (node, from, to) => { + if (node.c === from) { + node.c = to; + node.vC.forEach((child) => replaceContainer(child, from, to)); + } +}; +var updateSync = (context, node) => { + node[DOM_STASH][2]?.forEach(([c, v]) => { + c.values.push(v); + }); + try { + build(context, node, void 0); + } catch { + return; + } + if (node.a) { + delete node.a; + return; + } + node[DOM_STASH][2]?.forEach(([c]) => { + c.values.pop(); + }); + if (context[0] !== 1 || !context[1]) { + apply(node, node.c, false); + } +}; +var updateMap = /* @__PURE__ */ new WeakMap(); +var currentUpdateSets = []; +var update = async (context, node) => { + context[5] ||= []; + const existing = updateMap.get(node); + if (existing) { + existing[0](void 0); + } + let resolve; + const promise = new Promise((r) => resolve = r); + updateMap.set(node, [ + resolve, + () => { + if (context[2]) { + context[2](context, node, (context2) => { + updateSync(context2, node); + }).then(() => resolve(node)); + } else { + updateSync(context, node); + resolve(node); + } + } + ]); + if (currentUpdateSets.length) { + ; + currentUpdateSets.at(-1).add(node); + } else { + await Promise.resolve(); + const latest = updateMap.get(node); + if (latest) { + updateMap.delete(node); + latest[1](); + } + } + return promise; +}; +var renderNode = (node, container) => { + const context = []; + context[5] = []; + context[4] = true; + build(context, node, void 0); + context[4] = false; + const fragment = document.createDocumentFragment(); + apply(node, fragment, true); + replaceContainer(node, fragment, container); + container.replaceChildren(fragment); +}; +var render = (jsxNode, container) => { + renderNode(buildNode({ tag: "", props: { children: jsxNode } }), container); +}; +var flushSync = (callback) => { + const set = /* @__PURE__ */ new Set(); + currentUpdateSets.push(set); + callback(); + set.forEach((node) => { + const latest = updateMap.get(node); + if (latest) { + updateMap.delete(node); + latest[1](); + } + }); + currentUpdateSets.pop(); +}; +var createPortal = (children, container, key) => ({ + tag: HONO_PORTAL_ELEMENT, + props: { + children + }, + key, + e: container, + p: 1 + // eslint-disable-next-line @typescript-eslint/no-explicit-any +}); +export { + build, + buildDataStack, + buildNode, + createPortal, + flushSync, + getNameSpaceContext, + render, + renderNode, + update +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/server.js b/tools/ui/node_modules/hono/dist/jsx/dom/server.js new file mode 100644 index 0000000000000000000000000000000000000000..a1110ddad4a5bdab94a810e8ca1265376e5a0e85 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/server.js @@ -0,0 +1,33 @@ +// src/jsx/dom/server.ts +import { renderToReadableStream as renderToReadableStreamHono } from "../streaming.js"; +import version from "./index.js"; +var renderToString = (element, options = {}) => { + if (Object.keys(options).length > 0) { + console.warn("options are not supported yet"); + } + const res = element?.toString() ?? ""; + if (typeof res !== "string") { + throw new Error("Async component is not supported in renderToString"); + } + return res; +}; +var renderToReadableStream = async (element, options = {}) => { + if (Object.keys(options).some((key) => key !== "onError")) { + console.warn("options are not supported yet, except onError"); + } + if (!element || typeof element !== "object") { + element = element?.toString() ?? ""; + } + return renderToReadableStreamHono(element, options.onError); +}; +var server_default = { + renderToString, + renderToReadableStream, + version +}; +export { + server_default as default, + renderToReadableStream, + renderToString, + version +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/dom/utils.js b/tools/ui/node_modules/hono/dist/jsx/dom/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..b8efa98b33deb1fa1c96a13538ce268ac8dcd86a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/dom/utils.js @@ -0,0 +1,10 @@ +// src/jsx/dom/utils.ts +import { DOM_INTERNAL_TAG } from "../constants.js"; +var setInternalTagFlag = (fn) => { + ; + fn[DOM_INTERNAL_TAG] = true; + return fn; +}; +export { + setInternalTagFlag +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/hooks/index.js b/tools/ui/node_modules/hono/dist/jsx/hooks/index.js new file mode 100644 index 0000000000000000000000000000000000000000..49fe299974328cd3d14c8c5033371ccaffed3901 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/hooks/index.js @@ -0,0 +1,331 @@ +// src/jsx/hooks/index.ts +import { DOM_STASH } from "../constants.js"; +import { buildDataStack, update } from "../dom/render.js"; +var STASH_SATE = 0; +var STASH_EFFECT = 1; +var STASH_CALLBACK = 2; +var STASH_MEMO = 3; +var STASH_REF = 4; +var resolvedPromiseValueMap = /* @__PURE__ */ new WeakMap(); +var isDepsChanged = (prevDeps, deps) => !prevDeps || !deps || prevDeps.length !== deps.length || deps.some((dep, i) => dep !== prevDeps[i]); +var viewTransitionState = void 0; +var documentStartViewTransition = (cb) => { + if (document?.startViewTransition) { + return document.startViewTransition(cb); + } else { + cb(); + return { finished: Promise.resolve() }; + } +}; +var updateHook = void 0; +var viewTransitionHook = (context, node, cb) => { + const state = [true, false]; + let lastVC = node.vC; + return documentStartViewTransition(() => { + if (lastVC === node.vC) { + viewTransitionState = state; + cb(context); + viewTransitionState = void 0; + lastVC = node.vC; + } + }).finished.then(() => { + if (state[1] && lastVC === node.vC) { + state[0] = false; + viewTransitionState = state; + cb(context); + viewTransitionState = void 0; + } + }); +}; +var startViewTransition = (callback) => { + updateHook = viewTransitionHook; + try { + callback(); + } finally { + updateHook = void 0; + } +}; +var useViewTransition = () => { + const buildData = buildDataStack.at(-1); + if (!buildData) { + return [false, () => { + }]; + } + if (viewTransitionState) { + viewTransitionState[1] = true; + } + return [!!viewTransitionState?.[0], startViewTransition]; +}; +var pendingStack = []; +var runCallback = (type, callback) => { + let resolve; + const promise = new Promise((r) => resolve = r); + pendingStack.push([type, promise]); + try { + const res = callback(); + if (res instanceof Promise) { + res.then(resolve, resolve); + } else { + resolve(); + } + } finally { + pendingStack.pop(); + } +}; +var startTransition = (callback) => { + runCallback(1, callback); +}; +var startTransitionHook = (callback) => { + runCallback(2, callback); +}; +var useTransition = () => { + const buildData = buildDataStack.at(-1); + if (!buildData) { + return [false, () => { + }]; + } + const [error, setError] = useState(); + const [state, updateState] = useState(); + if (error) { + throw error[0]; + } + const startTransitionLocalHook = useCallback( + (callback) => { + startTransitionHook(() => { + updateState((state2) => !state2); + let res = callback(); + if (res instanceof Promise) { + res = res.catch((e) => { + setError([e]); + }); + } + return res; + }); + }, + [state] + ); + const [context] = buildData; + return [context[0] === 2, startTransitionLocalHook]; +}; +var useDeferredValue = (value, ...rest) => { + const [values, setValues] = useState( + rest.length ? [rest[0], rest[0]] : [value, value] + ); + if (Object.is(values[1], value)) { + return values[1]; + } + pendingStack.push([3, Promise.resolve()]); + updateHook = async (context, _, cb) => { + cb(context); + values[0] = value; + }; + setValues([values[0], value]); + updateHook = void 0; + pendingStack.pop(); + return values[0]; +}; +var useState = (initialState) => { + const resolveInitialState = () => typeof initialState === "function" ? initialState() : initialState; + const buildData = buildDataStack.at(-1); + if (!buildData) { + return [resolveInitialState(), () => { + }]; + } + const [, node] = buildData; + const stateArray = node[DOM_STASH][1][STASH_SATE] ||= []; + const hookIndex = node[DOM_STASH][0]++; + return stateArray[hookIndex] ||= [ + resolveInitialState(), + (newState) => { + const localUpdateHook = updateHook; + const stateData = stateArray[hookIndex]; + if (typeof newState === "function") { + newState = newState(stateData[0]); + } + if (!Object.is(newState, stateData[0])) { + stateData[0] = newState; + if (pendingStack.length) { + const [pendingType, pendingPromise] = pendingStack.at(-1); + Promise.all([ + pendingType === 3 ? node : update([pendingType, false, localUpdateHook], node), + pendingPromise + ]).then(([node2]) => { + if (!node2 || !(pendingType === 2 || pendingType === 3)) { + return; + } + const lastVC = node2.vC; + const addUpdateTask = () => { + setTimeout(() => { + if (lastVC !== node2.vC) { + return; + } + update([pendingType === 3 ? 1 : 0, false, localUpdateHook], node2); + }); + }; + requestAnimationFrame(addUpdateTask); + }); + } else { + update([0, false, localUpdateHook], node); + } + } + } + ]; +}; +var useReducer = (reducer, initialArg, init) => { + const handler = useCallback( + (action) => { + setState((state2) => reducer(state2, action)); + }, + [reducer] + ); + const [state, setState] = useState(() => init ? init(initialArg) : initialArg); + return [state, handler]; +}; +var useEffectCommon = (index, effect, deps) => { + const buildData = buildDataStack.at(-1); + if (!buildData) { + return; + } + const [, node] = buildData; + const effectDepsArray = node[DOM_STASH][1][STASH_EFFECT] ||= []; + const hookIndex = node[DOM_STASH][0]++; + const [prevDeps, , prevCleanup] = effectDepsArray[hookIndex] ||= []; + if (isDepsChanged(prevDeps, deps)) { + if (prevCleanup) { + prevCleanup(); + } + const runner = () => { + data[index] = void 0; + data[2] = effect(); + }; + const data = [deps, void 0, void 0, void 0, void 0]; + data[index] = runner; + effectDepsArray[hookIndex] = data; + } +}; +var useEffect = (effect, deps) => useEffectCommon(3, effect, deps); +var useLayoutEffect = (effect, deps) => useEffectCommon(1, effect, deps); +var useInsertionEffect = (effect, deps) => useEffectCommon(4, effect, deps); +var useCallback = (callback, deps) => { + const buildData = buildDataStack.at(-1); + if (!buildData) { + return callback; + } + const [, node] = buildData; + const callbackArray = node[DOM_STASH][1][STASH_CALLBACK] ||= []; + const hookIndex = node[DOM_STASH][0]++; + const prevDeps = callbackArray[hookIndex]; + if (isDepsChanged(prevDeps?.[1], deps)) { + callbackArray[hookIndex] = [callback, deps]; + } else { + callback = callbackArray[hookIndex][0]; + } + return callback; +}; +function useRef(initialValue) { + const buildData = buildDataStack.at(-1); + if (!buildData) { + return { current: initialValue }; + } + const [, node] = buildData; + const refArray = node[DOM_STASH][1][STASH_REF] ||= []; + const hookIndex = node[DOM_STASH][0]++; + return refArray[hookIndex] ||= { current: initialValue }; +} +var use = (promise) => { + const cachedRes = resolvedPromiseValueMap.get(promise); + if (cachedRes) { + if (cachedRes.length === 2) { + throw cachedRes[1]; + } + return cachedRes[0]; + } + promise.then( + (res) => resolvedPromiseValueMap.set(promise, [res]), + (e) => resolvedPromiseValueMap.set(promise, [void 0, e]) + ); + throw promise; +}; +var useMemo = (factory, deps) => { + const buildData = buildDataStack.at(-1); + if (!buildData) { + return factory(); + } + const [, node] = buildData; + const memoArray = node[DOM_STASH][1][STASH_MEMO] ||= []; + const hookIndex = node[DOM_STASH][0]++; + const prevDeps = memoArray[hookIndex]; + if (isDepsChanged(prevDeps?.[1], deps)) { + memoArray[hookIndex] = [factory(), deps]; + } + return memoArray[hookIndex][0]; +}; +var idCounter = 0; +var useId = () => useMemo(() => `:r${(idCounter++).toString(32)}:`, []); +var useDebugValue = (_value, _formatter) => { +}; +var createRef = () => { + return { current: null }; +}; +var forwardRef = (Component) => { + return (props) => { + const { ref, ...rest } = props; + return Component(rest, ref); + }; +}; +var useImperativeHandle = (ref, createHandle, deps) => { + useEffect(() => { + ref.current = createHandle(); + return () => { + ref.current = null; + }; + }, deps); +}; +var useSyncExternalStore = (subscribe, getSnapshot, getServerSnapshot) => { + const buildData = buildDataStack.at(-1); + if (!buildData) { + if (!getServerSnapshot) { + throw new Error("getServerSnapshot is required for server side rendering"); + } + return getServerSnapshot(); + } + const snapshot = buildData[0][4] && getServerSnapshot ? getServerSnapshot() : getSnapshot(); + const [, setVersion] = useState(0); + const latestSnapshot = useRef([snapshot, getSnapshot]); + latestSnapshot.current = [snapshot, getSnapshot]; + const unsubscribeRef = useRef(null); + useEffect(() => { + const update2 = () => setVersion((version) => version + 1); + unsubscribeRef.current?.(); + unsubscribeRef.current = subscribe(update2); + const [snapshot2, getSnapshot2] = latestSnapshot.current; + if (!Object.is(snapshot2, getSnapshot2())) { + update2(); + } + }, [subscribe]); + useEffect(() => () => unsubscribeRef.current?.(), []); + return snapshot; +}; +export { + STASH_EFFECT, + createRef, + forwardRef, + startTransition, + startViewTransition, + use, + useCallback, + useDebugValue, + useDeferredValue, + useEffect, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/index.js b/tools/ui/node_modules/hono/dist/jsx/index.js new file mode 100644 index 0000000000000000000000000000000000000000..49b2df901aea84d7684cbceb00a1d87976f3c55c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/index.js @@ -0,0 +1,103 @@ +// src/jsx/index.ts +import { Fragment, cloneElement, isValidElement, jsx, memo, reactAPICompatVersion } from "./base.js"; +import { Children } from "./children.js"; +import { ErrorBoundary } from "./components.js"; +import { createContext, useContext } from "./context.js"; +import { useActionState, useOptimistic } from "./dom/hooks/index.js"; +import { + createRef, + forwardRef, + startTransition, + startViewTransition, + use, + useCallback, + useDebugValue, + useDeferredValue, + useEffect, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition +} from "./hooks/index.js"; +import { Suspense } from "./streaming.js"; +var jsx_default = { + version: reactAPICompatVersion, + memo, + Fragment, + StrictMode: Fragment, + isValidElement, + createElement: jsx, + cloneElement, + ErrorBoundary, + createContext, + useContext, + useState, + useEffect, + useRef, + useCallback, + useReducer, + useId, + useDebugValue, + use, + startTransition, + useTransition, + useDeferredValue, + startViewTransition, + useViewTransition, + useMemo, + useLayoutEffect, + useInsertionEffect, + createRef, + forwardRef, + useImperativeHandle, + useSyncExternalStore, + useActionState, + useOptimistic, + Suspense, + Children +}; +export { + Children, + ErrorBoundary, + Fragment, + Fragment as StrictMode, + Suspense, + cloneElement, + createContext, + jsx as createElement, + createRef, + jsx_default as default, + forwardRef, + isValidElement, + jsx, + memo, + startTransition, + startViewTransition, + use, + useActionState, + useCallback, + useContext, + useDebugValue, + useDeferredValue, + useEffect, + useId, + useImperativeHandle, + useInsertionEffect, + useLayoutEffect, + useMemo, + useOptimistic, + useReducer, + useRef, + useState, + useSyncExternalStore, + useTransition, + useViewTransition, + reactAPICompatVersion as version +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/intrinsic-element/common.js b/tools/ui/node_modules/hono/dist/jsx/intrinsic-element/common.js new file mode 100644 index 0000000000000000000000000000000000000000..4241c6d756a255d09f612bc72297d6a4244a8654 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/intrinsic-element/common.js @@ -0,0 +1,24 @@ +// src/jsx/intrinsic-element/common.ts +var deDupeKeyMap = { + title: [], + script: ["src"], + style: ["data-href"], + link: ["href"], + meta: ["name", "httpEquiv", "charset", "itemProp"] +}; +var domRenderers = {}; +var dataPrecedenceAttr = "data-precedence"; +var isStylesheetLinkWithPrecedence = (props) => props.rel === "stylesheet" && "precedence" in props; +var shouldDeDupeByKey = (tagName, supportSort) => { + if (tagName === "link") { + return supportSort; + } + return deDupeKeyMap[tagName].length > 0; +}; +export { + dataPrecedenceAttr, + deDupeKeyMap, + domRenderers, + isStylesheetLinkWithPrecedence, + shouldDeDupeByKey +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/intrinsic-element/components.js b/tools/ui/node_modules/hono/dist/jsx/intrinsic-element/components.js new file mode 100644 index 0000000000000000000000000000000000000000..9c8bbae039a0d87d7b17e738ef8eae20c00fc793 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/intrinsic-element/components.js @@ -0,0 +1,165 @@ +// src/jsx/intrinsic-element/components.ts +import { raw } from "../../helper/html/index.js"; +import { JSXNode, getNameSpaceContext } from "../base.js"; +import { toArray } from "../children.js"; +import { PERMALINK } from "../constants.js"; +import { useContext } from "../context.js"; +import { + dataPrecedenceAttr, + deDupeKeyMap, + isStylesheetLinkWithPrecedence, + shouldDeDupeByKey +} from "./common.js"; +var metaTagMap = /* @__PURE__ */ new WeakMap(); +var insertIntoHead = (tagName, tag, props, precedence) => ({ buffer, context }) => { + if (!buffer) { + return; + } + const map = metaTagMap.get(context) || {}; + metaTagMap.set(context, map); + const tags = map[tagName] ||= []; + let duped = false; + const deDupeKeys = deDupeKeyMap[tagName]; + const deDupeByKey = shouldDeDupeByKey(tagName, precedence !== void 0); + if (deDupeByKey) { + LOOP: for (const [, tagProps] of tags) { + if (tagName === "link" && !(tagProps.rel === "stylesheet" && tagProps[dataPrecedenceAttr] !== void 0)) { + continue; + } + for (const key of deDupeKeys) { + if ((tagProps?.[key] ?? null) === props?.[key]) { + duped = true; + break LOOP; + } + } + } + } + if (duped) { + buffer[0] = buffer[0].replaceAll(tag, ""); + } else if (deDupeByKey || tagName === "link") { + tags.push([tag, props, precedence]); + } else { + tags.unshift([tag, props, precedence]); + } + if (buffer[0].indexOf("") !== -1) { + let insertTags; + if (tagName === "link" || precedence !== void 0) { + const precedences = []; + insertTags = tags.map(([tag2, , tagPrecedence], index) => { + if (tagPrecedence === void 0) { + return [tag2, Number.MAX_SAFE_INTEGER, index]; + } + let order = precedences.indexOf(tagPrecedence); + if (order === -1) { + precedences.push(tagPrecedence); + order = precedences.length - 1; + } + return [tag2, order, index]; + }).sort((a, b) => a[1] - b[1] || a[2] - b[2]).map(([tag2]) => tag2); + } else { + insertTags = tags.map(([tag2]) => tag2); + } + insertTags.forEach((tag2) => { + buffer[0] = buffer[0].replaceAll(tag2, ""); + }); + buffer[0] = buffer[0].replace(/(?=<\/head>)/, insertTags.join("")); + } +}; +var returnWithoutSpecialBehavior = (tag, children, props) => raw(new JSXNode(tag, props, toArray(children ?? [])).toString()); +var documentMetadataTag = (tag, children, props, sort) => { + if ("itemProp" in props) { + return returnWithoutSpecialBehavior(tag, children, props); + } + let { precedence, blocking, ...restProps } = props; + precedence = sort ? precedence ?? "" : void 0; + if (sort) { + restProps[dataPrecedenceAttr] = precedence; + } + const string = new JSXNode(tag, restProps, toArray(children || [])).toString(); + if (string instanceof Promise) { + return string.then( + (resString) => raw(string, [ + ...resString.callbacks || [], + insertIntoHead(tag, resString, restProps, precedence) + ]) + ); + } else { + return raw(string, [insertIntoHead(tag, string, restProps, precedence)]); + } +}; +var title = ({ children, ...props }) => { + const nameSpaceContext = getNameSpaceContext(); + if (nameSpaceContext) { + const context = useContext(nameSpaceContext); + if (context === "svg" || context === "head") { + return new JSXNode( + "title", + props, + toArray(children ?? []) + ); + } + } + return documentMetadataTag("title", children, props, false); +}; +var script = ({ + children, + ...props +}) => { + const nameSpaceContext = getNameSpaceContext(); + if (["src", "async"].some((k) => !props[k]) || nameSpaceContext && useContext(nameSpaceContext) === "head") { + return returnWithoutSpecialBehavior("script", children, props); + } + return documentMetadataTag("script", children, props, false); +}; +var style = ({ + children, + ...props +}) => { + if (!["href", "precedence"].every((k) => k in props)) { + return returnWithoutSpecialBehavior("style", children, props); + } + props["data-href"] = props.href; + delete props.href; + return documentMetadataTag("style", children, props, true); +}; +var link = ({ children, ...props }) => { + if (["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) { + return returnWithoutSpecialBehavior("link", children, props); + } + return documentMetadataTag("link", children, props, isStylesheetLinkWithPrecedence(props)); +}; +var meta = ({ children, ...props }) => { + const nameSpaceContext = getNameSpaceContext(); + if (nameSpaceContext && useContext(nameSpaceContext) === "head") { + return returnWithoutSpecialBehavior("meta", children, props); + } + return documentMetadataTag("meta", children, props, false); +}; +var newJSXNode = (tag, { children, ...props }) => ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + new JSXNode(tag, props, toArray(children ?? [])) +); +var form = (props) => { + if (typeof props.action === "function") { + props.action = PERMALINK in props.action ? props.action[PERMALINK] : void 0; + } + return newJSXNode("form", props); +}; +var formActionableElement = (tag, props) => { + if (typeof props.formAction === "function") { + props.formAction = PERMALINK in props.formAction ? props.formAction[PERMALINK] : void 0; + } + return newJSXNode(tag, props); +}; +var input = (props) => formActionableElement("input", props); +var button = (props) => formActionableElement("button", props); +export { + button, + form, + input, + link, + meta, + script, + style, + title +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/intrinsic-elements.js b/tools/ui/node_modules/hono/dist/jsx/intrinsic-elements.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/jsx/jsx-dev-runtime.js b/tools/ui/node_modules/hono/dist/jsx/jsx-dev-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..2a689202090b1516110c2379c22fcaf877433f10 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/jsx-dev-runtime.js @@ -0,0 +1,18 @@ +// src/jsx/jsx-dev-runtime.ts +import { jsxFn } from "./base.js"; +import { Fragment } from "./base.js"; +function jsxDEV(tag, props, key) { + let node; + if (!props || !("children" in props)) { + node = jsxFn(tag, props, []); + } else { + const children = props.children; + node = Array.isArray(children) ? jsxFn(tag, props, children) : jsxFn(tag, props, [children]); + } + node.key = key; + return node; +} +export { + Fragment, + jsxDEV +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/jsx-runtime.js b/tools/ui/node_modules/hono/dist/jsx/jsx-runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..5f8372e906e1b7e0a09a289d0eccb0af78256fd3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/jsx-runtime.js @@ -0,0 +1,44 @@ +// src/jsx/jsx-runtime.ts +import { jsxDEV, Fragment } from "./jsx-dev-runtime.js"; +import { jsxDEV as jsxDEV2 } from "./jsx-dev-runtime.js"; +import { html, raw } from "../helper/html/index.js"; +import { escapeToBuffer, stringBufferToString } from "../utils/html.js"; +import { isValidAttributeName, styleObjectForEach } from "./utils.js"; +var jsxAttr = (key, v) => { + if (!isValidAttributeName(key)) { + return raw(""); + } + const buffer = [`${key}="`]; + if (key === "style" && typeof v === "object") { + let styleStr = ""; + styleObjectForEach(v, (property, value) => { + if (value != null) { + styleStr += `${styleStr ? ";" : ""}${property}:${value}`; + } + }); + escapeToBuffer(styleStr, buffer); + buffer[0] += '"'; + } else if (typeof v === "string") { + escapeToBuffer(v, buffer); + buffer[0] += '"'; + } else if (v === null || v === void 0) { + return raw(""); + } else if (typeof v === "number" || v.isEscaped) { + buffer[0] += `${v}"`; + } else if (v instanceof Promise) { + buffer.unshift('"', v); + } else { + escapeToBuffer(v.toString(), buffer); + buffer[0] += '"'; + } + return buffer.length === 1 ? raw(buffer[0]) : stringBufferToString(buffer, void 0); +}; +var jsxEscape = (value) => value; +export { + Fragment, + jsxDEV as jsx, + jsxAttr, + jsxEscape, + html as jsxTemplate, + jsxDEV2 as jsxs +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/streaming.js b/tools/ui/node_modules/hono/dist/jsx/streaming.js new file mode 100644 index 0000000000000000000000000000000000000000..13be53d6486431ebc10fd979952308af08d45723 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/streaming.js @@ -0,0 +1,155 @@ +// src/jsx/streaming.ts +import { raw } from "../helper/html/index.js"; +import { HtmlEscapedCallbackPhase, resolveCallback } from "../utils/html.js"; +import { JSXNode } from "./base.js"; +import { childrenToString } from "./components.js"; +import { DOM_RENDERER, DOM_STASH } from "./constants.js"; +import { captureRenderContext, createContext, useContext } from "./context.js"; +import { Suspense as SuspenseDomRenderer } from "./dom/components.js"; +import { buildDataStack } from "./dom/render.js"; +var StreamingContext = createContext(null); +var suspenseCounter = 0; +var Suspense = async ({ + children, + fallback +}) => { + if (!Array.isArray(children)) { + children = [children]; + } + const nonce = useContext(StreamingContext)?.scriptNonce; + let resArray = []; + const stackNode = { [DOM_STASH]: [0, []] }; + const popNodeStack = () => { + buildDataStack.pop(); + }; + try { + stackNode[DOM_STASH][0] = 0; + buildDataStack.push([[], stackNode]); + resArray = children.map( + (c) => c == null || typeof c === "boolean" ? "" : c.toString() + ); + } catch (e) { + if (e instanceof Promise) { + const resume = captureRenderContext(); + resArray = [ + e.then( + () => resume(() => { + stackNode[DOM_STASH][0] = 0; + buildDataStack.push([[], stackNode]); + return childrenToString(children).finally(popNodeStack); + }) + ) + ]; + } else { + throw e; + } + } finally { + popNodeStack(); + } + if (resArray.some((res) => res instanceof Promise)) { + const index = suspenseCounter++; + const fallbackStr = await fallback.toString(); + return raw(`${fallbackStr}`, [ + ...fallbackStr.callbacks || [], + ({ phase, buffer, context }) => { + if (phase === HtmlEscapedCallbackPhase.BeforeStream) { + return; + } + return Promise.all(resArray).then(async (htmlArray) => { + htmlArray = htmlArray.flat(); + const content = htmlArray.join(""); + if (buffer) { + buffer[0] = buffer[0].replace( + new RegExp(`.*?`), + content + ); + } + let html = buffer ? "" : ` +((d,c,n) => { +c=d.currentScript.previousSibling +d=d.getElementById('H:${index}') +if(!d)return +do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='/$') +d.replaceWith(c.content) +})(document) +`; + const callbacks = htmlArray.map((html2) => html2.callbacks || []).flat(); + if (!callbacks.length) { + return html; + } + if (phase === HtmlEscapedCallbackPhase.Stream) { + html = await resolveCallback(html, HtmlEscapedCallbackPhase.BeforeStream, true, context); + } + return raw(html, callbacks); + }); + } + ]); + } else { + return raw(resArray.join("")); + } +}; +Suspense[DOM_RENDERER] = SuspenseDomRenderer; +var textEncoder = new TextEncoder(); +var renderToReadableStream = (content, onError = console.trace) => { + let cancelled = false; + const reader = new ReadableStream({ + async start(controller) { + try { + if (content instanceof JSXNode) { + content = content.toString(); + } + const context = typeof content === "object" ? content : {}; + const resolved = await resolveCallback( + content, + HtmlEscapedCallbackPhase.BeforeStream, + true, + context + ); + if (!cancelled) { + controller.enqueue(textEncoder.encode(resolved)); + } + let resolvedCount = 0; + const callbacks = []; + const then = (promise) => { + callbacks.push( + promise.catch((err) => { + console.log(err); + onError(err); + return ""; + }).then(async (res) => { + res = await resolveCallback( + res, + HtmlEscapedCallbackPhase.BeforeStream, + true, + context + ); + res.callbacks?.map((c) => c({ phase: HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); + resolvedCount++; + if (!cancelled) { + controller.enqueue(textEncoder.encode(res)); + } + }) + ); + }; + resolved.callbacks?.map((c) => c({ phase: HtmlEscapedCallbackPhase.Stream, context })).filter(Boolean).forEach(then); + while (resolvedCount !== callbacks.length) { + await Promise.all(callbacks); + } + } catch (e) { + onError(e); + } + if (!cancelled) { + controller.close(); + } + }, + cancel() { + cancelled = true; + } + }); + return reader; +}; +export { + StreamingContext, + Suspense, + renderToReadableStream +}; diff --git a/tools/ui/node_modules/hono/dist/jsx/types.js b/tools/ui/node_modules/hono/dist/jsx/types.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/jsx/utils.js b/tools/ui/node_modules/hono/dist/jsx/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..d13a5edd206dde0a84683ab70c6169cb26780da9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/jsx/utils.js @@ -0,0 +1,175 @@ +// src/jsx/utils.ts +var normalizeElementKeyMap = /* @__PURE__ */ new Map([ + ["className", "class"], + ["htmlFor", "for"], + ["crossOrigin", "crossorigin"], + ["httpEquiv", "http-equiv"], + ["itemProp", "itemprop"], + ["fetchPriority", "fetchpriority"], + ["noModule", "nomodule"], + ["formAction", "formaction"] +]); +var normalizeIntrinsicElementKey = (key) => normalizeElementKeyMap.get(key) || key; +var invalidAttributeNameCharRe = /[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/; +var validAttributeNameCache = /* @__PURE__ */ new Set(); +var validAttributeNameCacheMax = 1024; +var invalidTagNameCharRe = /^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/; +var validTagNameCache = /* @__PURE__ */ new Set(); +var validTagNameCacheMax = 256; +var cacheValidName = (cache, max, name) => { + if (cache.size >= max) { + cache.clear(); + } + cache.add(name); +}; +var isValidTagName = (name) => { + if (validTagNameCache.has(name)) { + return true; + } + if (typeof name !== "string") { + return false; + } + if (name.length === 0) { + return true; + } + if (invalidTagNameCharRe.test(name)) { + return false; + } + cacheValidName(validTagNameCache, validTagNameCacheMax, name); + return true; +}; +var isValidAttributeName = (name) => { + if (validAttributeNameCache.has(name)) { + return true; + } + const len = name.length; + if (len === 0) { + return false; + } + for (let i = 0; i < len; i++) { + const c = name.charCodeAt(i); + if (!(c >= 97 && c <= 122 || // a-z + c >= 65 && c <= 90 || // A-Z + c >= 48 && c <= 57 || // 0-9 + c === 45 || // - + c === 95 || // _ + c === 46 || // . + c === 58)) { + if (!invalidAttributeNameCharRe.test(name)) { + cacheValidName(validAttributeNameCache, validAttributeNameCacheMax, name); + return true; + } else { + return false; + } + } + } + cacheValidName(validAttributeNameCache, validAttributeNameCacheMax, name); + return true; +}; +var invalidStylePropertyNameCharRe = /[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/; +var validStylePropertyNameCache = /* @__PURE__ */ new Set(); +var validStylePropertyNameCacheMax = 1024; +var isValidStylePropertyName = (name) => { + if (validStylePropertyNameCache.has(name)) { + return true; + } + const len = name.length; + if (len === 0) { + return false; + } + for (let i = 0; i < len; i++) { + const c = name.charCodeAt(i); + if (!(c >= 97 && c <= 122 || // a-z + c >= 65 && c <= 90 || // A-Z + c >= 48 && c <= 57 || // 0-9 + c === 45 || // - + c === 95)) { + if (!invalidStylePropertyNameCharRe.test(name)) { + cacheValidName(validStylePropertyNameCache, validStylePropertyNameCacheMax, name); + return true; + } else { + return false; + } + } + } + cacheValidName(validStylePropertyNameCache, validStylePropertyNameCacheMax, name); + return true; +}; +var unsafeStyleValueCharRe = /[;"'\\/\[\](){}]/; +var hasUnsafeStyleValue = (value) => { + if (!unsafeStyleValueCharRe.test(value)) { + return false; + } + let quote = 0; + const blockStack = []; + for (let i = 0, len = value.length; i < len; i++) { + const c = value.charCodeAt(i); + if (c === 92) { + if (i === len - 1) { + return true; + } + i++; + } else if (quote !== 0) { + if (c === 10 || c === 12 || c === 13) { + return true; + } + if (c === quote) { + quote = 0; + } + } else if (c === 47 && value.charCodeAt(i + 1) === 42) { + const end = value.indexOf("*/", i + 2); + if (end === -1) { + return true; + } + i = end + 1; + } else if (c === 34 || c === 39) { + quote = c; + } else if (c === 40) { + blockStack.push(41); + } else if (c === 91) { + blockStack.push(93); + } else if (c === 123 || c === 125) { + return true; + } else if (c === 41 || c === 93) { + if (blockStack[blockStack.length - 1] !== c) { + return true; + } + blockStack.pop(); + } else if (c === 59 && blockStack.length === 0) { + return true; + } + } + return quote !== 0 || blockStack.length !== 0; +}; +var styleObjectForEach = (style, fn) => { + for (const [k, v] of Object.entries(style)) { + const key = k[0] === "-" || !/[A-Z]/.test(k) ? k : k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`); + if (!isValidStylePropertyName(key)) { + continue; + } + if (v == null) { + fn(key, null); + continue; + } + let value; + if (typeof v === "number") { + value = !key.match( + /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/ + ) ? `${v}px` : `${v}`; + } else if (typeof v === "string") { + if (hasUnsafeStyleValue(v)) { + continue; + } + value = v; + } else { + continue; + } + fn(key, value); + } +}; +export { + isValidAttributeName, + isValidTagName, + normalizeIntrinsicElementKey, + styleObjectForEach +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/basic-auth/index.js b/tools/ui/node_modules/hono/dist/middleware/basic-auth/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e24723be2260ca7c107b7146d7def1b8deb7db27 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/basic-auth/index.js @@ -0,0 +1,66 @@ +// src/middleware/basic-auth/index.ts +import { HTTPException } from "../../http-exception.js"; +import { auth } from "../../utils/basic-auth.js"; +import { timingSafeEqual } from "../../utils/buffer.js"; +var basicAuth = (options, ...users) => { + const usernamePasswordInOptions = "username" in options && "password" in options; + const verifyUserInOptions = "verifyUser" in options; + if (!(usernamePasswordInOptions || verifyUserInOptions)) { + throw new Error( + 'basic auth middleware requires options for "username and password" or "verifyUser"' + ); + } + if (!options.realm) { + options.realm = "Secure Area"; + } + if (!options.invalidUserMessage) { + options.invalidUserMessage = "Unauthorized"; + } + if (usernamePasswordInOptions) { + users.unshift({ username: options.username, password: options.password }); + } + return async function basicAuth2(ctx, next) { + const requestUser = auth(ctx.req.raw); + if (requestUser) { + if (verifyUserInOptions) { + if (await options.verifyUser(requestUser.username, requestUser.password, ctx)) { + if (options.onAuthSuccess) { + await options.onAuthSuccess(ctx, requestUser.username); + } + await next(); + return; + } + } else { + for (const user of users) { + const [usernameEqual, passwordEqual] = await Promise.all([ + timingSafeEqual(user.username, requestUser.username, options.hashFunction), + timingSafeEqual(user.password, requestUser.password, options.hashFunction) + ]); + if (usernameEqual && passwordEqual) { + if (options.onAuthSuccess) { + await options.onAuthSuccess(ctx, requestUser.username); + } + await next(); + return; + } + } + } + } + const status = 401; + const headers = { + "WWW-Authenticate": 'Basic realm="' + options.realm?.replace(/"/g, '\\"') + '"' + }; + const responseMessage = typeof options.invalidUserMessage === "function" ? await options.invalidUserMessage(ctx) : options.invalidUserMessage; + const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { + status, + headers: { + ...headers, + "content-type": "application/json" + } + }); + throw new HTTPException(status, { res }); + }; +}; +export { + basicAuth +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/bearer-auth/index.js b/tools/ui/node_modules/hono/dist/middleware/bearer-auth/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4122792833b78d9560340164945f3083ef6b1b2b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/bearer-auth/index.js @@ -0,0 +1,92 @@ +// src/middleware/bearer-auth/index.ts +import { HTTPException } from "../../http-exception.js"; +import { timingSafeEqual } from "../../utils/buffer.js"; +var TOKEN_STRINGS = "[A-Za-z0-9._~+/-]+=*"; +var PREFIX = "Bearer"; +var HEADER = "Authorization"; +var bearerAuth = (options) => { + if (!("token" in options || "verifyToken" in options)) { + throw new Error('bearer auth middleware requires options for "token" or "verifyToken"'); + } + if (!options.realm) { + options.realm = ""; + } + if (options.prefix === void 0) { + options.prefix = PREFIX; + } + const realm = options.realm?.replace(/"/g, '\\"'); + const prefix = options.prefix; + const tokenRegexp = new RegExp(`^${TOKEN_STRINGS}$`); + const wwwAuthenticatePrefix = prefix === "" ? "" : `${prefix} `; + const throwHTTPException = async (c, status, wwwAuthenticateHeader, messageOption) => { + const wwwAuthenticateHeaderValue = typeof wwwAuthenticateHeader === "function" ? await wwwAuthenticateHeader(c) : wwwAuthenticateHeader; + const headers = { + "WWW-Authenticate": typeof wwwAuthenticateHeaderValue === "string" ? wwwAuthenticateHeaderValue : `${wwwAuthenticatePrefix}${Object.entries(wwwAuthenticateHeaderValue).map(([key, value]) => `${key}="${value}"`).join(",")}` + }; + const responseMessage = typeof messageOption === "function" ? await messageOption(c) : messageOption; + const res = typeof responseMessage === "string" ? new Response(responseMessage, { status, headers }) : new Response(JSON.stringify(responseMessage), { + status, + headers: { + ...headers, + "content-type": "application/json" + } + }); + throw new HTTPException(status, { res }); + }; + return async function bearerAuth2(c, next) { + const headerToken = c.req.header(options.headerName || HEADER); + if (!headerToken) { + await throwHTTPException( + c, + 401, + options.noAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}realm="${realm}"`, + options.noAuthenticationHeader?.message || options.noAuthenticationHeaderMessage || "Unauthorized" + ); + } else { + let tokenValue; + if (prefix === "") { + tokenValue = headerToken; + } else { + const headerLower = headerToken.toLowerCase(); + const prefixLower = prefix.toLowerCase(); + if (headerLower.startsWith(prefixLower) && headerToken[prefix.length] === " ") { + tokenValue = headerToken.slice(prefix.length).trimStart(); + } + } + if (!tokenValue || !tokenRegexp.test(tokenValue)) { + await throwHTTPException( + c, + 400, + options.invalidAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_request"`, + options.invalidAuthenticationHeader?.message || options.invalidAuthenticationHeaderMessage || "Bad Request" + ); + } else { + let equal = false; + if ("verifyToken" in options) { + equal = await options.verifyToken(tokenValue, c); + } else if (typeof options.token === "string") { + equal = await timingSafeEqual(options.token, tokenValue, options.hashFunction); + } else if (Array.isArray(options.token) && options.token.length > 0) { + for (const token of options.token) { + if (await timingSafeEqual(token, tokenValue, options.hashFunction)) { + equal = true; + break; + } + } + } + if (!equal) { + await throwHTTPException( + c, + 401, + options.invalidToken?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_token"`, + options.invalidToken?.message || options.invalidTokenMessage || "Unauthorized" + ); + } + } + } + await next(); + }; +}; +export { + bearerAuth +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/body-limit/index.js b/tools/ui/node_modules/hono/dist/middleware/body-limit/index.js new file mode 100644 index 0000000000000000000000000000000000000000..46db75204affcf5f8cc95cdb90bf4515c34144e5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/body-limit/index.js @@ -0,0 +1,53 @@ +// src/middleware/body-limit/index.ts +import { HTTPException } from "../../http-exception.js"; +var ERROR_MESSAGE = "Payload Too Large"; +var bodyLimit = (options) => { + const onError = options.onError || (() => { + const res = new Response(ERROR_MESSAGE, { + status: 413 + }); + throw new HTTPException(413, { res }); + }); + const maxSize = options.maxSize; + return async function bodyLimit2(c, next) { + if (!c.req.raw.body) { + return next(); + } + const hasTransferEncoding = c.req.raw.headers.has("transfer-encoding"); + const hasContentLength = c.req.raw.headers.has("content-length"); + if (hasContentLength && !hasTransferEncoding) { + const contentLength = parseInt(c.req.raw.headers.get("content-length") || "0", 10); + return contentLength > maxSize ? onError(c) : next(); + } + let size = 0; + const chunks = []; + const rawReader = c.req.raw.body.getReader(); + for (; ; ) { + const { done, value } = await rawReader.read(); + if (done) { + break; + } + size += value.length; + if (size > maxSize) { + return onError(c); + } + chunks.push(value); + } + const requestInit = { + body: new ReadableStream({ + start(controller) { + for (const chunk of chunks) { + controller.enqueue(chunk); + } + controller.close(); + } + }), + duplex: "half" + }; + c.req.raw = new Request(c.req.raw, requestInit); + return next(); + }; +}; +export { + bodyLimit +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/cache/index.js b/tools/ui/node_modules/hono/dist/middleware/cache/index.js new file mode 100644 index 0000000000000000000000000000000000000000..dbf24557baeb473cf1618b20c37b72c0aadd5783 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/cache/index.js @@ -0,0 +1,197 @@ +// src/middleware/cache/index.ts +import { cloneRawRequest } from "../../request.js"; +import { sha256 } from "../../utils/crypto.js"; +var defaultCacheableStatusCodes = [200]; +var defaultMaxQueryBodySize = 64 * 1024; +var cacheKeyPath = "/.hono/cache"; +var cacheKeyParameter = "__hono_cache_key"; +var cacheMethodKeyParameter = "__hono_cache_method"; +var queryDigestKeyParameter = "__hono_query_digest"; +var cacheVaryKeyParameter = "__hono_cache_vary"; +var queryRepresentationMetadataHeaders = [ + "content-type", + "content-encoding", + "content-language", + "content-location" +]; +var shouldSkipCacheControl = (cacheControl) => !!cacheControl && /(?:^|,\s*)(?:private|no-(?:store|cache))(?:\s*(?:=|,|$))/i.test(cacheControl); +var parseVaryDirectives = (vary) => { + if (vary == null) { + return []; + } + return (Array.isArray(vary) ? vary : vary.split(",")).map((directive) => directive.trim().toLowerCase()).filter(Boolean); +}; +var createCacheKey = (key, requestUrl, request, varyHeaders) => { + const url = new URL(cacheKeyPath, requestUrl); + url.searchParams.append(cacheKeyParameter, key.split("#", 1)[0]); + url.searchParams.append(cacheMethodKeyParameter, request.method); + if (request.method === "QUERY") { + url.searchParams.append(queryDigestKeyParameter, request.digest); + } + for (const header of varyHeaders) { + url.searchParams.append(cacheVaryKeyParameter, JSON.stringify(header)); + } + return url.href; +}; +var shouldSkipCache = (res, optionsVaryDirectives, responseVary) => responseVary.length && (!optionsVaryDirectives || responseVary.some((name) => !optionsVaryDirectives.has(name))) || shouldSkipCacheControl(res.headers.get("Cache-Control")) || res.headers.has("Set-Cookie"); +var reportCacheNotAvailable = (onCacheNotAvailable, reason) => { + if (onCacheNotAvailable === false) { + } else if (onCacheNotAvailable) { + onCacheNotAvailable(reason); + } else { + console.log(reason); + } +}; +var createQueryDigest = async (c, maxQueryBodySize) => { + if (!globalThis.crypto?.subtle) { + return void 0; + } + if (c.req.raw.bodyUsed && Object.keys(c.req.bodyCache)[0] === "formData") { + return void 0; + } + try { + const requestHeaders = c.req.raw.headers; + const metadata = new TextEncoder().encode( + JSON.stringify( + queryRepresentationMetadataHeaders.map((header) => [header, requestHeaders.get(header)]) + ) + ); + const body = (await cloneRawRequest(c.req)).body; + const chunks = []; + let bodySize = 0; + if (body) { + const reader = body.getReader(); + for (; ; ) { + const { done, value } = await reader.read(); + if (done) { + break; + } + bodySize += value.byteLength; + if (bodySize > maxQueryBodySize) { + void reader.cancel().catch(() => { + }); + return void 0; + } + chunks.push(value); + } + } + const data = new Uint8Array(metadata.byteLength + bodySize); + data.set(metadata); + let offset = metadata.byteLength; + for (const chunk of chunks) { + data.set(chunk, offset); + offset += chunk.byteLength; + } + return await sha256(data) ?? void 0; + } catch { + return void 0; + } +}; +var cache = (options) => { + if (!globalThis.caches) { + reportCacheNotAvailable( + options.onCacheNotAvailable, + "Cache Middleware is not enabled because caches is not defined." + ); + return async (_c, next) => await next(); + } + if (!globalThis.crypto?.subtle) { + reportCacheNotAvailable( + options.onCacheNotAvailable, + "Cache Middleware cannot cache QUERY requests because Web Crypto is not available." + ); + } + if (options.wait === void 0) { + options.wait = false; + } + const cacheControlDirectives = options.cacheControl?.split(",").map((directive) => directive.toLowerCase()); + const optionsVaryList = parseVaryDirectives(options.vary); + const varyDirectives = optionsVaryList.length ? new Set(optionsVaryList) : void 0; + if (varyDirectives?.has("*")) { + throw new Error( + 'Middleware vary configuration cannot include "*", as it disallows effective caching.' + ); + } + const cacheableStatusCodes = new Set( + options.cacheableStatusCodes ?? defaultCacheableStatusCodes + ); + const maxQueryBodySize = options.maxQueryBodySize ?? defaultMaxQueryBodySize; + const addHeader = (c, responseVary) => { + if (cacheControlDirectives) { + const existingDirectives = c.res.headers.get("Cache-Control")?.split(",").map((d) => d.trim().split("=", 1)[0].toLowerCase()) ?? []; + for (const directive of cacheControlDirectives) { + let [name, value] = directive.trim().split("=", 2); + name = name.toLowerCase(); + if (!existingDirectives.includes(name)) { + c.header("Cache-Control", `${name}${value ? `=${value}` : ""}`, { append: true }); + } + } + } + if (varyDirectives) { + if (responseVary.length === 0) { + c.header("Vary", Array.from(varyDirectives).join(", ")); + } else { + const merged = new Set(varyDirectives); + for (const directive of responseVary) { + merged.add(directive); + } + if (merged.has("*")) { + c.header("Vary", "*"); + } else { + c.header("Vary", Array.from(merged).join(", ")); + } + } + } + }; + return async function cache2(c, next) { + if (c.req.method !== "GET" && c.req.method !== "QUERY" || c.req.raw.headers.has("Authorization")) { + await next(); + return; + } + let cacheKeyRequest = { method: "GET" }; + if (c.req.method === "QUERY") { + const digest = await createQueryDigest(c, maxQueryBodySize); + if (digest === void 0) { + await next(); + return; + } + cacheKeyRequest = { method: "QUERY", digest }; + } + let key = c.req.url; + if (options.keyGenerator) { + key = await options.keyGenerator(c); + } + const varyHeaders = []; + if (varyDirectives) { + for (const directive of varyDirectives) { + const value = c.req.raw.headers.get(directive) ?? ""; + varyHeaders.push([directive, value]); + } + } + key = createCacheKey(key, c.req.url, cacheKeyRequest, varyHeaders); + const cacheName = typeof options.cacheName === "function" ? await options.cacheName(c) : options.cacheName; + const cache3 = await caches.open(cacheName); + const response = await cache3.match(key); + if (response) { + return new Response(response.body, response); + } + await next(); + if (!cacheableStatusCodes.has(c.res.status)) { + return; + } + const responseVary = parseVaryDirectives(c.res.headers.get("Vary")); + addHeader(c, responseVary); + if (shouldSkipCache(c.res, varyDirectives, responseVary)) { + return; + } + const res = c.res.clone(); + if (options.wait) { + await cache3.put(key, res); + } else { + c.executionCtx.waitUntil(cache3.put(key, res)); + } + }; +}; +export { + cache +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/combine/index.js b/tools/ui/node_modules/hono/dist/middleware/combine/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c16d91f3eaa46631cf460299a12cf1a52dab32df --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/combine/index.js @@ -0,0 +1,77 @@ +// src/middleware/combine/index.ts +import { compose } from "../../compose.js"; +import { METHOD_NAME_ALL } from "../../router.js"; +import { TrieRouter } from "../../router/trie-router/index.js"; +var some = (...middleware) => { + return async function some2(c, next) { + let isNextCalled = false; + const wrappedNext = () => { + isNextCalled = true; + return next(); + }; + let lastError; + for (const handler of middleware) { + try { + const result = await handler(c, wrappedNext); + if (result === true && !c.finalized) { + await wrappedNext(); + } else if (result === false) { + lastError = new Error("No successful middleware found"); + continue; + } + lastError = void 0; + break; + } catch (error) { + lastError = error; + if (isNextCalled) { + break; + } + } + } + if (lastError) { + throw lastError; + } + }; +}; +var every = (...middleware) => { + return async function every2(c, next) { + const currentRouteIndex = c.req.routeIndex; + await compose( + middleware.map((m) => [ + [ + async (c2, next2) => { + c2.req.routeIndex = currentRouteIndex; + const res = await m(c2, next2); + if (res === false) { + throw new Error("Unmet condition"); + } + return res; + } + ] + ]) + )(c, next); + }; +}; +var except = (condition, ...middleware) => { + let router = void 0; + const conditions = (Array.isArray(condition) ? condition : [condition]).map((condition2) => { + if (typeof condition2 === "string") { + router ||= new TrieRouter(); + router.add(METHOD_NAME_ALL, condition2, true); + } else { + return condition2; + } + }).filter(Boolean); + if (router) { + conditions.unshift((c) => !!router?.match(METHOD_NAME_ALL, c.req.path)?.[0]?.[0]?.[0]); + } + const handler = some((c) => conditions.some((cond) => cond(c)), every(...middleware)); + return async function except2(c, next) { + await handler(c, next); + }; +}; +export { + every, + except, + some +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/compress/index.js b/tools/ui/node_modules/hono/dist/middleware/compress/index.js new file mode 100644 index 0000000000000000000000000000000000000000..58ef0c7b89c4b1ce1b88b6a22d99d49bfdfc8690 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/compress/index.js @@ -0,0 +1,74 @@ +// src/middleware/compress/index.ts +import { parseAccept } from "../../utils/accept.js"; +import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from "../../utils/compress.js"; +var ENCODING_TYPES = ["gzip", "deflate"]; +var cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/i; +var selectEncoding = (header, candidates) => { + if (header === void 0) { + return void 0; + } + const accepts = parseAccept(header); + const wildcardQ = accepts.find((a) => a.type === "*")?.q; + let best; + for (const enc of candidates) { + const explicit = accepts.find((a) => a.type.toLowerCase() === enc); + const q = explicit ? explicit.q : wildcardQ ?? 0; + if (q === 1) { + return enc; + } else if (q > 0 && (!best || q > best.q)) { + best = { encoding: enc, q }; + } + } + return best?.encoding; +}; +var varyAcceptEncodingRegExp = /(?:^|,)\s*accept-encoding\s*(?:,|$)/i; +var compress = (options) => { + const threshold = options?.threshold ?? 1024; + const candidates = options?.encoding ? [options.encoding] : ENCODING_TYPES; + const contentTypeFilter = options?.contentTypeFilter ?? COMPRESSIBLE_CONTENT_TYPE_REGEX; + const shouldCompress = typeof contentTypeFilter === "function" ? (res) => { + const type = res.headers.get("Content-Type"); + return type && contentTypeFilter(type); + } : (res) => { + const type = res.headers.get("Content-Type"); + return type && contentTypeFilter.test(type); + }; + return async function compress2(ctx, next) { + await next(); + const contentLength = ctx.res.headers.get("Content-Length"); + if (ctx.res.status === 206 || // partial content, Content-Range refers to the uncompressed bytes + ctx.res.headers.has("Content-Encoding") || // already encoded + ctx.res.headers.has("Transfer-Encoding") || // already encoded or chunked + ctx.req.method === "HEAD" || // HEAD request + contentLength && Number(contentLength) < threshold || // content-length below threshold + !shouldCompress(ctx.res) || // not compressible type + !shouldTransform(ctx.res)) { + return; + } + const current = ctx.res.headers.get("Vary"); + if (current !== "*" && !(current && varyAcceptEncodingRegExp.test(current))) { + ctx.header("Vary", current ? `${current}, Accept-Encoding` : "Accept-Encoding"); + } + const accepted = ctx.req.header("Accept-Encoding"); + const encoding = selectEncoding(accepted, candidates); + if (!encoding || !ctx.res.body) { + return; + } + const stream = new CompressionStream(encoding); + ctx.res = new Response(ctx.res.body.pipeThrough(stream), ctx.res); + ctx.res.headers.delete("Content-Length"); + ctx.res.headers.set("Content-Encoding", encoding); + const etag = ctx.res.headers.get("ETag"); + if (etag && !etag.startsWith("W/")) { + ctx.res.headers.set("ETag", `W/${etag}`); + } + }; +}; +var shouldTransform = (res) => { + const cacheControl = res.headers.get("Cache-Control"); + return !cacheControl || !cacheControlNoTransformRegExp.test(cacheControl); +}; +export { + COMPRESSIBLE_CONTENT_TYPE_REGEX, + compress +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/context-storage/index.js b/tools/ui/node_modules/hono/dist/middleware/context-storage/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a1bd4c648c8576b20f22613904a8e855e42fed10 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/context-storage/index.js @@ -0,0 +1,23 @@ +// src/middleware/context-storage/index.ts +import { AsyncLocalStorage } from "node:async_hooks"; +var asyncLocalStorage = new AsyncLocalStorage(); +var contextStorage = () => { + return async function contextStorage2(c, next) { + await asyncLocalStorage.run(c, next); + }; +}; +var tryGetContext = () => { + return asyncLocalStorage.getStore(); +}; +var getContext = () => { + const context = tryGetContext(); + if (!context) { + throw new Error("Context is not available"); + } + return context; +}; +export { + contextStorage, + getContext, + tryGetContext +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/cors/index.js b/tools/ui/node_modules/hono/dist/middleware/cors/index.js new file mode 100644 index 0000000000000000000000000000000000000000..86e6daa613eebaa366221cace45f574cdae11849 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/cors/index.js @@ -0,0 +1,84 @@ +// src/middleware/cors/index.ts +var cors = (options) => { + const opts = { + origin: "*", + allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH", "QUERY"], + allowHeaders: [], + exposeHeaders: [], + ...options + }; + const findAllowOrigin = ((optsOrigin) => { + if (typeof optsOrigin === "string") { + if (optsOrigin === "*") { + return () => optsOrigin; + } else { + return (origin) => optsOrigin === origin ? origin : null; + } + } else if (typeof optsOrigin === "function") { + return optsOrigin; + } else { + return (origin) => optsOrigin.includes(origin) ? origin : null; + } + })(opts.origin); + const findAllowMethods = ((optsAllowMethods) => { + if (typeof optsAllowMethods === "function") { + return optsAllowMethods; + } else if (Array.isArray(optsAllowMethods)) { + return () => optsAllowMethods; + } else { + return () => []; + } + })(opts.allowMethods); + return async function cors2(c, next) { + function set(key, value) { + c.res.headers.set(key, value); + } + const allowOrigin = await findAllowOrigin(c.req.header("origin") || "", c); + if (allowOrigin) { + set("Access-Control-Allow-Origin", allowOrigin); + } + if (opts.credentials) { + set("Access-Control-Allow-Credentials", "true"); + } + if (opts.exposeHeaders?.length) { + set("Access-Control-Expose-Headers", opts.exposeHeaders.join(",")); + } + if (c.req.method === "OPTIONS") { + if (opts.origin !== "*") { + set("Vary", "Origin"); + } + if (opts.maxAge != null) { + set("Access-Control-Max-Age", opts.maxAge.toString()); + } + const allowMethods = await findAllowMethods(c.req.header("origin") || "", c); + if (allowMethods.length) { + set("Access-Control-Allow-Methods", allowMethods.join(",")); + } + let headers = opts.allowHeaders; + if (!headers?.length) { + const requestHeaders = c.req.header("Access-Control-Request-Headers"); + if (requestHeaders) { + headers = requestHeaders.split(",").map((h) => h.trim()); + } + } + if (headers?.length) { + set("Access-Control-Allow-Headers", headers.join(",")); + c.res.headers.append("Vary", "Access-Control-Request-Headers"); + } + c.res.headers.delete("Content-Length"); + c.res.headers.delete("Content-Type"); + return new Response(null, { + headers: c.res.headers, + status: 204, + statusText: "No Content" + }); + } + await next(); + if (opts.origin !== "*") { + c.header("Vary", "Origin", { append: true }); + } + }; +}; +export { + cors +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/csrf/index.js b/tools/ui/node_modules/hono/dist/middleware/csrf/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3df5b4ed278c57fb1534df892a0283091088e38f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/csrf/index.js @@ -0,0 +1,55 @@ +// src/middleware/csrf/index.ts +import { HTTPException } from "../../http-exception.js"; +var secFetchSiteValues = ["same-origin", "same-site", "none", "cross-site"]; +var isSecFetchSite = (value) => secFetchSiteValues.includes(value); +var isSafeMethodRe = /^(GET|HEAD)$/; +var isRequestedByFormElementRe = /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)\b/i; +var csrf = (options) => { + const originHandler = ((optsOrigin) => { + if (!optsOrigin) { + return (origin, c) => origin === new URL(c.req.url).origin; + } else if (typeof optsOrigin === "string") { + return (origin) => origin === optsOrigin; + } else if (typeof optsOrigin === "function") { + return optsOrigin; + } else { + return (origin) => optsOrigin.includes(origin); + } + })(options?.origin); + const isAllowedOrigin = async (origin, c) => { + if (origin === void 0) { + return false; + } + return await originHandler(origin, c); + }; + const secFetchSiteHandler = ((optsSecFetchSite) => { + if (!optsSecFetchSite) { + return (secFetchSite) => secFetchSite === "same-origin"; + } else if (typeof optsSecFetchSite === "string") { + return (secFetchSite) => secFetchSite === optsSecFetchSite; + } else if (typeof optsSecFetchSite === "function") { + return optsSecFetchSite; + } else { + return (secFetchSite) => optsSecFetchSite.includes(secFetchSite); + } + })(options?.secFetchSite); + const isAllowedSecFetchSite = async (secFetchSite, c) => { + if (secFetchSite === void 0) { + return false; + } + if (!isSecFetchSite(secFetchSite)) { + return false; + } + return await secFetchSiteHandler(secFetchSite, c); + }; + return async function csrf2(c, next) { + if (!isSafeMethodRe.test(c.req.method) && isRequestedByFormElementRe.test(c.req.header("content-type") || "text/plain") && !await isAllowedSecFetchSite(c.req.header("sec-fetch-site"), c) && !await isAllowedOrigin(c.req.header("origin"), c)) { + const res = new Response("Forbidden", { status: 403 }); + throw new HTTPException(403, { res }); + } + await next(); + }; +}; +export { + csrf +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/etag/digest.js b/tools/ui/node_modules/hono/dist/middleware/etag/digest.js new file mode 100644 index 0000000000000000000000000000000000000000..31f78bf4d32bf7d0fefd458739d1bc2ced9122af --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/etag/digest.js @@ -0,0 +1,33 @@ +// src/middleware/etag/digest.ts +var mergeBuffers = (buffer1, buffer2) => { + if (!buffer1) { + return buffer2; + } + const merged = new Uint8Array( + new ArrayBuffer(buffer1.byteLength + buffer2.byteLength) + ); + merged.set(new Uint8Array(buffer1), 0); + merged.set(buffer2, buffer1.byteLength); + return merged; +}; +var generateDigest = async (stream, generator) => { + if (!stream) { + return null; + } + let result = void 0; + const reader = stream.getReader(); + for (; ; ) { + const { value, done } = await reader.read(); + if (done) { + break; + } + result = await generator(mergeBuffers(result, value)); + } + if (!result) { + return null; + } + return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join(""); +}; +export { + generateDigest +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/etag/index.js b/tools/ui/node_modules/hono/dist/middleware/etag/index.js new file mode 100644 index 0000000000000000000000000000000000000000..be5c25b0c9a500d28f0aa33fccc7f6ba53f2e490 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/etag/index.js @@ -0,0 +1,73 @@ +// src/middleware/etag/index.ts +import { generateDigest } from "./digest.js"; +var RETAINED_304_HEADERS = [ + "cache-control", + "content-location", + "date", + "etag", + "expires", + "vary" +]; +var stripWeak = (tag) => tag.replace(/^W\//, ""); +function etagMatches(etag2, ifNoneMatch) { + return ifNoneMatch != null && ifNoneMatch.split(/,\s*/).some((t) => stripWeak(t) === stripWeak(etag2)); +} +function initializeGenerator(generator) { + if (!generator) { + if (crypto && crypto.subtle) { + generator = (body) => crypto.subtle.digest( + { + name: "SHA-1" + }, + body + ); + } + } + return generator; +} +var etag = (options) => { + const retainedHeaders = options?.retainedHeaders ?? RETAINED_304_HEADERS; + const weak = options?.weak ?? false; + const generator = initializeGenerator(options?.generateDigest); + return async function etag2(c, next) { + const ifNoneMatch = c.req.header("If-None-Match") ?? null; + await next(); + const res = c.res; + let etag3 = res.headers.get("ETag"); + if (!etag3) { + if (!generator) { + return; + } + const hash = await generateDigest( + // This type casing avoids the type error for `deno publish` + res.clone().body, + generator + ); + if (hash === null) { + return; + } + etag3 = weak ? `W/"${hash}"` : `"${hash}"`; + } + const matched = ifNoneMatch === "*" ? (c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") && res.ok : etagMatches(etag3, ifNoneMatch); + if (matched) { + c.res = new Response(null, { + status: 304, + statusText: "Not Modified", + headers: { + ETag: etag3 + } + }); + c.res.headers.forEach((_, key) => { + if (retainedHeaders.indexOf(key.toLowerCase()) === -1) { + c.res.headers.delete(key); + } + }); + } else { + c.res.headers.set("ETag", etag3); + } + }; +}; +export { + RETAINED_304_HEADERS, + etag +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/ip-restriction/index.js b/tools/ui/node_modules/hono/dist/middleware/ip-restriction/index.js new file mode 100644 index 0000000000000000000000000000000000000000..255ac9954b987ff7d6b63f91710e2b11890dd96b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/ip-restriction/index.js @@ -0,0 +1,162 @@ +// src/middleware/ip-restriction/index.ts +import { HTTPException } from "../../http-exception.js"; +import { + convertIPv4MappedIPv6ToIPv4, + convertIPv4ToBinary, + convertIPv6BinaryToString, + convertIPv6ToBinary, + distinctRemoteAddr, + isIPv4MappedIPv6, + INVALID_IP_ADDRESS_ERROR_CODE +} from "../../utils/ipaddr.js"; +var IS_CIDR_NOTATION_REGEX = /\/[^/]*$/; +var parseCidrPrefix = (rule, prefix, max) => { + if (!/^[0-9]{1,3}$/.test(prefix)) { + throw new TypeError(`Invalid rule: ${rule}`); + } + const parsedPrefix = parseInt(prefix); + if (parsedPrefix > max) { + throw new TypeError(`Invalid rule: ${rule}`); + } + return parsedPrefix; +}; +var buildMatcher = (rules) => { + const functionRules = []; + const staticRules = /* @__PURE__ */ new Set(); + const staticIPv4Rules = /* @__PURE__ */ new Set(); + const staticIPv6Rules = /* @__PURE__ */ new Set(); + const cidrRules = []; + const registerStaticRule = (rule) => { + const type = distinctRemoteAddr(rule); + if (type === void 0) { + throw new TypeError(`Invalid rule: ${rule}`); + } + if (type === "IPv4") { + const ipv4binary = convertIPv4ToBinary(rule); + staticRules.add(rule); + staticRules.add(`::ffff:${rule}`); + staticIPv4Rules.add(ipv4binary); + staticIPv6Rules.add(0xffffn << 32n | ipv4binary); + } else { + const ipv6binary = convertIPv6ToBinary(rule); + const ipv6Addr = convertIPv6BinaryToString(ipv6binary); + staticRules.add(ipv6Addr); + staticIPv6Rules.add(ipv6binary); + if (isIPv4MappedIPv6(ipv6binary)) { + staticRules.add(ipv6Addr.substring(7)); + staticIPv4Rules.add(convertIPv4MappedIPv6ToIPv4(ipv6binary)); + } + } + }; + for (let rule of rules) { + if (rule === "*") { + return () => true; + } else if (typeof rule === "function") { + functionRules.push(rule); + } else { + if (IS_CIDR_NOTATION_REGEX.test(rule)) { + const separatedRule = rule.split("/"); + const addrStr = separatedRule[0]; + const type = distinctRemoteAddr(addrStr); + if (type === void 0) { + throw new TypeError(`Invalid rule: ${rule}`); + } + let isIPv4 = type === "IPv4"; + let prefix = parseCidrPrefix(rule, separatedRule[1], isIPv4 ? 32 : 128); + if (isIPv4 ? prefix === 32 : prefix === 128) { + rule = addrStr; + } else { + let addr = (isIPv4 ? convertIPv4ToBinary : convertIPv6ToBinary)(addrStr); + if (type === "IPv6" && isIPv4MappedIPv6(addr) && prefix >= 96) { + isIPv4 = true; + addr = convertIPv4MappedIPv6ToIPv4(addr); + prefix -= 96; + } + const mask = (1n << BigInt(prefix)) - 1n << BigInt((isIPv4 ? 32 : 128) - prefix); + cidrRules.push([isIPv4, addr & mask, mask]); + continue; + } + } + registerStaticRule(rule); + } + } + return (remote) => { + if (staticRules.has(remote.addr)) { + return true; + } + const remoteAddr = remote.binaryAddr ||= (remote.isIPv4 ? convertIPv4ToBinary : convertIPv6ToBinary)(remote.addr); + const remoteIPv4Addr = remote.isIPv4 || isIPv4MappedIPv6(remoteAddr) ? remote.isIPv4 ? remoteAddr : convertIPv4MappedIPv6ToIPv4(remoteAddr) : void 0; + if ((remote.isIPv4 ? staticIPv4Rules : staticIPv6Rules).has(remoteAddr)) { + return true; + } + for (const [isIPv4, addr, mask] of cidrRules) { + if (isIPv4) { + if (remoteIPv4Addr === void 0) { + continue; + } + if ((remoteIPv4Addr & mask) === addr) { + return true; + } + continue; + } + if (remote.isIPv4) { + continue; + } + if ((remoteAddr & mask) === addr) { + return true; + } + } + for (const rule of functionRules) { + if (rule({ addr: remote.addr, type: remote.type })) { + return true; + } + } + return false; + }; +}; +var ipRestriction = (getIP, { denyList = [], allowList = [] }, onError) => { + const allowLength = allowList.length; + const denyMatcher = buildMatcher(denyList); + const allowMatcher = buildMatcher(allowList); + const blockError = (c) => new HTTPException(403, { + res: c.text("Forbidden", { + status: 403 + }) + }); + return async function ipRestriction2(c, next) { + const connInfo = getIP(c); + const addr = typeof connInfo === "string" ? connInfo : connInfo.remote.address; + if (!addr) { + throw blockError(c); + } + const type = typeof connInfo !== "string" && connInfo.remote.addressType || distinctRemoteAddr(addr); + const remoteData = { addr, type, isIPv4: type === "IPv4" }; + try { + if (denyMatcher(remoteData)) { + if (onError) { + return onError({ addr, type }, c); + } + throw blockError(c); + } + if (allowMatcher(remoteData)) { + return await next(); + } + } catch (e) { + if (e instanceof TypeError && e.code === INVALID_IP_ADDRESS_ERROR_CODE) { + throw blockError(c); + } + throw e; + } + if (allowLength === 0) { + return await next(); + } else { + if (onError) { + return await onError({ addr, type }, c); + } + throw blockError(c); + } + }; +}; +export { + ipRestriction +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/jsx-renderer/index.js b/tools/ui/node_modules/hono/dist/middleware/jsx-renderer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6029088273c0da4282246cd1427cb6f5fe780454 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/jsx-renderer/index.js @@ -0,0 +1,58 @@ +// src/middleware/jsx-renderer/index.ts +import { html, raw } from "../../helper/html/index.js"; +import { Fragment, createContext, jsx, useContext } from "../../jsx/index.js"; +import { renderToReadableStream } from "../../jsx/streaming.js"; +var RequestContext = createContext(null); +var createRenderer = (c, Layout, component, options) => (children, props) => { + options = typeof options === "function" ? options(c) : options; + const docType = typeof options?.docType === "string" ? options.docType : options?.docType === false ? "" : ""; + const currentLayout = component ? jsx( + (props2) => component(props2, c), + { + Layout, + ...props + }, + children + ) : children; + const body = html`${raw(docType)}${jsx( + RequestContext.Provider, + { value: c }, + currentLayout + )}`; + if (options?.stream) { + if (options.stream === true) { + c.header("Transfer-Encoding", "chunked"); + c.header("Content-Type", "text/html; charset=UTF-8"); + c.header("Content-Encoding", "Identity"); + } else { + for (const [key, value] of Object.entries(options.stream)) { + c.header(key, value); + } + } + return c.body(renderToReadableStream(body)); + } else { + return c.html(body); + } +}; +var jsxRenderer = (component, options) => function jsxRenderer2(c, next) { + const Layout = c.getLayout() ?? Fragment; + if (component) { + c.setLayout((props) => { + return component({ ...props, Layout }, c); + }); + } + c.setRenderer(createRenderer(c, Layout, component, options)); + return next(); +}; +var useRequestContext = () => { + const c = useContext(RequestContext); + if (!c) { + throw new Error("RequestContext is not provided."); + } + return c; +}; +export { + RequestContext, + jsxRenderer, + useRequestContext +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/jwk/index.js b/tools/ui/node_modules/hono/dist/middleware/jwk/index.js new file mode 100644 index 0000000000000000000000000000000000000000..310baa62dfb8a715318046fb8f8b7c20163d684b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/jwk/index.js @@ -0,0 +1,5 @@ +// src/middleware/jwk/index.ts +import { jwk } from "./jwk.js"; +export { + jwk +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/jwk/jwk.js b/tools/ui/node_modules/hono/dist/middleware/jwk/jwk.js new file mode 100644 index 0000000000000000000000000000000000000000..aa1865cfba6467e9acc47a9543f3a7034d289d0e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/jwk/jwk.js @@ -0,0 +1,117 @@ +// src/middleware/jwk/jwk.ts +import { getCookie, getSignedCookie } from "../../helper/cookie/index.js"; +import { HTTPException } from "../../http-exception.js"; +import { Jwt } from "../../utils/jwt/index.js"; +import "../../context.js"; +var jwk = (options, init) => { + const verifyOpts = options.verification || {}; + if (!options || !(options.keys || options.jwks_uri)) { + throw new Error('JWK auth middleware requires options for either "keys" or "jwks_uri" or both'); + } + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWK auth middleware requires it."); + } + return async function jwk2(ctx, next) { + const headerName = options.headerName || "Authorization"; + const credentials = ctx.req.raw.headers.get(headerName); + let token; + if (credentials) { + const parts = credentials.split(/\s+/); + if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") { + const errDescription = "invalid credentials structure"; + throw new HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } else { + token = parts[1]; + } + } else if (options.cookie) { + if (typeof options.cookie == "string") { + token = getCookie(ctx, options.cookie); + } else if (options.cookie.secret) { + if (options.cookie.prefixOptions) { + token = await getSignedCookie( + ctx, + options.cookie.secret, + options.cookie.key, + options.cookie.prefixOptions + ); + } else { + token = await getSignedCookie(ctx, options.cookie.secret, options.cookie.key); + } + } else { + if (options.cookie.prefixOptions) { + token = getCookie(ctx, options.cookie.key, options.cookie.prefixOptions); + } else { + token = getCookie(ctx, options.cookie.key); + } + } + } + if (!token) { + if (options.allow_anon) { + return next(); + } + const errDescription = "no authorization included in request"; + throw new HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } + let payload; + let cause; + try { + const keys = typeof options.keys === "function" ? await options.keys(ctx) : options.keys; + const jwks_uri = typeof options.jwks_uri === "function" ? await options.jwks_uri(ctx) : options.jwks_uri; + payload = await Jwt.verifyWithJwks( + token, + { keys, jwks_uri, verification: verifyOpts, allowedAlgorithms: options.alg }, + init + ); + } catch (e) { + cause = e; + } + if (!payload) { + if (cause instanceof Error && cause.constructor === Error) { + throw cause; + } + throw new HTTPException(401, { + message: "Unauthorized", + res: unauthorizedResponse({ + ctx, + error: "invalid_token", + statusText: "Unauthorized", + errDescription: "token verification failure", + realm: options.realm + }), + cause + }); + } + ctx.set("jwtPayload", payload); + await next(); + }; +}; +function unauthorizedResponse(opts) { + const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, '\\"'); + const errDescription = opts.errDescription.replace(/"/g, '\\"'); + return new Response("Unauthorized", { + status: 401, + statusText: opts.statusText, + headers: { + "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` + } + }); +} +export { + jwk +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/jwt/index.js b/tools/ui/node_modules/hono/dist/middleware/jwt/index.js new file mode 100644 index 0000000000000000000000000000000000000000..86bd76e8c80717e8e8f48904eeee55c84d70aac6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/jwt/index.js @@ -0,0 +1,11 @@ +// src/middleware/jwt/index.ts +import { jwt, verifyWithJwks, verify, decode, sign } from "./jwt.js"; +import { AlgorithmTypes } from "../../utils/jwt/jwa.js"; +export { + AlgorithmTypes, + decode, + jwt, + sign, + verify, + verifyWithJwks +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/jwt/jwt.js b/tools/ui/node_modules/hono/dist/middleware/jwt/jwt.js new file mode 100644 index 0000000000000000000000000000000000000000..fb565c51a45f2f318248802aea120fa96fbc9087 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/jwt/jwt.js @@ -0,0 +1,119 @@ +// src/middleware/jwt/jwt.ts +import { getCookie, getSignedCookie } from "../../helper/cookie/index.js"; +import { HTTPException } from "../../http-exception.js"; +import { Jwt } from "../../utils/jwt/index.js"; +import "../../context.js"; +var jwt = (options) => { + const verifyOpts = options.verification || {}; + if (!options || !options.secret) { + throw new Error('JWT auth middleware requires options for "secret"'); + } + if (!options.alg) { + throw new Error('JWT auth middleware requires options for "alg"'); + } + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); + } + return async function jwt2(ctx, next) { + const headerName = options.headerName || "Authorization"; + const credentials = ctx.req.raw.headers.get(headerName); + let token; + if (credentials) { + const parts = credentials.split(/\s+/); + if (parts.length !== 2 || parts[0].toLowerCase() !== "bearer") { + const errDescription = "invalid credentials structure"; + throw new HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } else { + token = parts[1]; + } + } else if (options.cookie) { + if (typeof options.cookie == "string") { + token = getCookie(ctx, options.cookie); + } else if (options.cookie.secret) { + if (options.cookie.prefixOptions) { + token = await getSignedCookie( + ctx, + options.cookie.secret, + options.cookie.key, + options.cookie.prefixOptions + ); + } else { + token = await getSignedCookie(ctx, options.cookie.secret, options.cookie.key); + } + } else { + if (options.cookie.prefixOptions) { + token = getCookie(ctx, options.cookie.key, options.cookie.prefixOptions); + } else { + token = getCookie(ctx, options.cookie.key); + } + } + } + if (!token) { + const errDescription = "no authorization included in request"; + throw new HTTPException(401, { + message: errDescription, + res: unauthorizedResponse({ + ctx, + error: "invalid_request", + errDescription, + realm: options.realm + }) + }); + } + let payload; + let cause; + try { + payload = await Jwt.verify(token, options.secret, { + alg: options.alg, + ...verifyOpts + }); + } catch (e) { + cause = e; + } + if (!payload) { + throw new HTTPException(401, { + message: "Unauthorized", + res: unauthorizedResponse({ + ctx, + error: "invalid_token", + statusText: "Unauthorized", + errDescription: "token verification failure", + realm: options.realm + }), + cause + }); + } + ctx.set("jwtPayload", payload); + await next(); + }; +}; +function unauthorizedResponse(opts) { + const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, '\\"'); + const errDescription = opts.errDescription.replace(/"/g, '\\"'); + return new Response("Unauthorized", { + status: 401, + statusText: opts.statusText, + headers: { + "WWW-Authenticate": `Bearer realm="${realm}",error="${opts.error}",error_description="${errDescription}"` + } + }); +} +var verifyWithJwks = Jwt.verifyWithJwks; +var verify = Jwt.verify; +var decode = Jwt.decode; +var sign = Jwt.sign; +export { + decode, + jwt, + sign, + verify, + verifyWithJwks +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/language/index.js b/tools/ui/node_modules/hono/dist/middleware/language/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9455c6194aef8136f68cb5439ae933a925a81457 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/language/index.js @@ -0,0 +1,15 @@ +// src/middleware/language/index.ts +import { + languageDetector, + detectFromCookie, + detectFromHeader, + detectFromPath, + detectFromQuery +} from "./language.js"; +export { + detectFromCookie, + detectFromHeader, + detectFromPath, + detectFromQuery, + languageDetector +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/language/language.js b/tools/ui/node_modules/hono/dist/middleware/language/language.js new file mode 100644 index 0000000000000000000000000000000000000000..c729954c15c72ecdf0bcb03ad053bf0d7784303a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/language/language.js @@ -0,0 +1,172 @@ +// src/middleware/language/language.ts +import { setCookie, getCookie } from "../../helper/cookie/index.js"; +import { parseAccept } from "../../utils/accept.js"; +var DEFAULT_OPTIONS = { + order: ["querystring", "cookie", "header"], + lookupQueryString: "lang", + lookupCookie: "language", + lookupFromHeaderKey: "accept-language", + lookupFromPathIndex: 0, + caches: ["cookie"], + ignoreCase: true, + fallbackLanguage: "en", + supportedLanguages: ["en"], + cookieOptions: { + sameSite: "Strict", + secure: true, + maxAge: 365 * 24 * 60 * 60, + httpOnly: true + }, + debug: false +}; +function parseAcceptLanguage(header) { + return parseAccept(header).map(({ type, q }) => ({ lang: type, q })); +} +var normalizeLanguage = (lang, options) => { + if (!lang) { + return void 0; + } + try { + let normalizedLang = lang.trim(); + if (options.convertDetectedLanguage) { + normalizedLang = options.convertDetectedLanguage(normalizedLang); + } + const compLang = options.ignoreCase ? normalizedLang.toLowerCase() : normalizedLang; + const compSupported = options.supportedLanguages.map( + (l) => options.ignoreCase ? l.toLowerCase() : l + ); + const exactIndex = compSupported.indexOf(compLang); + if (exactIndex !== -1) { + return options.supportedLanguages[exactIndex]; + } + let longestMatchIndex = -1; + let longestMatchLength = -1; + for (let i = 0; i < compSupported.length; i++) { + const candidate = compSupported[i]; + if (candidate.length < compLang.length && candidate.length > longestMatchLength && compLang.startsWith(candidate) && compLang[candidate.length] === "-") { + longestMatchIndex = i; + longestMatchLength = candidate.length; + } + } + if (longestMatchIndex !== -1) { + return options.supportedLanguages[longestMatchIndex]; + } + return void 0; + } catch { + return void 0; + } +}; +var detectFromQuery = (c, options) => { + const query = c.req.query(options.lookupQueryString); + return normalizeLanguage(query, options); +}; +var detectFromCookie = (c, options) => { + const cookie = getCookie(c, options.lookupCookie); + return normalizeLanguage(cookie, options); +}; +function detectFromHeader(c, options) { + try { + const acceptLanguage = c.req.header(options.lookupFromHeaderKey); + if (!acceptLanguage) { + return void 0; + } + const languages = parseAcceptLanguage(acceptLanguage); + for (const { lang } of languages) { + const normalizedLang = normalizeLanguage(lang, options); + if (normalizedLang) { + return normalizedLang; + } + } + return void 0; + } catch { + return void 0; + } +} +function detectFromPath(c, options) { + const url = new URL(c.req.url); + const pathSegments = url.pathname.split("/").filter(Boolean); + const langSegment = pathSegments[options.lookupFromPathIndex]; + return normalizeLanguage(langSegment, options); +} +var detectors = { + querystring: detectFromQuery, + cookie: detectFromCookie, + header: detectFromHeader, + path: detectFromPath +}; +function validateOptions(options) { + if (!options.supportedLanguages.includes(options.fallbackLanguage)) { + throw new Error("Fallback language must be included in supported languages"); + } + if (options.lookupFromPathIndex < 0) { + throw new Error("Path index must be non-negative"); + } + if (!options.order.every((detector) => Object.keys(detectors).includes(detector))) { + throw new Error("Invalid detector type in order array"); + } +} +function cacheLanguage(c, language, options) { + if (!Array.isArray(options.caches) || !options.caches.includes("cookie")) { + return; + } + try { + setCookie(c, options.lookupCookie, language, options.cookieOptions); + } catch (error) { + if (options.debug) { + console.error("Failed to cache language:", error); + } + } +} +var detectLanguage = (c, options) => { + let detectedLang; + for (const detectorName of options.order) { + const detector = detectors[detectorName]; + try { + detectedLang = detector(c, options); + if (detectedLang) { + if (options.debug) { + console.log(`Language detected from ${detectorName}: ${detectedLang}`); + } + break; + } + } catch (error) { + if (options.debug) { + console.error(`Error in ${detectorName} detector:`, error); + } + continue; + } + } + const finalLang = detectedLang || options.fallbackLanguage; + if (detectedLang && options.caches) { + cacheLanguage(c, finalLang, options); + } + return finalLang; +}; +var languageDetector = (userOptions) => { + const options = { + ...DEFAULT_OPTIONS, + ...userOptions, + cookieOptions: { + ...DEFAULT_OPTIONS.cookieOptions, + ...userOptions.cookieOptions + } + }; + validateOptions(options); + return async function languageDetector2(ctx, next) { + const lang = detectLanguage(ctx, options); + ctx.set("language", lang); + await next(); + }; +}; +export { + DEFAULT_OPTIONS, + detectFromCookie, + detectFromHeader, + detectFromPath, + detectFromQuery, + detectors, + languageDetector, + normalizeLanguage, + parseAcceptLanguage, + validateOptions +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/logger/index.js b/tools/ui/node_modules/hono/dist/middleware/logger/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2a727b686b6354815280dd37a9267882fe3977c7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/logger/index.js @@ -0,0 +1,44 @@ +// src/middleware/logger/index.ts +import { getColorEnabledAsync } from "../../utils/color.js"; +var humanize = (times) => { + const [delimiter, separator] = [",", "."]; + const orderTimes = times.map((v) => v.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter)); + return orderTimes.join(separator); +}; +var time = (start) => { + const delta = Date.now() - start; + return humanize([delta < 1e3 ? delta + "ms" : Math.round(delta / 1e3) + "s"]); +}; +var colorStatus = async (status) => { + const colorEnabled = await getColorEnabledAsync(); + if (colorEnabled) { + switch (status / 100 | 0) { + case 5: + return `\x1B[31m${status}\x1B[0m`; + case 4: + return `\x1B[33m${status}\x1B[0m`; + case 3: + return `\x1B[36m${status}\x1B[0m`; + case 2: + return `\x1B[32m${status}\x1B[0m`; + } + } + return `${status}`; +}; +async function log(fn, prefix, method, path, status = 0, elapsed) { + const out = prefix === "<--" /* Incoming */ ? `${prefix} ${method} ${path}` : `${prefix} ${method} ${path} ${await colorStatus(status)} ${elapsed}`; + fn(out); +} +var logger = (fn = console.log) => { + return async function logger2(c, next) { + const { method, url } = c.req; + const path = url.slice(url.indexOf("/", 8)); + await log(fn, "<--" /* Incoming */, method, path); + const start = Date.now(); + await next(); + await log(fn, "-->" /* Outgoing */, method, path, c.res.status, time(start)); + }; +}; +export { + logger +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/method-not-allowed/index.js b/tools/ui/node_modules/hono/dist/middleware/method-not-allowed/index.js new file mode 100644 index 0000000000000000000000000000000000000000..10aa84c98c76b09d54c0ad4d2a8eec063660cedf --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/method-not-allowed/index.js @@ -0,0 +1,68 @@ +// src/middleware/method-not-allowed/index.ts +import { basePath, matchedRoutes } from "../../helper/route/index.js"; +import { METHOD_NAME_ALL } from "../../router.js"; +import { TrieRouter } from "../../router/trie-router/index.js"; +var methodNotAllowed = (options) => { + let methodRouter; + return async function methodNotAllowed2(c, next) { + const routeIndex = c.req.routeIndex; + await next(); + if (c.res.status !== 404) { + return; + } + if (c.error) { + return; + } + if (!methodRouter) { + const methodsByPath = /* @__PURE__ */ new Map(); + for (const route of options.app.routes) { + if (route.method === METHOD_NAME_ALL || route.method === "HEAD") { + continue; + } + const methods2 = methodsByPath.get(route.path) ?? /* @__PURE__ */ new Set(); + methods2.add(route.method); + if (route.method === "GET") { + methods2.add("HEAD"); + } + methodsByPath.set(route.path, methods2); + } + methodRouter = new TrieRouter(); + for (const [path, methods2] of methodsByPath) { + methodRouter.add(METHOD_NAME_ALL, path, [...methods2]); + } + } + let requestPath = c.req.path; + const routes = matchedRoutes(c); + const currentRoute = routes[routeIndex]; + const sourceRoute = options.app.routes.find((route) => route.handler === methodNotAllowed2); + if (currentRoute && sourceRoute) { + const currentBasePathParts = basePath(c, routeIndex).split("/").filter(Boolean); + const sourceBasePathLength = sourceRoute.basePath.split("/").filter(Boolean).length; + const mountBasePathParts = currentBasePathParts.slice( + 0, + currentBasePathParts.length - sourceBasePathLength + ); + if (mountBasePathParts.length > 0) { + const mountBasePath = `/${mountBasePathParts.join("/")}`; + requestPath = c.req.path.slice(mountBasePath.length) || "/"; + } + } + const allowedMethods = /* @__PURE__ */ new Set(); + for (const [methods2] of methodRouter.match(METHOD_NAME_ALL, requestPath)[0]) { + for (const method of methods2) { + allowedMethods.add(method); + } + } + if (allowedMethods.size === 0 || allowedMethods.has(c.req.method)) { + return; + } + c.res.headers.delete("Allow"); + c.res.headers.delete("Content-Length"); + const methods = [...allowedMethods]; + const allow = methods.join(", "); + c.res = options.onMethodNotAllowed ? await options.onMethodNotAllowed(c, methods) : c.text("Method Not Allowed", 405, { Allow: allow }); + }; +}; +export { + methodNotAllowed +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/method-override/index.js b/tools/ui/node_modules/hono/dist/middleware/method-override/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1b4fa484b111ecaa74ccc4959194502d8a04a4de --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/method-override/index.js @@ -0,0 +1,84 @@ +// src/middleware/method-override/index.ts +import { parseBody } from "../../utils/body.js"; +var DEFAULT_METHOD_FORM_NAME = "_method"; +var methodOverride = (options) => async function methodOverride2(c, next) { + if (c.req.method === "GET") { + return await next(); + } + const app = options.app; + if (!(options.header || options.query)) { + const contentType = c.req.header("content-type"); + const methodFormName = options.form || DEFAULT_METHOD_FORM_NAME; + const clonedRequest = c.req.raw.clone(); + const newRequest = clonedRequest.clone(); + if (contentType?.startsWith("multipart/form-data")) { + const form = await clonedRequest.formData(); + const method = form.get(methodFormName); + if (method) { + const newForm = await newRequest.formData(); + newForm.delete(methodFormName); + const newHeaders = new Headers(clonedRequest.headers); + newHeaders.delete("content-type"); + newHeaders.delete("content-length"); + const request = new Request(c.req.url, { + body: newForm, + headers: newHeaders, + method + }); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } + if (contentType?.startsWith("application/x-www-form-urlencoded")) { + const params = await parseBody(clonedRequest); + const method = params[methodFormName]; + if (method) { + delete params[methodFormName]; + const newParams = new URLSearchParams(params); + const request = new Request(newRequest, { + body: newParams, + method + }); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } + } else if (options.header) { + const headerName = options.header; + const method = c.req.header(headerName); + if (method) { + const newHeaders = new Headers(c.req.raw.headers); + newHeaders.delete(headerName); + const request = new Request(c.req.raw, { + headers: newHeaders, + method + }); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } else if (options.query) { + const queryName = options.query; + const method = c.req.query(queryName); + if (method) { + const url = new URL(c.req.url); + url.searchParams.delete(queryName); + const requestInit = { + body: c.req.raw.body, + headers: c.req.raw.headers, + method, + duplex: c.req.raw.body ? "half" : void 0 + }; + const request = new Request(url.toString(), requestInit); + return app.fetch(request, c.env, getExecutionCtx(c)); + } + } + await next(); +}; +var getExecutionCtx = (c) => { + let executionCtx; + try { + executionCtx = c.executionCtx; + } catch { + } + return executionCtx; +}; +export { + methodOverride +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/powered-by/index.js b/tools/ui/node_modules/hono/dist/middleware/powered-by/index.js new file mode 100644 index 0000000000000000000000000000000000000000..827f65f5b83de6be8df455acb23e37b9fd80f6a1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/powered-by/index.js @@ -0,0 +1,10 @@ +// src/middleware/powered-by/index.ts +var poweredBy = (options) => { + return async function poweredBy2(c, next) { + await next(); + c.res.headers.set("X-Powered-By", options?.serverName ?? "Hono"); + }; +}; +export { + poweredBy +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/pretty-json/index.js b/tools/ui/node_modules/hono/dist/middleware/pretty-json/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5bb7163cd486343f7896829fea0d82a429cd34b2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/pretty-json/index.js @@ -0,0 +1,15 @@ +// src/middleware/pretty-json/index.ts +var prettyJSON = (options) => { + const targetQuery = options?.query ?? "pretty"; + return async function prettyJSON2(c, next) { + const pretty = options?.force || c.req.query(targetQuery) || c.req.query(targetQuery) === ""; + await next(); + if (pretty && c.res.headers.get("Content-Type")?.startsWith("application/json")) { + const obj = await c.res.json(); + c.res = new Response(JSON.stringify(obj, null, options?.space ?? 2), c.res); + } + }; +}; +export { + prettyJSON +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/request-id/index.js b/tools/ui/node_modules/hono/dist/middleware/request-id/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3f6a0772eb750b9386769e0272bae4b05344f1c4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/request-id/index.js @@ -0,0 +1,5 @@ +// src/middleware/request-id/index.ts +import { requestId } from "./request-id.js"; +export { + requestId +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/request-id/request-id.js b/tools/ui/node_modules/hono/dist/middleware/request-id/request-id.js new file mode 100644 index 0000000000000000000000000000000000000000..0c22de6e1e9c4aecc9591503d6bce9ba678357c3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/request-id/request-id.js @@ -0,0 +1,21 @@ +// src/middleware/request-id/request-id.ts +var requestId = ({ + limitLength = 255, + headerName = "X-Request-Id", + generator = () => crypto.randomUUID() +} = {}) => { + return async function requestId2(c, next) { + let reqId = headerName ? c.req.header(headerName) : void 0; + if (!reqId || reqId.length > limitLength || /[^\w\-=]/.test(reqId)) { + reqId = generator(c); + } + c.set("requestId", reqId); + if (headerName) { + c.header(headerName, reqId); + } + await next(); + }; +}; +export { + requestId +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/secure-headers/index.js b/tools/ui/node_modules/hono/dist/middleware/secure-headers/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7983a6f9543db288ea058e56e8971f453e6aa5f6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/secure-headers/index.js @@ -0,0 +1,6 @@ +// src/middleware/secure-headers/index.ts +import { NONCE, secureHeaders } from "./secure-headers.js"; +export { + NONCE, + secureHeaders +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js b/tools/ui/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/middleware/secure-headers/secure-headers.js b/tools/ui/node_modules/hono/dist/middleware/secure-headers/secure-headers.js new file mode 100644 index 0000000000000000000000000000000000000000..2558fc2271401e3850aa7e13b7da2aa35c53e77a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/secure-headers/secure-headers.js @@ -0,0 +1,172 @@ +// src/middleware/secure-headers/secure-headers.ts +import { encodeBase64 } from "../../utils/encode.js"; +var HEADERS_MAP = { + crossOriginEmbedderPolicy: ["Cross-Origin-Embedder-Policy", "require-corp"], + crossOriginResourcePolicy: ["Cross-Origin-Resource-Policy", "same-origin"], + crossOriginOpenerPolicy: ["Cross-Origin-Opener-Policy", "same-origin"], + originAgentCluster: ["Origin-Agent-Cluster", "?1"], + referrerPolicy: ["Referrer-Policy", "no-referrer"], + strictTransportSecurity: ["Strict-Transport-Security", "max-age=15552000; includeSubDomains"], + xContentTypeOptions: ["X-Content-Type-Options", "nosniff"], + xDnsPrefetchControl: ["X-DNS-Prefetch-Control", "off"], + xDownloadOptions: ["X-Download-Options", "noopen"], + xFrameOptions: ["X-Frame-Options", "SAMEORIGIN"], + xPermittedCrossDomainPolicies: ["X-Permitted-Cross-Domain-Policies", "none"], + xXssProtection: ["X-XSS-Protection", "0"] +}; +var DEFAULT_OPTIONS = { + crossOriginEmbedderPolicy: false, + crossOriginResourcePolicy: true, + crossOriginOpenerPolicy: true, + originAgentCluster: true, + referrerPolicy: true, + strictTransportSecurity: true, + xContentTypeOptions: true, + xDnsPrefetchControl: true, + xDownloadOptions: true, + xFrameOptions: true, + xPermittedCrossDomainPolicies: true, + xXssProtection: true, + removePoweredBy: true, + permissionsPolicy: {} +}; +var generateNonce = () => { + const arrayBuffer = new Uint8Array(16); + crypto.getRandomValues(arrayBuffer); + return encodeBase64(arrayBuffer.buffer); +}; +var NONCE = (ctx) => { + const key = "secureHeadersNonce"; + const init = ctx.get(key); + const nonce = init || generateNonce(); + if (init == null) { + ctx.set(key, nonce); + } + return `'nonce-${nonce}'`; +}; +var secureHeaders = (customOptions) => { + const options = { ...DEFAULT_OPTIONS, ...customOptions }; + const headersToSet = getFilteredHeaders(options); + const callbacks = []; + if (options.contentSecurityPolicy) { + const [callback, value] = getCSPDirectives( + options.contentSecurityPolicy, + "Content-Security-Policy" + ); + if (callback) { + callbacks.push(callback); + } + headersToSet.push(["Content-Security-Policy", value]); + } + if (options.contentSecurityPolicyReportOnly) { + const [callback, value] = getCSPDirectives( + options.contentSecurityPolicyReportOnly, + "Content-Security-Policy-Report-Only" + ); + if (callback) { + callbacks.push(callback); + } + headersToSet.push(["Content-Security-Policy-Report-Only", value]); + } + if (options.permissionsPolicy && Object.keys(options.permissionsPolicy).length > 0) { + headersToSet.push([ + "Permissions-Policy", + getPermissionsPolicyDirectives(options.permissionsPolicy) + ]); + } + if (options.reportingEndpoints) { + headersToSet.push(["Reporting-Endpoints", getReportingEndpoints(options.reportingEndpoints)]); + } + if (options.reportTo) { + headersToSet.push(["Report-To", getReportToOptions(options.reportTo)]); + } + return async function secureHeaders2(ctx, next) { + const headersToSetForReq = callbacks.length === 0 ? headersToSet : callbacks.reduce((acc, cb) => cb(ctx, acc), headersToSet); + await next(); + setHeaders(ctx, headersToSetForReq); + if (options?.removePoweredBy) { + ctx.res.headers.delete("X-Powered-By"); + } + }; +}; +function getFilteredHeaders(options) { + return Object.entries(HEADERS_MAP).filter(([key]) => options[key]).map(([key, defaultValue]) => { + const overrideValue = options[key]; + return typeof overrideValue === "string" ? [defaultValue[0], overrideValue] : defaultValue; + }); +} +function getCSPDirectives(contentSecurityPolicy, headerName) { + const callbacks = []; + const resultValues = []; + for (const [directive, value] of Object.entries(contentSecurityPolicy)) { + const valueArray = Array.isArray(value) ? value : [value]; + valueArray.forEach((value2, i) => { + if (typeof value2 === "function") { + const index = i * 2 + 2 + resultValues.length; + callbacks.push((ctx, values) => { + values[index] = value2(ctx, directive); + }); + } + }); + resultValues.push( + directive.replace( + /[A-Z]+(?![a-z])|[A-Z]/g, + (match, offset) => offset ? "-" + match.toLowerCase() : match.toLowerCase() + ), + ...valueArray.flatMap((value2) => [" ", value2]), + "; " + ); + } + resultValues.pop(); + return callbacks.length === 0 ? [void 0, resultValues.join("")] : [ + (ctx, headersToSet) => headersToSet.map((values) => { + if (values[0] === headerName) { + const clone = values[1].slice(); + callbacks.forEach((cb) => { + cb(ctx, clone); + }); + return [values[0], clone.join("")]; + } else { + return values; + } + }), + resultValues + ]; +} +function getPermissionsPolicyDirectives(policy) { + return Object.entries(policy).map(([directive, value]) => { + const kebabDirective = camelToKebab(directive); + if (typeof value === "boolean") { + return `${kebabDirective}=${value ? "*" : "none"}`; + } + if (Array.isArray(value)) { + if (value.length === 0) { + return `${kebabDirective}=()`; + } + if (value.length === 1 && (value[0] === "*" || value[0] === "none")) { + return `${kebabDirective}=${value[0]}`; + } + const allowlist = value.map((item) => ["self", "src"].includes(item) ? item : `"${item}"`); + return `${kebabDirective}=(${allowlist.join(" ")})`; + } + return ""; + }).filter(Boolean).join(", "); +} +function camelToKebab(str) { + return str.replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase(); +} +function getReportingEndpoints(reportingEndpoints = []) { + return reportingEndpoints.map((endpoint) => `${endpoint.name}="${endpoint.url}"`).join(", "); +} +function getReportToOptions(reportTo = []) { + return reportTo.map((option) => JSON.stringify(option)).join(", "); +} +function setHeaders(ctx, headersToSet) { + headersToSet.forEach(([header, value]) => { + ctx.res.headers.set(header, value); + }); +} +export { + NONCE, + secureHeaders +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/serve-static/index.js b/tools/ui/node_modules/hono/dist/middleware/serve-static/index.js new file mode 100644 index 0000000000000000000000000000000000000000..84e34366e543ecc5cbc9b228b9096655963dc3b7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/serve-static/index.js @@ -0,0 +1,77 @@ +// src/middleware/serve-static/index.ts +import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from "../../utils/compress.js"; +import { getMimeType } from "../../utils/mime.js"; +import { tryDecodeURI } from "../../utils/url.js"; +import { defaultJoin } from "./path.js"; +var ENCODINGS = { + br: ".br", + zstd: ".zst", + gzip: ".gz" +}; +var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); +var DEFAULT_DOCUMENT = "index.html"; +var serveStatic = (options) => { + const root = options.root ?? "./"; + const optionPath = options.path; + const join = options.join ?? defaultJoin; + return async (c, next) => { + if (c.finalized) { + return next(); + } + let filename; + if (options.path) { + filename = options.path; + } else { + try { + filename = tryDecodeURI(c.req.path); + if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}|\\/.test(filename)) { + throw new Error(); + } + } catch { + await options.onNotFound?.(c.req.path, c); + return next(); + } + } + let path = join( + root, + !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename + ); + if (options.isDir && await options.isDir(path)) { + path = join(path, DEFAULT_DOCUMENT); + } + const getContent = options.getContent; + let content = await getContent(path, c); + if (content instanceof Response) { + return c.newResponse(content.body, content); + } + if (content != null) { + const mimeType = options.mimes && getMimeType(path, options.mimes) || getMimeType(path); + c.header("Content-Type", mimeType || "application/octet-stream"); + if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) { + const acceptEncodingSet = new Set( + c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()) + ); + for (const encoding of ENCODINGS_ORDERED_KEYS) { + if (!acceptEncodingSet.has(encoding)) { + continue; + } + const compressedContent = await getContent(path + ENCODINGS[encoding], c); + if (compressedContent) { + content = compressedContent; + c.header("Content-Encoding", encoding); + c.header("Vary", "Accept-Encoding", { append: true }); + break; + } + } + } + await options.onFound?.(path, c); + return c.body(content); + } + await options.onNotFound?.(path, c); + await next(); + return; + }; +}; +export { + serveStatic +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/serve-static/path.js b/tools/ui/node_modules/hono/dist/middleware/serve-static/path.js new file mode 100644 index 0000000000000000000000000000000000000000..ab7f8235cd39dd17eb5e429a2c80af75e429dfe1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/serve-static/path.js @@ -0,0 +1,18 @@ +// src/middleware/serve-static/path.ts +var defaultJoin = (...paths) => { + let result = paths.filter((p) => p !== "").join("/"); + result = result.replace(/(?<=\/)\/+/g, ""); + const segments = result.split("/"); + const resolved = []; + for (const segment of segments) { + if (segment === ".." && resolved.length > 0 && resolved.at(-1) !== "..") { + resolved.pop(); + } else if (segment !== ".") { + resolved.push(segment); + } + } + return resolved.join("/") || "."; +}; +export { + defaultJoin +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/timeout/index.js b/tools/ui/node_modules/hono/dist/middleware/timeout/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9fac713c751a773177d9252f3876992e4d8c0699 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/timeout/index.js @@ -0,0 +1,25 @@ +// src/middleware/timeout/index.ts +import { HTTPException } from "../../http-exception.js"; +var defaultTimeoutException = new HTTPException(504, { + message: "Gateway Timeout" +}); +var timeout = (duration, exception = defaultTimeoutException) => { + return async function timeout2(context, next) { + let timer; + const timeoutPromise = new Promise((_, reject) => { + timer = setTimeout(() => { + reject(typeof exception === "function" ? exception(context) : exception); + }, duration); + }); + try { + await Promise.race([next(), timeoutPromise]); + } finally { + if (timer !== void 0) { + clearTimeout(timer); + } + } + }; +}; +export { + timeout +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/timing/index.js b/tools/ui/node_modules/hono/dist/middleware/timing/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4c0836bc932c4d5fb3f57625d6064e1107868f45 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/timing/index.js @@ -0,0 +1,9 @@ +// src/middleware/timing/index.ts +import { timing, setMetric, startTime, endTime, wrapTime } from "./timing.js"; +export { + endTime, + setMetric, + startTime, + timing, + wrapTime +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/timing/timing.js b/tools/ui/node_modules/hono/dist/middleware/timing/timing.js new file mode 100644 index 0000000000000000000000000000000000000000..08ba28d025c95b4851755dba9fcea8d1116e2bc0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/timing/timing.js @@ -0,0 +1,104 @@ +// src/middleware/timing/timing.ts +import "../../context.js"; +var getTime = () => { + try { + return performance.now(); + } catch { + } + return Date.now(); +}; +var timing = (config) => { + const options = { + total: true, + enabled: true, + totalDescription: "Total Response Time", + autoEnd: true, + crossOrigin: false, + ...config + }; + return async function timing2(c, next) { + const headers = []; + const timers = /* @__PURE__ */ new Map(); + if (c.get("metric")) { + return await next(); + } + c.set("metric", { headers, timers }); + if (options.total) { + startTime(c, "total", options.totalDescription); + } + await next(); + if (options.total) { + endTime(c, "total"); + } + if (options.autoEnd) { + timers.forEach((_, key) => { + endTime(c, key); + }); + } + const enabled = typeof options.enabled === "function" ? options.enabled(c) : options.enabled; + if (enabled) { + c.res.headers.append("Server-Timing", headers.join(",")); + const crossOrigin = typeof options.crossOrigin === "function" ? options.crossOrigin(c) : options.crossOrigin; + if (crossOrigin) { + c.res.headers.append( + "Timing-Allow-Origin", + typeof crossOrigin === "string" ? crossOrigin : "*" + ); + } + } + }; +}; +var setMetric = (c, name, valueDescription, description, precision) => { + const metrics = c.get("metric"); + if (!metrics) { + console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); + return; + } + if (typeof valueDescription === "number") { + const dur = valueDescription.toFixed(precision || 1); + const metric = description ? `${name};dur=${dur};desc="${description}"` : `${name};dur=${dur}`; + metrics.headers.push(metric); + } else { + const metric = valueDescription ? `${name};desc="${valueDescription}"` : `${name}`; + metrics.headers.push(metric); + } +}; +var startTime = (c, name, description) => { + const metrics = c.get("metric"); + if (!metrics) { + console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); + return; + } + metrics.timers.set(name, { description, start: getTime() }); +}; +var endTime = (c, name, precision) => { + const metrics = c.get("metric"); + if (!metrics) { + console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!"); + return; + } + const timer = metrics.timers.get(name); + if (!timer) { + console.warn(`Timer "${name}" does not exist!`); + return; + } + const { description, start } = timer; + const duration = getTime() - start; + setMetric(c, name, duration, description, precision); + metrics.timers.delete(name); +}; +async function wrapTime(c, name, callable, description, precision) { + startTime(c, name, description); + try { + return await callable; + } finally { + endTime(c, name, precision); + } +} +export { + endTime, + setMetric, + startTime, + timing, + wrapTime +}; diff --git a/tools/ui/node_modules/hono/dist/middleware/trailing-slash/index.js b/tools/ui/node_modules/hono/dist/middleware/trailing-slash/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4d37334e80538caabe24a7bc36860f41dfbcae4a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/middleware/trailing-slash/index.js @@ -0,0 +1,39 @@ +// src/middleware/trailing-slash/index.ts +var trimTrailingSlash = (options) => { + return async function trimTrailingSlash2(c, next) { + if (options?.alwaysRedirect) { + if ((c.req.method === "GET" || c.req.method === "HEAD") && c.req.path !== "/" && c.req.path.at(-1) === "/") { + const url = new URL(c.req.url); + url.pathname = url.pathname.substring(0, url.pathname.length - 1); + return c.redirect(url.toString(), 301); + } + } + await next(); + if (!options?.alwaysRedirect && c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path !== "/" && c.req.path.at(-1) === "/") { + const url = new URL(c.req.url); + url.pathname = url.pathname.substring(0, url.pathname.length - 1); + c.res = c.redirect(url.toString(), 301); + } + }; +}; +var appendTrailingSlash = (options) => { + return async function appendTrailingSlash2(c, next) { + if (options?.alwaysRedirect) { + if ((c.req.method === "GET" || c.req.method === "HEAD") && c.req.path.at(-1) !== "/" && !options.skip?.(c.req.path)) { + const url = new URL(c.req.url); + url.pathname += "/"; + return c.redirect(url.toString(), 301); + } + } + await next(); + if (!options?.alwaysRedirect && c.res.status === 404 && (c.req.method === "GET" || c.req.method === "HEAD") && c.req.path.at(-1) !== "/" && !options?.skip?.(c.req.path)) { + const url = new URL(c.req.url); + url.pathname += "/"; + c.res = c.redirect(url.toString(), 301); + } + }; +}; +export { + appendTrailingSlash, + trimTrailingSlash +}; diff --git a/tools/ui/node_modules/hono/dist/preset/quick.js b/tools/ui/node_modules/hono/dist/preset/quick.js new file mode 100644 index 0000000000000000000000000000000000000000..b8eca9707a781905f9186a625bdbb85f386585e5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/preset/quick.js @@ -0,0 +1,16 @@ +// src/preset/quick.ts +import { HonoBase } from "../hono-base.js"; +import { LinearRouter } from "../router/linear-router/index.js"; +import { SmartRouter } from "../router/smart-router/index.js"; +import { TrieRouter } from "../router/trie-router/index.js"; +var Hono = class extends HonoBase { + constructor(options = {}) { + super(options); + this.router = new SmartRouter({ + routers: [new LinearRouter(), new TrieRouter()] + }); + } +}; +export { + Hono +}; diff --git a/tools/ui/node_modules/hono/dist/preset/tiny.js b/tools/ui/node_modules/hono/dist/preset/tiny.js new file mode 100644 index 0000000000000000000000000000000000000000..377e3b048e4a9e5838d0e96debd7acf2cb9f8535 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/preset/tiny.js @@ -0,0 +1,12 @@ +// src/preset/tiny.ts +import { HonoBase } from "../hono-base.js"; +import { PatternRouter } from "../router/pattern-router/index.js"; +var Hono = class extends HonoBase { + constructor(options = {}) { + super(options); + this.router = new PatternRouter(); + } +}; +export { + Hono +}; diff --git a/tools/ui/node_modules/hono/dist/request.js b/tools/ui/node_modules/hono/dist/request.js new file mode 100644 index 0000000000000000000000000000000000000000..b80e7c2775df344bec56c59ea141119382f3b347 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/request.js @@ -0,0 +1,319 @@ +// src/request.ts +import { HTTPException } from "./http-exception.js"; +import { GET_MATCH_RESULT } from "./request/constants.js"; +import { parseBody } from "./utils/body.js"; +import { getQueryParam, getQueryParams, tryDecodeURIComponent } from "./utils/url.js"; +var HonoRequest = class { + /** + * `.raw` can get the raw Request object. + * + * @see {@link https://hono.dev/docs/api/request#raw} + * + * @example + * ```ts + * // For Cloudflare Workers + * app.post('/', async (c) => { + * const metadata = c.req.raw.cf?.hostMetadata? + * ... + * }) + * ``` + */ + raw; + #validatedData; + // Short name of validatedData + #matchResult; + routeIndex = 0; + /** + * `.path` can get the pathname of the request. + * + * @see {@link https://hono.dev/docs/api/request#path} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const pathname = c.req.path // `/about/me` + * }) + * ``` + */ + path; + bodyCache = {}; + constructor(request, path = "/", matchResult = [[]]) { + this.raw = request; + this.path = path; + this.#matchResult = matchResult; + } + param(key) { + return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams(); + } + #getDecodedParam(key) { + const paramKey = this.#matchResult[0][this.routeIndex][1][key]; + const param = this.#getParamValue(paramKey); + return param && tryDecodeURIComponent(param); + } + #getAllDecodedParams() { + const decoded = {}; + const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]); + for (const key of keys) { + const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]); + if (value !== void 0) { + decoded[key] = tryDecodeURIComponent(value); + } + } + return decoded; + } + #getParamValue(paramKey) { + return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey; + } + query(key) { + return getQueryParam(this.url, key); + } + queries(key) { + return getQueryParams(this.url, key); + } + header(name) { + if (name) { + return this.raw.headers.get(name) ?? void 0; + } + const headerData = /* @__PURE__ */ Object.create(null); + this.raw.headers.forEach((value, key) => { + headerData[key] = value; + }); + return headerData; + } + async parseBody(options) { + return parseBody(this, options); + } + #cachedBody = (key) => { + const { bodyCache, raw } = this; + const cachedBody = bodyCache[key]; + if (cachedBody) { + return cachedBody; + } + for (const anyCachedKey in bodyCache) { + return bodyCache[anyCachedKey].then((body) => { + if (anyCachedKey === "json") { + body = JSON.stringify(body); + } + return new Response(body)[key](); + }); + } + return bodyCache[key] = raw[key](); + }; + /** + * `.json()` can parse Request body of type `application/json` + * + * @see {@link https://hono.dev/docs/api/request#json} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.json() + * }) + * ``` + */ + json() { + return this.#cachedBody("text").then((text) => JSON.parse(text)); + } + /** + * `.text()` can parse Request body of type `text/plain` + * + * @see {@link https://hono.dev/docs/api/request#text} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.text() + * }) + * ``` + */ + text() { + return this.#cachedBody("text"); + } + /** + * `.arrayBuffer()` parse Request body as an `ArrayBuffer` + * + * @see {@link https://hono.dev/docs/api/request#arraybuffer} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.arrayBuffer() + * }) + * ``` + */ + arrayBuffer() { + return this.#cachedBody("arrayBuffer"); + } + /** + * `.bytes()` parses the request body as a `Uint8Array`. + * + * @see {@link https://hono.dev/docs/api/request#bytes} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.bytes() + * }) + * ``` + */ + bytes() { + return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer)); + } + /** + * Parses the request body as a `Blob`. + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.blob(); + * }); + * ``` + * @see https://hono.dev/docs/api/request#blob + */ + blob() { + return this.#cachedBody("blob"); + } + /** + * Parses the request body as `FormData`. + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.formData(); + * }); + * ``` + * @see https://hono.dev/docs/api/request#formdata + */ + formData() { + return this.#cachedBody("formData"); + } + /** + * Adds validated data to the request. + * + * @param target - The target of the validation. + * @param data - The validated data to add. + */ + addValidatedData(target, data) { + ; + (this.#validatedData ??= {})[target] = data; + } + valid(target) { + return this.#validatedData?.[target]; + } + /** + * `.url()` can get the request url strings. + * + * @see {@link https://hono.dev/docs/api/request#url} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const url = c.req.url // `http://localhost:8787/about/me` + * ... + * }) + * ``` + */ + get url() { + return this.raw.url; + } + /** + * `.method()` can get the method name of the request. + * + * @see {@link https://hono.dev/docs/api/request#method} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const method = c.req.method // `GET` + * }) + * ``` + */ + get method() { + return this.raw.method; + } + get [GET_MATCH_RESULT]() { + return this.#matchResult; + } + /** + * `.matchedRoutes()` can return a matched route in the handler + * + * @deprecated + * + * Use matchedRoutes helper defined in "hono/route" instead. + * + * @see {@link https://hono.dev/docs/api/request#matchedroutes} + * + * @example + * ```ts + * app.use('*', async function logger(c, next) { + * await next() + * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { + * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') + * console.log( + * method, + * ' ', + * path, + * ' '.repeat(Math.max(10 - path.length, 0)), + * name, + * i === c.req.routeIndex ? '<- respond from here' : '' + * ) + * }) + * }) + * ``` + */ + get matchedRoutes() { + return this.#matchResult[0].map(([[, route]]) => route); + } + /** + * `routePath()` can retrieve the path registered within the handler + * + * @deprecated + * + * Use routePath helper defined in "hono/route" instead. + * + * @see {@link https://hono.dev/docs/api/request#routepath} + * + * @example + * ```ts + * app.get('/posts/:id', (c) => { + * return c.json({ path: c.req.routePath }) + * }) + * ``` + */ + get routePath() { + return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path; + } +}; +var cloneRawRequest = async (req) => { + if (!req.raw.bodyUsed) { + return req.raw.clone(); + } + const cacheKey = Object.keys(req.bodyCache)[0]; + if (!cacheKey) { + throw new HTTPException(500, { + message: "Cannot clone request: body was already consumed and not cached. Please use HonoRequest methods (e.g., req.json(), req.text()) instead of consuming req.raw directly." + }); + } + const body = await req[cacheKey](); + const headers = req.header(); + if (body instanceof FormData) { + delete headers["content-type"]; + } + const requestInit = { + body, + cache: req.raw.cache, + credentials: req.raw.credentials, + headers, + integrity: req.raw.integrity, + keepalive: req.raw.keepalive, + method: req.method, + mode: req.raw.mode, + redirect: req.raw.redirect, + referrer: req.raw.referrer, + referrerPolicy: req.raw.referrerPolicy, + signal: req.raw.signal + }; + return new Request(req.url, requestInit); +}; +export { + HonoRequest, + cloneRawRequest +}; diff --git a/tools/ui/node_modules/hono/dist/request/constants.js b/tools/ui/node_modules/hono/dist/request/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..0dd1f541cbb3accd49585dc52dc5aac5f7ce1efd --- /dev/null +++ b/tools/ui/node_modules/hono/dist/request/constants.js @@ -0,0 +1,5 @@ +// src/request/constants.ts +var GET_MATCH_RESULT = /* @__PURE__ */ Symbol(); +export { + GET_MATCH_RESULT +}; diff --git a/tools/ui/node_modules/hono/dist/router.js b/tools/ui/node_modules/hono/dist/router.js new file mode 100644 index 0000000000000000000000000000000000000000..f77beb2f401072bf9d6c4da4a618c1b9fc0b11ba --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router.js @@ -0,0 +1,14 @@ +// src/router.ts +var METHOD_NAME_ALL = "ALL"; +var METHOD_NAME_ALL_LOWERCASE = "all"; +var METHODS = ["get", "post", "put", "delete", "options", "patch", "query"]; +var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; +var UnsupportedPathError = class extends Error { +}; +export { + MESSAGE_MATCHER_IS_ALREADY_BUILT, + METHODS, + METHOD_NAME_ALL, + METHOD_NAME_ALL_LOWERCASE, + UnsupportedPathError +}; diff --git a/tools/ui/node_modules/hono/dist/router/linear-router/index.js b/tools/ui/node_modules/hono/dist/router/linear-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ed507118ca10ce2a134fb17b9ce1fd460eed73f4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/linear-router/index.js @@ -0,0 +1,5 @@ +// src/router/linear-router/index.ts +import { LinearRouter } from "./router.js"; +export { + LinearRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/linear-router/router.js b/tools/ui/node_modules/hono/dist/router/linear-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..ca0a0c1a0aabf1455639f4c05aeca0527c9cbe32 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/linear-router/router.js @@ -0,0 +1,118 @@ +// src/router/linear-router/router.ts +import { METHOD_NAME_ALL, UnsupportedPathError } from "../../router.js"; +import { checkOptionalParameter } from "../../utils/url.js"; +var emptyParams = /* @__PURE__ */ Object.create(null); +var splitPathRe = /\/(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/[^\/\?]+|(\?)/g; +var splitByStarRe = /\*/; +var LinearRouter = class { + name = "LinearRouter"; + #routes = []; + add(method, path, handler) { + for (let i = 0, paths = checkOptionalParameter(path) || [path], len = paths.length; i < len; i++) { + this.#routes.push([method, paths[i], handler]); + } + } + match(method, path) { + const handlers = []; + ROUTES_LOOP: for (let i = 0, len = this.#routes.length; i < len; i++) { + const [routeMethod, routePath, handler] = this.#routes[i]; + if (routeMethod === method || routeMethod === METHOD_NAME_ALL) { + if (routePath === "*" || routePath === "/*") { + handlers.push([handler, emptyParams]); + continue; + } + const hasStar = routePath.indexOf("*") !== -1; + const hasLabel = routePath.indexOf(":") !== -1; + if (!hasStar && !hasLabel) { + if (routePath === path || routePath + "/" === path) { + handlers.push([handler, emptyParams]); + } + } else if (hasStar && !hasLabel) { + const endsWithStar = routePath.charCodeAt(routePath.length - 1) === 42; + const parts = (endsWithStar ? routePath.slice(0, -2) : routePath).split(splitByStarRe); + const lastIndex = parts.length - 1; + for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { + const part = parts[j]; + const index = path.indexOf(part, pos); + if (index !== pos) { + continue ROUTES_LOOP; + } + pos += part.length; + if (j === lastIndex) { + if (!endsWithStar && pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { + continue ROUTES_LOOP; + } + } else { + const index2 = path.indexOf("/", pos); + if (index2 === -1) { + continue ROUTES_LOOP; + } + pos = index2; + } + } + handlers.push([handler, emptyParams]); + } else if (hasLabel && !hasStar) { + const params = /* @__PURE__ */ Object.create(null); + const parts = routePath.match(splitPathRe); + const lastIndex = parts.length - 1; + for (let j = 0, pos = 0, len2 = parts.length; j < len2; j++) { + if (pos === -1 || pos >= path.length) { + continue ROUTES_LOOP; + } + const part = parts[j]; + if (part.charCodeAt(1) === 58) { + if (path.charCodeAt(pos) !== 47) { + continue ROUTES_LOOP; + } + let name = part.slice(2); + let value; + if (name.charCodeAt(name.length - 1) === 125) { + const openBracePos = name.indexOf("{"); + const next = parts[j + 1]; + const lookahead = next && next[1] !== ":" && next[1] !== "*" ? `(?=${next})` : ""; + const pattern = name.slice(openBracePos + 1, -1) + lookahead; + const restPath = path.slice(pos + 1); + const match = new RegExp(pattern, "d").exec(restPath); + if (!match || match.indices[0][0] !== 0 || match.indices[0][1] === 0) { + continue ROUTES_LOOP; + } + name = name.slice(0, openBracePos); + value = restPath.slice(...match.indices[0]); + pos += match.indices[0][1] + 1; + } else { + let endValuePos = path.indexOf("/", pos + 1); + if (endValuePos === -1) { + if (pos + 1 === path.length) { + continue ROUTES_LOOP; + } + endValuePos = path.length; + } + value = path.slice(pos + 1, endValuePos); + pos = endValuePos; + } + params[name] ||= value; + } else { + const index = path.indexOf(part, pos); + if (index !== pos) { + continue ROUTES_LOOP; + } + pos += part.length; + } + if (j === lastIndex) { + if (pos !== path.length && !(pos === path.length - 1 && path.charCodeAt(pos) === 47)) { + continue ROUTES_LOOP; + } + } + } + handlers.push([handler, params]); + } else if (hasLabel && hasStar) { + throw new UnsupportedPathError(); + } + } + } + return [handlers]; + } +}; +export { + LinearRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/pattern-router/index.js b/tools/ui/node_modules/hono/dist/router/pattern-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b4e9ab4bfa7c55ed1df39f394c9e0a4682b5d149 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/pattern-router/index.js @@ -0,0 +1,5 @@ +// src/router/pattern-router/index.ts +import { PatternRouter } from "./router.js"; +export { + PatternRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/pattern-router/router.js b/tools/ui/node_modules/hono/dist/router/pattern-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..96eb0b89fd71b8b4e64077b6d3406ae432e300d2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/pattern-router/router.js @@ -0,0 +1,48 @@ +// src/router/pattern-router/router.ts +import { METHOD_NAME_ALL, UnsupportedPathError } from "../../router.js"; +var emptyParams = /* @__PURE__ */ Object.create(null); +var PatternRouter = class { + name = "PatternRouter"; + #routes = []; + add(method, path, handler) { + const endsWithWildcard = path.at(-1) === "*"; + if (endsWithWildcard) { + path = path.slice(0, -2); + } + if (path.at(-1) === "?") { + path = path.slice(0, -1); + this.add(method, path.replace(/\/[^/]+$/, ""), handler); + } + const parts = (path.match(/\/?(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/?[^\/\?]+/g) || []).map( + (part) => { + const match = part.match(/^\/:([^{]+)(?:{(.*)})?/); + return match ? `/(?<${match[1]}>${match[2] || "[^/]+"})` : part === "/*" ? "/[^/]+" : part.replace(/[.\\+*[^\]$()]/g, "\\$&"); + } + ); + try { + this.#routes.push([ + new RegExp(`^${parts.join("")}${endsWithWildcard ? "" : "/?$"}`), + method, + handler + ]); + } catch { + throw new UnsupportedPathError(); + } + } + match(method, path) { + const handlers = []; + for (let i = 0, len = this.#routes.length; i < len; i++) { + const [pattern, routeMethod, handler] = this.#routes[i]; + if (routeMethod === method || routeMethod === METHOD_NAME_ALL) { + const match = pattern.exec(path); + if (match) { + handlers.push([handler, match.groups || emptyParams]); + } + } + } + return [handlers]; + } +}; +export { + PatternRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/reg-exp-router/index.js b/tools/ui/node_modules/hono/dist/router/reg-exp-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..dc94aeba478b474bdf86bfb4567309e06279e6a9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/reg-exp-router/index.js @@ -0,0 +1,9 @@ +// src/router/reg-exp-router/index.ts +import { RegExpRouter } from "./router.js"; +import { PreparedRegExpRouter, buildInitParams, serializeInitParams } from "./prepared-router.js"; +export { + PreparedRegExpRouter, + RegExpRouter, + buildInitParams, + serializeInitParams +}; diff --git a/tools/ui/node_modules/hono/dist/router/reg-exp-router/matcher.js b/tools/ui/node_modules/hono/dist/router/reg-exp-router/matcher.js new file mode 100644 index 0000000000000000000000000000000000000000..3691559d2da5d177d0391300a337af59f5105478 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/reg-exp-router/matcher.js @@ -0,0 +1,25 @@ +// src/router/reg-exp-router/matcher.ts +import { METHOD_NAME_ALL } from "../../router.js"; +var emptyParam = []; +function match(method, path) { + const matchers = this.buildAllMatchers(); + const match2 = ((method2, path2) => { + const matcher = matchers[method2] || matchers[METHOD_NAME_ALL]; + const staticMatch = matcher[2][path2]; + if (staticMatch) { + return staticMatch; + } + const match3 = path2.match(matcher[0]); + if (!match3) { + return [[], emptyParam]; + } + const index = match3.indexOf("", 1); + return [matcher[1][index], match3]; + }); + this.match = match2; + return match2(method, path); +} +export { + emptyParam, + match +}; diff --git a/tools/ui/node_modules/hono/dist/router/reg-exp-router/node.js b/tools/ui/node_modules/hono/dist/router/reg-exp-router/node.js new file mode 100644 index 0000000000000000000000000000000000000000..9b317397ec8d87335db2b5c260ee366de8fd7ee1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/reg-exp-router/node.js @@ -0,0 +1,110 @@ +// src/router/reg-exp-router/node.ts +var LABEL_REG_EXP_STR = "[^/]+"; +var ONLY_WILDCARD_REG_EXP_STR = ".*"; +var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)"; +var PATH_ERROR = /* @__PURE__ */ Symbol(); +var regExpMetaChars = new Set(".\\+*[^]$()"); +function compareKey(a, b) { + if (a.length === 1) { + return b.length === 1 ? a < b ? -1 : 1 : -1; + } + if (b.length === 1) { + return 1; + } + if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) { + return b === TAIL_WILDCARD_REG_EXP_STR ? -1 : 1; + } else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) { + return -1; + } + if (a === LABEL_REG_EXP_STR) { + return 1; + } else if (b === LABEL_REG_EXP_STR) { + return -1; + } + return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length; +} +var Node = class _Node { + // handler index of a dynamic path, or -1 for a static path terminal + #index; + #varIndex; + #children = /* @__PURE__ */ Object.create(null); + insert(tokens, index, paramMap, context, isStatic) { + let node = this; + for (let i = 0, len = tokens.length; i < len; i++) { + const token = tokens[i]; + const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : null : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); + let nextNode; + if (pattern) { + const name = pattern[1]; + let regexpStr = pattern[2] || LABEL_REG_EXP_STR; + if (name && pattern[2]) { + if (regexpStr === ".*") { + throw PATH_ERROR; + } + regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:"); + if (/\((?!\?:)/.test(regexpStr)) { + throw PATH_ERROR; + } + if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) { + throw PATH_ERROR; + } + } + nextNode = node.#children[regexpStr]; + if (!nextNode) { + if (regexpStr !== ONLY_WILDCARD_REG_EXP_STR && regexpStr !== TAIL_WILDCARD_REG_EXP_STR) { + for (const k in node.#children) { + if ( + // a single-char pattern coexists with single-char literals as a literal does + (regexpStr.length > 1 || k.length > 1) && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR + ) { + throw PATH_ERROR; + } + } + } + nextNode = node.#children[regexpStr] = new _Node(); + } + if (name !== "") { + nextNode.#varIndex ??= context.varIndex++; + paramMap.push([name, nextNode.#varIndex]); + } + } else { + nextNode = node.#children[token]; + if (!nextNode) { + for (const k in node.#children) { + if (k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR) { + throw PATH_ERROR; + } + } + nextNode = node.#children[token] = new _Node(); + } + } + node = nextNode; + } + if (node.#index !== void 0) { + throw PATH_ERROR; + } + node.#index = isStatic ? -1 : index; + } + buildRegExpStr() { + const childKeys = Object.keys(this.#children).sort(compareKey); + const strList = childKeys.map((k) => { + const c = this.#children[k]; + const childStr = c.buildRegExpStr(); + return childStr === "" ? "" : (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + childStr; + }).filter(Boolean); + if (typeof this.#index === "number" && this.#index !== -1) { + strList.unshift(`#${this.#index}`); + } + if (strList.length === 0) { + return ""; + } + if (strList.length === 1) { + return strList[0]; + } + return "(?:" + strList.join("|") + ")"; + } +}; +export { + Node, + PATH_ERROR +}; diff --git a/tools/ui/node_modules/hono/dist/router/reg-exp-router/prepared-router.js b/tools/ui/node_modules/hono/dist/router/reg-exp-router/prepared-router.js new file mode 100644 index 0000000000000000000000000000000000000000..d329d760138a62390e61bdbd41a951a7a45ec7b0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/reg-exp-router/prepared-router.js @@ -0,0 +1,142 @@ +// src/router/reg-exp-router/prepared-router.ts +import { METHOD_NAME_ALL } from "../../router.js"; +import { match, emptyParam } from "./matcher.js"; +import { RegExpRouter } from "./router.js"; +var PreparedRegExpRouter = class { + name = "PreparedRegExpRouter"; + #matchers; + #relocateMap; + constructor(matchers, relocateMap) { + this.#matchers = matchers; + this.#relocateMap = relocateMap; + } + #addWildcard(method, handlerData) { + const matcher = this.#matchers[method]; + matcher[1].forEach((list) => list && list.push(handlerData)); + Object.values(matcher[2]).forEach((list) => list[0].push(handlerData)); + } + #addPath(method, path, handler, indexes, map) { + const matcher = this.#matchers[method]; + if (!map) { + matcher[2][path][0].push([handler, {}]); + } else { + indexes.forEach((index) => { + if (typeof index === "number") { + matcher[1][index].push([handler, map]); + } else { + ; + matcher[2][index || path][0].push([handler, map]); + } + }); + } + } + add(method, path, handler) { + if (!this.#matchers[method]) { + const all = this.#matchers[METHOD_NAME_ALL]; + const staticMap = {}; + for (const key in all[2]) { + staticMap[key] = [all[2][key][0].slice(), emptyParam]; + } + this.#matchers[method] = [ + all[0], + all[1].map((list) => Array.isArray(list) ? list.slice() : 0), + staticMap + ]; + } + if (path === "/*" || path === "*") { + const handlerData = [handler, {}]; + if (method === METHOD_NAME_ALL) { + for (const m in this.#matchers) { + this.#addWildcard(m, handlerData); + } + } else { + this.#addWildcard(method, handlerData); + } + return; + } + const data = this.#relocateMap[path]; + if (!data) { + throw new Error(`Path ${path} is not registered`); + } + for (const [indexes, map] of data) { + if (method === METHOD_NAME_ALL) { + for (const m in this.#matchers) { + this.#addPath(m, path, handler, indexes, map); + } + } else { + this.#addPath(method, path, handler, indexes, map); + } + } + } + buildAllMatchers() { + return this.#matchers; + } + match = match; +}; +var buildInitParams = ({ paths }) => { + const RegExpRouterWithMatcherExport = class extends RegExpRouter { + buildAndExportAllMatchers() { + return this.buildAllMatchers(); + } + }; + const router = new RegExpRouterWithMatcherExport(); + for (const path of paths) { + router.add(METHOD_NAME_ALL, path, path); + } + const matchers = router.buildAndExportAllMatchers(); + const all = matchers[METHOD_NAME_ALL]; + const relocateMap = {}; + for (const path of paths) { + if (path === "/*" || path === "*") { + continue; + } + all[1].forEach((list, i) => { + list.forEach(([p, map]) => { + if (p === path) { + if (relocateMap[path]) { + relocateMap[path][0][1] = { + ...relocateMap[path][0][1], + ...map + }; + } else { + relocateMap[path] = [[[], map]]; + } + if (relocateMap[path][0][0].findIndex((j) => j === i) === -1) { + relocateMap[path][0][0].push(i); + } + } + }); + }); + for (const path2 in all[2]) { + all[2][path2][0].forEach(([p]) => { + if (p === path) { + relocateMap[path] ||= [[[]]]; + const value = path2 === path ? "" : path2; + if (relocateMap[path][0][0].findIndex((v) => v === value) === -1) { + relocateMap[path][0][0].push(value); + } + } + }); + } + } + for (let i = 0, len = all[1].length; i < len; i++) { + all[1][i] = all[1][i] ? [] : 0; + } + for (const path in all[2]) { + all[2][path][0] = []; + } + return [matchers, relocateMap]; +}; +var serializeInitParams = ([matchers, relocateMap]) => { + const matchersStr = JSON.stringify( + matchers, + (_, value) => value instanceof RegExp ? `##${value.toString()}##` : value + ).replace(/"##(.+?)##"/g, (_, str) => str.replace(/\\\\/g, "\\")); + const relocateMapStr = JSON.stringify(relocateMap); + return `[${matchersStr},${relocateMapStr}]`; +}; +export { + PreparedRegExpRouter, + buildInitParams, + serializeInitParams +}; diff --git a/tools/ui/node_modules/hono/dist/router/reg-exp-router/router.js b/tools/ui/node_modules/hono/dist/router/reg-exp-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..e3f1269b09380eb053aa3acdfbfb1d826bc64cec --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/reg-exp-router/router.js @@ -0,0 +1,169 @@ +// src/router/reg-exp-router/router.ts +import { + MESSAGE_MATCHER_IS_ALREADY_BUILT, + METHOD_NAME_ALL, + UnsupportedPathError +} from "../../router.js"; +import { checkOptionalParameter } from "../../utils/url.js"; +import { match, emptyParam } from "./matcher.js"; +import { PATH_ERROR } from "./node.js"; +import { Trie } from "./trie.js"; +var wildcardRegExpCache = /* @__PURE__ */ Object.create(null); +function buildWildcardRegExp(path) { + return wildcardRegExpCache[path] ??= new RegExp( + path === "*" ? "" : `^${path.replace( + /\/\*$|([.\\+*[^\]$()])/g, + (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)" + )}$` + ); +} +function clearWildcardRegExpCache() { + wildcardRegExpCache = /* @__PURE__ */ Object.create(null); +} +function findMiddleware(middleware, path) { + if (!middleware) { + return void 0; + } + for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) { + if (buildWildcardRegExp(k).test(path)) { + return [...middleware[k]]; + } + } + return void 0; +} +var RegExpRouter = class { + name = "RegExpRouter"; + #middleware; + #routes; + #tries; + constructor() { + this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; + this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) }; + this.#tries = { [METHOD_NAME_ALL]: new Trie() }; + } + #insertPath(method, path) { + try { + this.#tries[method].insert(path, !/\*|\/:/.test(path)); + } catch (e) { + throw e === PATH_ERROR ? new UnsupportedPathError(path) : e; + } + } + add(method, path, handler) { + const middleware = this.#middleware; + const routes = this.#routes; + if (!middleware || !routes) { + throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); + } + if (!middleware[method]) { + this.#tries[method] = new Trie(); + [middleware, routes].forEach((handlerMap) => { + handlerMap[method] = /* @__PURE__ */ Object.create(null); + Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => { + handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]]; + this.#insertPath(method, p); + }); + }); + } + if (path === "/*") { + path = "*"; + } + const paramCount = (path.match(/\/:/g) || []).length; + if (/\*$/.test(path)) { + const re = buildWildcardRegExp(path); + Object.keys(middleware).forEach((m) => { + if ((method === METHOD_NAME_ALL || method === m) && !middleware[m][path]) { + this.#insertPath(m, path); + middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || []; + } + }); + Object.keys(middleware).forEach((m) => { + if (method === METHOD_NAME_ALL || method === m) { + Object.keys(middleware[m]).forEach((p) => { + re.test(p) && middleware[m][p].push([handler, paramCount]); + }); + } + }); + Object.keys(routes).forEach((m) => { + if (method === METHOD_NAME_ALL || method === m) { + Object.keys(routes[m]).forEach( + (p) => re.test(p) && routes[m][p].push([handler, paramCount]) + ); + } + }); + return; + } + const paths = checkOptionalParameter(path) || [path]; + for (let i = 0, len = paths.length; i < len; i++) { + const path2 = paths[i]; + Object.keys(routes).forEach((m) => { + if (method === METHOD_NAME_ALL || method === m) { + if (!routes[m][path2]) { + this.#insertPath(m, path2); + routes[m][path2] = [ + ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [] + ]; + } + routes[m][path2].push([handler, paramCount - len + i + 1]); + } + }); + } + } + match = match; + buildAllMatchers() { + const matchers = /* @__PURE__ */ Object.create(null); + Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => { + matchers[method] ||= this.#buildMatcher(method); + }); + this.#middleware = this.#routes = this.#tries = void 0; + clearWildcardRegExpCache(); + return matchers; + } + #buildMatcher(method) { + const middleware = this.#middleware[method]; + const routes = this.#routes[method]; + const trie = this.#tries[method]; + const staticMap = /* @__PURE__ */ Object.create(null); + const handlerData = []; + [middleware, routes].forEach((r) => { + for (const path in r) { + const handlers = r[path]; + const pathData = trie.paths[path]; + if (!pathData) { + staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam]; + continue; + } + const paramAssoc = pathData[1]; + handlerData[pathData[0]] = handlers.map(([h, paramCount]) => { + const paramIndexMap = /* @__PURE__ */ Object.create(null); + paramCount -= 1; + for (; paramCount >= 0; paramCount--) { + const [key, value] = paramAssoc[paramCount]; + paramIndexMap[key] = value; + } + return [h, paramIndexMap]; + }); + } + }); + const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp(); + for (let i = 0, len = handlerData.length; i < len; i++) { + for (let j = 0, len2 = handlerData[i].length; j < len2; j++) { + const map = handlerData[i][j]?.[1]; + if (!map) { + continue; + } + const keys = Object.keys(map); + for (let k = 0, len3 = keys.length; k < len3; k++) { + map[keys[k]] = paramReplacementMap[map[keys[k]]]; + } + } + } + const handlerMap = []; + for (const i in indexReplacementMap) { + handlerMap[i] = handlerData[indexReplacementMap[i]]; + } + return [regexp, handlerMap, staticMap]; + } +}; +export { + RegExpRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/reg-exp-router/trie.js b/tools/ui/node_modules/hono/dist/router/reg-exp-router/trie.js new file mode 100644 index 0000000000000000000000000000000000000000..30f226812c8d01a793f7a9a18ed16a4d994a3b9c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/reg-exp-router/trie.js @@ -0,0 +1,67 @@ +// src/router/reg-exp-router/trie.ts +import { Node } from "./node.js"; +var Trie = class { + #context = { varIndex: 0 }; + #root = new Node(); + #index = 0; + // dynamic path -> [handler index, param assoc]; static paths are not registered + paths = /* @__PURE__ */ Object.create(null); + insert(path, isStatic) { + if (isStatic) { + this.#root.insert(path.split(""), 0, [], this.#context, true); + return; + } + const paramAssoc = []; + const groups = []; + let markedPath = path; + for (let i = 0; ; ) { + let replaced = false; + markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => { + const mark = `@\\${i}`; + groups[i] = [mark, m]; + i++; + replaced = true; + return mark; + }); + if (!replaced) { + break; + } + } + const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || []; + for (let i = groups.length - 1; i >= 0; i--) { + const [mark] = groups[i]; + for (let j = tokens.length - 1; j >= 0; j--) { + if (tokens[j].indexOf(mark) !== -1) { + tokens[j] = tokens[j].replace(mark, groups[i][1]); + break; + } + } + } + this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false); + this.paths[path] = [this.#index++, paramAssoc]; + } + buildRegExp() { + let regexp = this.#root.buildRegExpStr(); + if (regexp === "") { + return [/^$/, [], []]; + } + let captureIndex = 0; + const indexReplacementMap = []; + const paramReplacementMap = []; + regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => { + if (handlerIndex !== void 0) { + indexReplacementMap[++captureIndex] = Number(handlerIndex); + return "$()"; + } + if (paramIndex !== void 0) { + paramReplacementMap[Number(paramIndex)] = ++captureIndex; + return ""; + } + return ""; + }); + return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap]; + } +}; +export { + Trie +}; diff --git a/tools/ui/node_modules/hono/dist/router/smart-router/index.js b/tools/ui/node_modules/hono/dist/router/smart-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2e6837740c878e90cc64aa885b796c403fc2424a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/smart-router/index.js @@ -0,0 +1,5 @@ +// src/router/smart-router/index.ts +import { SmartRouter } from "./router.js"; +export { + SmartRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/smart-router/router.js b/tools/ui/node_modules/hono/dist/router/smart-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..1b19adbe16272ff2696caee5908624b47e964e89 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/smart-router/router.js @@ -0,0 +1,58 @@ +// src/router/smart-router/router.ts +import { MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError } from "../../router.js"; +var SmartRouter = class { + name = "SmartRouter"; + #routers = []; + #routes = []; + constructor(init) { + this.#routers = init.routers; + } + add(method, path, handler) { + if (!this.#routes) { + throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT); + } + this.#routes.push([method, path, handler]); + } + match(method, path) { + if (!this.#routes) { + throw new Error("Fatal error"); + } + const routers = this.#routers; + const routes = this.#routes; + const len = routers.length; + let i = 0; + let res; + for (; i < len; i++) { + const router = routers[i]; + try { + for (let i2 = 0, len2 = routes.length; i2 < len2; i2++) { + router.add(...routes[i2]); + } + res = router.match(method, path); + } catch (e) { + if (e instanceof UnsupportedPathError) { + continue; + } + throw e; + } + this.match = router.match.bind(router); + this.#routers = [router]; + this.#routes = void 0; + break; + } + if (i === len) { + throw new Error("Fatal error"); + } + this.name = `SmartRouter + ${this.activeRouter.name}`; + return res; + } + get activeRouter() { + if (this.#routes || this.#routers.length !== 1) { + throw new Error("No active router has been determined yet."); + } + return this.#routers[0]; + } +}; +export { + SmartRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/trie-router/index.js b/tools/ui/node_modules/hono/dist/router/trie-router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c680d106639c0ad6401e8a36539aab2965821f7c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/trie-router/index.js @@ -0,0 +1,5 @@ +// src/router/trie-router/index.ts +import { TrieRouter } from "./router.js"; +export { + TrieRouter +}; diff --git a/tools/ui/node_modules/hono/dist/router/trie-router/node.js b/tools/ui/node_modules/hono/dist/router/trie-router/node.js new file mode 100644 index 0000000000000000000000000000000000000000..a498cefb5ed966dfcb167ca4ff17885b795ebdae --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/trie-router/node.js @@ -0,0 +1,188 @@ +// src/router/trie-router/node.ts +import { METHOD_NAME_ALL } from "../../router.js"; +import { getPattern, splitPath, splitRoutingPath } from "../../utils/url.js"; +var emptyParams = /* @__PURE__ */ Object.create(null); +var hasChildren = (children) => { + for (const _ in children) { + return true; + } + return false; +}; +var Node = class _Node { + #methods; + #children; + #patterns; + #order = 0; + #params = emptyParams; + constructor(method, handler, children) { + this.#children = children || /* @__PURE__ */ Object.create(null); + this.#methods = []; + if (method && handler) { + const m = /* @__PURE__ */ Object.create(null); + m[method] = { handler, possibleKeys: [], score: 0 }; + this.#methods = [m]; + } + this.#patterns = []; + } + insert(method, path, handler) { + this.#order = ++this.#order; + let curNode = this; + const parts = splitRoutingPath(path); + const possibleKeys = []; + for (let i = 0, len = parts.length; i < len; i++) { + const p = parts[i]; + const nextP = parts[i + 1]; + const pattern = getPattern(p, nextP); + const key = Array.isArray(pattern) ? pattern[0] : p; + if (key in curNode.#children) { + curNode = curNode.#children[key]; + if (pattern) { + possibleKeys.push(pattern[1]); + } + continue; + } + curNode.#children[key] = new _Node(); + if (pattern) { + curNode.#patterns.push(pattern); + possibleKeys.push(pattern[1]); + } + curNode = curNode.#children[key]; + } + curNode.#methods.push({ + [method]: { + handler, + possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i), + score: this.#order + } + }); + return curNode; + } + #pushHandlerSets(handlerSets, node, method, nodeParams, params) { + for (let i = 0, len = node.#methods.length; i < len; i++) { + const m = node.#methods[i]; + const handlerSet = m[method] || m[METHOD_NAME_ALL]; + const processedSet = {}; + if (handlerSet !== void 0) { + handlerSet.params = /* @__PURE__ */ Object.create(null); + handlerSets.push(handlerSet); + if (nodeParams !== emptyParams || params && params !== emptyParams) { + for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) { + const key = handlerSet.possibleKeys[i2]; + const processed = processedSet[handlerSet.score]; + handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key]; + processedSet[handlerSet.score] = true; + } + } + } + } + } + search(method, path) { + const handlerSets = []; + this.#params = emptyParams; + const curNode = this; + let curNodes = [curNode]; + const parts = splitPath(path); + const curNodesQueue = []; + const len = parts.length; + let partOffsets = null; + for (let i = 0; i < len; i++) { + const part = parts[i]; + const isLast = i === len - 1; + const tempNodes = []; + for (let j = 0, len2 = curNodes.length; j < len2; j++) { + const node = curNodes[j]; + const nextNode = node.#children[part]; + if (nextNode) { + nextNode.#params = node.#params; + if (isLast) { + if (nextNode.#children["*"]) { + this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params); + } + this.#pushHandlerSets(handlerSets, nextNode, method, node.#params); + } else { + tempNodes.push(nextNode); + } + } + for (let k = 0, len3 = node.#patterns.length; k < len3; k++) { + const pattern = node.#patterns[k]; + const params = node.#params === emptyParams ? {} : { ...node.#params }; + if (pattern === "*") { + const astNode = node.#children["*"]; + if (astNode) { + this.#pushHandlerSets(handlerSets, astNode, method, node.#params); + astNode.#params = params; + tempNodes.push(astNode); + } + continue; + } + const [key, name, matcher] = pattern; + if (!part && !(matcher instanceof RegExp)) { + continue; + } + const child = node.#children[key]; + if (matcher instanceof RegExp) { + if (partOffsets === null) { + partOffsets = new Array(len); + let offset = path[0] === "/" ? 1 : 0; + for (let p = 0; p < len; p++) { + partOffsets[p] = offset; + offset += parts[p].length + 1; + } + } + const restPathString = path.substring(partOffsets[i]); + const m = matcher.exec(restPathString); + if (m) { + params[name] = m[0]; + this.#pushHandlerSets(handlerSets, child, method, node.#params, params); + if (m[0].length === restPathString.length && child.#children["*"]) { + this.#pushHandlerSets( + handlerSets, + child.#children["*"], + method, + node.#params, + params + ); + } + if (hasChildren(child.#children)) { + child.#params = params; + const componentCount = m[0].match(/\//)?.length ?? 0; + const targetCurNodes = curNodesQueue[componentCount] ||= []; + targetCurNodes.push(child); + } + continue; + } + } + if (matcher === true || matcher.test(part)) { + params[name] = part; + if (isLast) { + this.#pushHandlerSets(handlerSets, child, method, params, node.#params); + if (child.#children["*"]) { + this.#pushHandlerSets( + handlerSets, + child.#children["*"], + method, + params, + node.#params + ); + } + } else { + child.#params = params; + tempNodes.push(child); + } + } + } + } + const shifted = curNodesQueue.shift(); + curNodes = shifted ? tempNodes.concat(shifted) : tempNodes; + } + if (handlerSets.length > 1) { + handlerSets.sort((a, b) => { + return a.score - b.score; + }); + } + return [handlerSets.map(({ handler, params }) => [handler, params])]; + } +}; +export { + Node +}; diff --git a/tools/ui/node_modules/hono/dist/router/trie-router/router.js b/tools/ui/node_modules/hono/dist/router/trie-router/router.js new file mode 100644 index 0000000000000000000000000000000000000000..40fd29df01ca22c4753460150a849906b6cd3688 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/router/trie-router/router.js @@ -0,0 +1,26 @@ +// src/router/trie-router/router.ts +import { checkOptionalParameter } from "../../utils/url.js"; +import { Node } from "./node.js"; +var TrieRouter = class { + name = "TrieRouter"; + #node; + constructor() { + this.#node = new Node(); + } + add(method, path, handler) { + const results = checkOptionalParameter(path); + if (results) { + for (let i = 0, len = results.length; i < len; i++) { + this.#node.insert(method, results[i], handler); + } + return; + } + this.#node.insert(method, path, handler); + } + match(method, path) { + return this.#node.search(method, path); + } +}; +export { + TrieRouter +}; diff --git a/tools/ui/node_modules/hono/dist/types.js b/tools/ui/node_modules/hono/dist/types.js new file mode 100644 index 0000000000000000000000000000000000000000..863d104454830d312501c4142791f1d1f8a2757d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types.js @@ -0,0 +1,6 @@ +// src/types.ts +var FetchEventLike = class { +}; +export { + FetchEventLike +}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1c9f0f43875d5a7459a8447ae2c31df0b4a61cf --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts @@ -0,0 +1,27 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +/** + * Get connection information from AWS Lambda + * + * Extracts client IP from various Lambda event sources: + * - API Gateway v1 (REST API): requestContext.identity.sourceIp + * - API Gateway v2 (HTTP API/Function URLs): requestContext.http.sourceIp + * - ALB: Falls back to x-forwarded-for header + * + * @param c - Context + * @returns Connection information including remote address + * @example + * ```ts + * import { Hono } from 'hono' + * import { handle, getConnInfo } from 'hono/aws-lambda' + * + * const app = new Hono() + * + * app.get('/', (c) => { + * const info = getConnInfo(c) + * return c.text(`Your IP: ${info.remote.address}`) + * }) + * + * export const handler = handle(app) + * ``` + */ +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..459c1f36a669812f5608dc0bc32d727f1007ad83 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts @@ -0,0 +1,184 @@ +import type { Hono } from '../../hono'; +import type { Env, Schema } from '../../types'; +import type { ALBRequestContext, ApiGatewayRequestContext, ApiGatewayRequestContextV2, Handler, LambdaContext, LatticeRequestContextV2 } from './types'; +export type LambdaEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2 | ALBProxyEvent | LatticeProxyEventV2; +export interface LatticeProxyEventV2 { + version: string; + path: string; + method: string; + headers: Record; + queryStringParameters: Record; + body: string | null; + isBase64Encoded: boolean; + requestContext: LatticeRequestContextV2; +} +export interface APIGatewayProxyEventV2 { + version: string; + routeKey: string; + headers: Record; + multiValueHeaders?: undefined; + cookies?: string[]; + rawPath: string; + rawQueryString: string; + body: string | null; + isBase64Encoded: boolean; + requestContext: ApiGatewayRequestContextV2; + queryStringParameters?: { + [name: string]: string | undefined; + }; + pathParameters?: { + [name: string]: string | undefined; + }; + stageVariables?: { + [name: string]: string | undefined; + }; +} +export interface APIGatewayProxyEvent { + version: string; + httpMethod: string; + headers: Record; + multiValueHeaders?: { + [headerKey: string]: string[]; + }; + path: string; + body: string | null; + isBase64Encoded: boolean; + queryStringParameters?: Record; + requestContext: ApiGatewayRequestContext; + resource: string; + multiValueQueryStringParameters?: { + [parameterKey: string]: string[]; + }; + pathParameters?: Record; + stageVariables?: Record; +} +export interface ALBProxyEvent { + httpMethod: string; + headers?: Record; + multiValueHeaders?: Record; + path: string; + body: string | null; + isBase64Encoded: boolean; + queryStringParameters?: Record; + multiValueQueryStringParameters?: { + [parameterKey: string]: string[]; + }; + requestContext: ALBRequestContext; +} +type WithHeaders = { + headers: Record; + multiValueHeaders?: undefined; +}; +type WithMultiValueHeaders = { + headers?: undefined; + multiValueHeaders: Record; +}; +export type APIGatewayProxyResult = { + statusCode: number; + statusDescription?: string; + body: string; + cookies?: string[]; + isBase64Encoded: boolean; +} & (WithHeaders | WithMultiValueHeaders); +export declare const streamHandle: (app: Hono) => Handler; +type HandleOptions = { + isContentTypeBinary: ((contentType: string) => boolean) | undefined; +}; +/** + * Converts a Hono application to an AWS Lambda handler. + * + * Accepts events from API Gateway (v1 and v2), Application Load Balancer (ALB), + * and Lambda Function URLs. + * + * @param app - The Hono application instance + * @param options - Optional configuration + * @param options.isContentTypeBinary - A function to determine if the content type is binary. + * If not provided, the default function will be used. + * @returns Lambda handler function + * + * @example + * ```js + * import { Hono } from 'hono' + * import { handle } from 'hono/aws-lambda' + * + * const app = new Hono() + * + * app.get('/', (c) => c.text('Hello from Lambda')) + * app.get('/json', (c) => c.json({ message: 'Hello JSON' })) + * + * export const handler = handle(app) + * ``` + * + * @example + * ```js + * // With custom binary content type detection + * import { handle, defaultIsContentTypeBinary } from 'hono/aws-lambda' + * export const handler = handle(app, { + * isContentTypeBinary: (contentType) => { + * if (defaultIsContentTypeBinary(contentType)) { + * // default logic same as prior to v4.8.4 + * return true + * } + * return contentType.startsWith('image/') || contentType === 'application/pdf' + * } + * }) + * ``` + */ +export declare const handle: (app: Hono, { isContentTypeBinary }?: HandleOptions) => ((event: L, lambdaContext?: LambdaContext) => Promise; +} ? WithMultiValueHeaders : WithHeaders)>); +export declare abstract class EventProcessor { + protected abstract getPath(event: E): string; + protected abstract getMethod(event: E): string; + protected abstract getQueryString(event: E): string; + protected abstract getHeaders(event: E): Headers; + protected abstract getCookies(event: E, headers: Headers): void; + protected abstract setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; + protected getHeaderValue(headers: E['headers'], key: string): string | undefined; + protected getDomainName(event: E): string | undefined; + createRequest(event: E): Request; + createResult(event: E, res: Response, options: Pick): Promise; + setCookies(_event: E, res: Response, result: APIGatewayProxyResult): void; +} +export declare class EventV2Processor extends EventProcessor { + protected getPath(event: APIGatewayProxyEventV2): string; + protected getMethod(event: APIGatewayProxyEventV2): string; + protected getQueryString(event: APIGatewayProxyEventV2): string; + protected getCookies(event: APIGatewayProxyEventV2, headers: Headers): void; + protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; + protected getHeaders(event: APIGatewayProxyEventV2): Headers; +} +export declare class EventV1Processor extends EventProcessor { + protected getPath(event: APIGatewayProxyEvent): string; + protected getMethod(event: APIGatewayProxyEvent): string; + protected getQueryString(event: APIGatewayProxyEvent): string; + protected getCookies(_event: APIGatewayProxyEvent, _headers: Headers): void; + protected getHeaders(event: APIGatewayProxyEvent): Headers; + protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; +} +export declare class ALBProcessor extends EventProcessor { + protected getHeaders(event: ALBProxyEvent): Headers; + protected getPath(event: ALBProxyEvent): string; + protected getMethod(event: ALBProxyEvent): string; + protected getQueryString(event: ALBProxyEvent): string; + protected getCookies(event: ALBProxyEvent, headers: Headers): void; + protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; +} +export declare class LatticeV2Processor extends EventProcessor { + protected getPath(event: LatticeProxyEventV2): string; + protected getMethod(event: LatticeProxyEventV2): string; + protected getQueryString(): string; + protected getHeaders(event: LatticeProxyEventV2): Headers; + protected getCookies(): void; + protected setCookiesToResult(result: APIGatewayProxyResult, cookies: string[]): void; +} +export declare const getProcessor: (event: LambdaEvent) => EventProcessor; +/** + * Check if the given content type is binary. + * This is a default function and may be overwritten by the user via `isContentTypeBinary` option in handler(). + * @param contentType The content type to check. + * @returns True if the content type is binary, false otherwise. + */ +export declare const defaultIsContentTypeBinary: (contentType: string) => boolean; +export declare const isContentEncodingBinary: (contentEncoding: string | null) => boolean; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0808ae58fadd8dc4636d17eb48b6f19e681da5e5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * AWS Lambda Adapter for Hono. + */ +export { handle, streamHandle, defaultIsContentTypeBinary } from './handler'; +export { getConnInfo } from './conninfo'; +export type { APIGatewayProxyResult, LambdaEvent } from './handler'; +export type { ApiGatewayRequestContext, ApiGatewayRequestContextV2, ALBRequestContext, LambdaContext, } from './types'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..070a5ff75aa0472b51fc767dc6bf58a44ffe7fc4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts @@ -0,0 +1,153 @@ +export interface CognitoIdentity { + cognitoIdentityId: string; + cognitoIdentityPoolId: string; +} +export interface ClientContext { + client: ClientContextClient; + Custom?: any; + env: ClientContextEnv; +} +export interface ClientContextClient { + installationId: string; + appTitle: string; + appVersionName: string; + appVersionCode: string; + appPackageName: string; +} +export interface ClientContextEnv { + platformVersion: string; + platform: string; + make: string; + model: string; + locale: string; +} +/** + * {@link Handler} context parameter. + * See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}. + */ +export interface LambdaContext { + callbackWaitsForEmptyEventLoop: boolean; + functionName: string; + functionVersion: string; + invokedFunctionArn: string; + memoryLimitInMB: string; + awsRequestId: string; + logGroupName: string; + logStreamName: string; + identity?: CognitoIdentity | undefined; + clientContext?: ClientContext | undefined; + getRemainingTimeInMillis(): number; +} +type Callback = (error?: Error | string | null, result?: TResult) => void; +export type Handler = (event: TEvent, context: LambdaContext, callback: Callback) => void | Promise; +interface ClientCert { + clientCertPem: string; + subjectDN: string; + issuerDN: string; + serialNumber: string; + validity: { + notBefore: string; + notAfter: string; + }; +} +interface Identity { + accessKey?: string; + accountId?: string; + caller?: string; + cognitoAuthenticationProvider?: string; + cognitoAuthenticationType?: string; + cognitoIdentityId?: string; + cognitoIdentityPoolId?: string; + principalOrgId?: string; + sourceIp: string; + user?: string; + userAgent: string; + userArn?: string; + clientCert?: ClientCert; +} +export interface ApiGatewayRequestContext { + accountId: string; + apiId: string; + authorizer: { + claims?: unknown; + scopes?: unknown; + }; + domainName: string; + domainPrefix: string; + extendedRequestId: string; + httpMethod: string; + identity: Identity; + path: string; + protocol: string; + requestId: string; + requestTime: string; + requestTimeEpoch: number; + resourceId?: string; + resourcePath: string; + stage: string; +} +interface Authorizer { + iam?: { + accessKey: string; + accountId: string; + callerId: string; + cognitoIdentity: null; + principalOrgId: null; + userArn: string; + userId: string; + }; + jwt?: { + claims: Record; + scopes: string[] | null; + }; + /** + * The `context` object returned by a Lambda (REQUEST) authorizer. + * It is `null` when the authorizer returns no context. + */ + lambda?: Record | null; +} +export interface ApiGatewayRequestContextV2 { + accountId: string; + apiId: string; + authentication: null; + authorizer: Authorizer; + domainName: string; + domainPrefix: string; + http: { + method: string; + path: string; + protocol: string; + sourceIp: string; + userAgent: string; + }; + requestId: string; + routeKey: string; + stage: string; + time: string; + timeEpoch: number; +} +export interface ALBRequestContext { + elb: { + targetGroupArn: string; + }; +} +export interface LatticeRequestContextV2 { + serviceNetworkArn: string; + serviceArn: string; + targetGroupArn: string; + region: string; + timeEpoch: string; + identity: { + sourceVpcArn?: string; + type?: string; + principal?: string; + principalOrgID?: string; + sessionName?: string; + x509IssuerOu?: string; + x509SanDns?: string; + x509SanNameCn?: string; + x509SanUri?: string; + x509SubjectCn?: string; + }; +} +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a7cf118bb0d3da32268c97af7e4fbf9c63050e5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts @@ -0,0 +1,7 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +/** + * Get ConnInfo with Bun + * @param c Context + * @returns ConnInfo + */ +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/bun/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/bun/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b4f5d449666b4417ec017833033e31af92e195e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/bun/index.d.ts @@ -0,0 +1,10 @@ +/** + * @module + * Bun Adapter for Hono. + */ +export { serveStatic } from './serve-static'; +export { bunFileSystemModule, toSSG } from './ssg'; +export { createBunWebSocket, upgradeWebSocket, websocket } from './websocket'; +export type { BunWebSocketData, BunWebSocketHandler } from './websocket'; +export { getConnInfo } from './conninfo'; +export { getBunServer } from './server'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0905bd242f56e5562e8481b1000c1b798e9dbd53 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts @@ -0,0 +1,3 @@ +import type { ServeStaticOptions } from '../../middleware/serve-static'; +import type { Env, MiddlewareHandler } from '../../types'; +export declare const serveStatic: (options?: ServeStaticOptions) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/bun/server.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/bun/server.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1baeac8209986f64150f0c4b08ed1f33fa4855ca --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/bun/server.d.ts @@ -0,0 +1,12 @@ +/** + * Getting Bun Server Object for Bun adapters + * @module + */ +import type { Context } from '../../context'; +/** + * Get Bun Server Object from Context + * @template T - The type of Bun Server + * @param c Context + * @returns Bun Server + */ +export declare const getBunServer: (c: Context) => T | undefined; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/bun/ssg.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/bun/ssg.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8db4e65a58174c18e79439b92ab61adfe34c76ab --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/bun/ssg.d.ts @@ -0,0 +1,13 @@ +import type { FileSystemModule, ToSSGAdaptorInterface } from '../../helper/ssg'; +/** + * @experimental + * `bunFileSystemModule` is an experimental feature. + * The API might be changed. + */ +export declare const bunFileSystemModule: FileSystemModule; +/** + * @experimental + * `toSSG` is an experimental feature. + * The API might be changed. + */ +export declare const toSSG: ToSSGAdaptorInterface; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/bun/websocket.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/bun/websocket.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c6e2fb3d2fb644a47e1f0e58b0abfd580eb4c38 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/bun/websocket.d.ts @@ -0,0 +1,39 @@ +import type { UpgradeWebSocket, WSEvents } from '../../helper/websocket'; +import { WSContext } from '../../helper/websocket'; +/** + * @internal + */ +export interface BunServerWebSocket { + send(data: string | ArrayBuffer | Uint8Array, compress?: boolean): void; + close(code?: number, reason?: string): void; + data: T; + readyState: 0 | 1 | 2 | 3; +} +export interface BunWebSocketHandler { + open(ws: BunServerWebSocket): void; + close(ws: BunServerWebSocket, code?: number, reason?: string): void; + message(ws: BunServerWebSocket, message: string | { + buffer: ArrayBufferLike; + }): void; +} +interface CreateWebSocket { + upgradeWebSocket: UpgradeWebSocket; + websocket: BunWebSocketHandler; +} +export interface BunWebSocketData { + events: WSEvents; + url: URL; + protocol: string; +} +/** + * @internal + */ +export declare const createWSContext: (ws: BunServerWebSocket) => WSContext; +export declare const upgradeWebSocket: UpgradeWebSocket; +export declare const websocket: BunWebSocketHandler; +/** + * @deprecated Import `upgradeWebSocket` and `websocket` directly from `hono/bun` instead. + * @returns A function to create a Bun WebSocket handler. + */ +export declare const createBunWebSocket: () => CreateWebSocket; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfa4ffb90d2ca13a9d3dc274363d07ea2b3b6014 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts @@ -0,0 +1,21 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +/** + * Get connection information from Cloudflare Pages + * @param c - Context + * @returns Connection information including remote address + * @example + * ```ts + * import { Hono } from 'hono' + * import { handle, getConnInfo } from 'hono/cloudflare-pages' + * + * const app = new Hono() + * + * app.get('/', (c) => { + * const info = getConnInfo(c) + * return c.text(`Your IP: ${info.remote.address}`) + * }) + * + * export const onRequest = handle(app) + * ``` + */ +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c78b00e5ab393b370f7af278a5b01da8c4dbaaf6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts @@ -0,0 +1,33 @@ +import type { Hono } from '../../hono'; +import type { BlankSchema, Env, Input, MiddlewareHandler, Schema } from '../../types'; +type Params

= Record; +export type EventContext> = { + request: Request; + functionPath: string; + waitUntil: (promise: Promise) => void; + passThroughOnException: () => void; + props: any; + next: (input?: Request | string, init?: RequestInit) => Promise; + env: Env & { + ASSETS: { + fetch: typeof fetch; + }; + }; + params: Params

; + data: Data; +}; +declare type PagesFunction = Record> = (context: EventContext) => Response | Promise; +export declare const handle: (app: Hono) => PagesFunction; +export declare function handleMiddleware(middleware: MiddlewareHandler): PagesFunction; +/** + * + * @description `serveStatic()` is for advanced mode: + * https://developers.cloudflare.com/pages/platform/functions/advanced-mode/#set-up-a-function + * + */ +export declare const serveStatic: () => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0928555261210899c2d08ffe5bb92a0fc5d0f18 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts @@ -0,0 +1,7 @@ +/** + * @module + * Cloudflare Pages Adapter for Hono. + */ +export { handle, handleMiddleware, serveStatic } from './handler'; +export { getConnInfo } from './conninfo'; +export type { EventContext } from './handler'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da71f88f1ef557c4fe3243101a41d3fbc8c29b50 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts @@ -0,0 +1,2 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2ca01b4e0583b85e68037c4fcfd35035773b32f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts @@ -0,0 +1,7 @@ +/** + * @module + * Cloudflare Workers Adapter for Hono. + */ +export { serveStatic } from './serve-static-module'; +export { upgradeWebSocket } from './websocket'; +export { getConnInfo } from './conninfo'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..59fbd2a5aa96d9ab54451b1ee76104e30140ab8d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts @@ -0,0 +1,4 @@ +import type { Env, MiddlewareHandler } from '../../types'; +import type { ServeStaticOptions } from './serve-static'; +declare const module: (options: Omit, "namespace">) => MiddlewareHandler; +export { module as serveStatic }; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a642b8eae788f2fa25e534c701fa68c3620749e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts @@ -0,0 +1,16 @@ +import type { ServeStaticOptions as BaseServeStaticOptions } from '../../middleware/serve-static'; +import type { Env, MiddlewareHandler } from '../../types'; +export type ServeStaticOptions = BaseServeStaticOptions & { + namespace?: unknown; + manifest?: object | string; +}; +/** + * @deprecated + * `serveStatic` in the Cloudflare Workers adapter is deprecated. + * You can serve static files directly using Cloudflare Static Assets. + * @see https://developers.cloudflare.com/workers/static-assets/ + * Cloudflare Static Assets is currently in open beta. If this doesn't work for you, + * please consider using Cloudflare Pages. You can start to create the Cloudflare Pages + * application with the `npm create hono@latest` command. + */ +export declare const serveStatic: (options?: ServeStaticOptions) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d406c185288e5492d679b82a9e3ccd82ca9a30a4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts @@ -0,0 +1,5 @@ +export type KVAssetOptions = { + manifest?: object | string; + namespace?: unknown; +}; +export declare const getContentFromKVAsset: (path: string, options?: KVAssetOptions) => Promise; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..be356742f9099834c2a8421d2251ca558bdfdb4f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts @@ -0,0 +1,2 @@ +import type { UpgradeWebSocket, WSEvents } from '../../helper/websocket'; +export declare const upgradeWebSocket: UpgradeWebSocket, 'onOpen'>>; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d274def5086a587e20173fa4c0a34136d992d73c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts @@ -0,0 +1,7 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +/** + * Get conninfo with Deno + * @param c Context + * @returns ConnInfo + */ +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/deno/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/deno/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d360f6dc642318b7a7849fa7b93d030c0f2a6d66 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/deno/index.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * Deno Adapter for Hono. + */ +export { serveStatic } from './serve-static'; +export { toSSG, denoFileSystemModule } from './ssg'; +export { upgradeWebSocket } from './websocket'; +export { getConnInfo } from './conninfo'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0905bd242f56e5562e8481b1000c1b798e9dbd53 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts @@ -0,0 +1,3 @@ +import type { ServeStaticOptions } from '../../middleware/serve-static'; +import type { Env, MiddlewareHandler } from '../../types'; +export declare const serveStatic: (options?: ServeStaticOptions) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/deno/ssg.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/deno/ssg.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..293e1f94b68970f2774d9253169b526159a65c50 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/deno/ssg.d.ts @@ -0,0 +1,13 @@ +import type { FileSystemModule, ToSSGAdaptorInterface } from '../../helper/ssg/index'; +/** + * @experimental + * `denoFileSystemModule` is an experimental feature. + * The API might be changed. + */ +export declare const denoFileSystemModule: FileSystemModule; +/** + * @experimental + * `toSSG` is an experimental feature. + * The API might be changed. + */ +export declare const toSSG: ToSSGAdaptorInterface; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/deno/websocket.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/deno/websocket.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f391ccbbfa8d656e27fbebc8b4c225898130fca6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/deno/websocket.d.ts @@ -0,0 +1,2 @@ +import type { UpgradeWebSocket } from '../../helper/websocket'; +export declare const upgradeWebSocket: UpgradeWebSocket; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da71f88f1ef557c4fe3243101a41d3fbc8c29b50 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts @@ -0,0 +1,2 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b3e8340b16132b7e3f8a7b0c438af8706ed1bed --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts @@ -0,0 +1,87 @@ +import type { Hono } from '../../hono'; +interface CloudFrontHeader { + key: string; + value: string; +} +interface CloudFrontHeaders { + [name: string]: CloudFrontHeader[]; +} +interface CloudFrontCustomOrigin { + customHeaders: CloudFrontHeaders; + domainName: string; + keepaliveTimeout: number; + path: string; + port: number; + protocol: string; + readTimeout: number; + sslProtocols: string[]; +} +interface CloudFrontS3Origin { + authMethod: 'origin-access-identity' | 'none'; + customHeaders: CloudFrontHeaders; + domainName: string; + path: string; + region: string; +} +type CloudFrontOrigin = { + s3: CloudFrontS3Origin; + custom?: never; +} | { + custom: CloudFrontCustomOrigin; + s3?: never; +}; +export interface CloudFrontRequest { + clientIp: string; + headers: CloudFrontHeaders; + method: string; + querystring: string; + uri: string; + body?: { + inputTruncated: boolean; + action: string; + encoding: string; + data: string; + }; + origin?: CloudFrontOrigin; +} +export interface CloudFrontResponse { + headers: CloudFrontHeaders; + status: string; + statusDescription?: string; +} +export interface CloudFrontConfig { + distributionDomainName: string; + distributionId: string; + eventType: string; + requestId: string; +} +interface CloudFrontEvent { + cf: { + config: CloudFrontConfig; + request: CloudFrontRequest; + response?: CloudFrontResponse; + }; +} +export interface CloudFrontEdgeEvent { + Records: CloudFrontEvent[]; +} +type CloudFrontContext = {}; +export interface Callback { + (err: Error | null, result?: CloudFrontRequest | CloudFrontResult): void; +} +interface CloudFrontResult { + status: string; + statusDescription?: string; + headers?: { + [header: string]: { + key: string; + value: string; + }[]; + }; + body?: string; + bodyEncoding?: 'text' | 'base64'; +} +export declare const handle: (app: Hono) => ((event: CloudFrontEdgeEvent, context?: CloudFrontContext, callback?: Callback) => Promise); +export declare const createBody: (method: string, requestBody: CloudFrontRequest["body"]) => string | Uint8Array | undefined; +export declare const isContentTypeBinary: (contentType: string) => boolean; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8889c41972ae6597e207b7646fc227b88b69377d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts @@ -0,0 +1,7 @@ +/** + * @module + * Lambda@Edge Adapter for Hono. + */ +export { handle } from './handler'; +export { getConnInfo } from './conninfo'; +export type { Callback, CloudFrontConfig, CloudFrontRequest, CloudFrontResponse, CloudFrontEdgeEvent, } from './handler'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5118663695e6959e0a7c823c7c6caa364034742a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts @@ -0,0 +1,21 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +/** + * Get connection information from Netlify + * @param c - Context + * @returns Connection information including remote address + * @example + * ```ts + * import { Hono } from 'hono' + * import { handle, getConnInfo } from 'hono/netlify' + * + * const app = new Hono() + * + * app.get('/', (c) => { + * const info = getConnInfo(c) + * return c.text(`Your IP: ${info.remote.address}`) + * }) + * + * export default handle(app) + * ``` + */ +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/netlify/handler.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/netlify/handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f49216d787ac4845d55821efbcced282f6eee3d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/netlify/handler.d.ts @@ -0,0 +1,2 @@ +import type { Hono } from '../../hono'; +export declare const handle: (app: Hono) => ((req: Request, context: any) => Response | Promise); diff --git a/tools/ui/node_modules/hono/dist/types/adapter/netlify/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/netlify/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd2b35c6e0df63cef9193ab8b2d30c5005ba6887 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/netlify/index.d.ts @@ -0,0 +1,5 @@ +/** + * @module + * Netlify Adapter for Hono. + */ +export * from './mod'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/netlify/mod.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/netlify/mod.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..08081d5248aa2de727795ab86cf8a084a2fbf6b9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/netlify/mod.d.ts @@ -0,0 +1,2 @@ +export { handle } from './handler'; +export { getConnInfo } from './conninfo'; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b2c1c4f4361af8cb310861378ec9c444eb8393c3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts @@ -0,0 +1,16 @@ +/** + * Handler for Service Worker + * @module + */ +import type { Hono } from '../../hono'; +import type { Env, Schema } from '../../types'; +import type { FetchEvent } from './types'; +type Handler = (evt: FetchEvent) => void; +export type HandleOptions = { + fetch?: typeof fetch; +}; +/** + * Adapter for Service Worker + */ +export declare const handle: (app: Hono, opts?: HandleOptions) => Handler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/service-worker/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/service-worker/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a89b3c78669cbc89dcfaeab62f5e0c053ac023da --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/service-worker/index.d.ts @@ -0,0 +1,28 @@ +/** + * Service Worker Adapter for Hono. + * @module + */ +import type { Hono } from '../../hono'; +import type { Env, Schema } from '../../types'; +import { handle } from './handler'; +import type { HandleOptions } from './handler'; +/** + * Registers a Hono app to handle fetch events in a service worker. + * This sets up `addEventListener('fetch', handle(app, options))` for the provided app. + * + * @param app - The Hono application instance + * @param options - Options for handling requests (fetch defaults to undefined) + * @example + * ```ts + * import { Hono } from 'hono' + * import { fire } from 'hono/service-worker' + * + * const app = new Hono() + * + * app.get('/', (c) => c.text('Hi')) + * + * fire(app) + * ``` + */ +declare const fire: (app: Hono, options?: HandleOptions) => void; +export { handle, fire }; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/service-worker/types.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/service-worker/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..66298f49615a5108af93e5b2b7a21bfc4cf30162 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/service-worker/types.d.ts @@ -0,0 +1,12 @@ +interface ExtendableEvent extends Event { + waitUntil(f: Promise): void; +} +export interface FetchEvent extends ExtendableEvent { + readonly clientId: string; + readonly handled: Promise; + readonly preloadResponse: Promise; + readonly request: Request; + readonly resultingClientId: string; + respondWith(r: Response | PromiseLike): void; +} +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da71f88f1ef557c4fe3243101a41d3fbc8c29b50 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts @@ -0,0 +1,2 @@ +import type { GetConnInfo } from '../../helper/conninfo'; +export declare const getConnInfo: GetConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/vercel/handler.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/vercel/handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73bb38dca1e50149ba9a20bb8ec3d1a4c58c5cce --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/vercel/handler.d.ts @@ -0,0 +1,2 @@ +import type { Hono } from '../../hono'; +export declare const handle: (app: Hono) => (req: Request) => Response | Promise; diff --git a/tools/ui/node_modules/hono/dist/types/adapter/vercel/index.d.ts b/tools/ui/node_modules/hono/dist/types/adapter/vercel/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8645b763c3daa9beab5811eee552a6bfc5e8b14d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/adapter/vercel/index.d.ts @@ -0,0 +1,6 @@ +/** + * @module + * Vercel Adapter for Hono. + */ +export { handle } from './handler'; +export { getConnInfo } from './conninfo'; diff --git a/tools/ui/node_modules/hono/dist/types/client/client.d.ts b/tools/ui/node_modules/hono/dist/types/client/client.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a161b65c7abda3f17ae93608a6821e3914fc533 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/client/client.d.ts @@ -0,0 +1,4 @@ +import type { Hono } from '../hono'; +import type { UnionToIntersection } from '../utils/types'; +import type { Client, ClientRequestOptions } from './types'; +export declare const hc: , Prefix extends string = string>(baseUrl: Prefix, options?: ClientRequestOptions) => UnionToIntersection>; diff --git a/tools/ui/node_modules/hono/dist/types/client/fetch-result-please.d.ts b/tools/ui/node_modules/hono/dist/types/client/fetch-result-please.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f9558e07e3b9dde755c4c69cc284e58cc2f7b5c8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/client/fetch-result-please.d.ts @@ -0,0 +1,35 @@ +/** + * @description This file is a modified version of `fetch-result-please` (`ofetch`), minimalized and adapted to Hono's custom needs. + * + * @link https://www.npmjs.com/package/fetch-result-please + */ +/** + * Smartly parses and return the consumable result from a fetch `Response`. + * + * Throwing a structured error if the response is not `ok`. ({@link DetailedError}) + */ +export declare function fetchRP(fetchRes: Response | Promise): Promise; +export declare class DetailedError extends Error { + /** + * Additional `message` that will be logged AND returned to client + */ + detail?: any; + /** + * Additional `code` that will be logged AND returned to client + */ + code?: any; + /** + * Additional value that will be logged AND NOT returned to client + */ + log?: any; + /** + * Optionally set the status code to return, in a web server context + */ + statusCode?: any; + constructor(message: string, options?: { + detail?: any; + code?: any; + statusCode?: number; + log?: any; + }); +} diff --git a/tools/ui/node_modules/hono/dist/types/client/index.d.ts b/tools/ui/node_modules/hono/dist/types/client/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..841612762fcc03e9f55e8d6afd6464d55365e346 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/client/index.d.ts @@ -0,0 +1,7 @@ +/** + * @module + * The HTTP Client for Hono. + */ +export { hc } from './client'; +export { parseResponse, DetailedError } from './utils'; +export type { InferResponseType, InferRequestType, Fetch, ClientRequestOptions, ClientRequest, ClientResponse, ApplyGlobalResponse, PickResponseByStatusCode, } from './types'; diff --git a/tools/ui/node_modules/hono/dist/types/client/types.d.ts b/tools/ui/node_modules/hono/dist/types/client/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97a80ccfc22ec6e2a789aa98c4eae1d284b6aaa6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/client/types.d.ts @@ -0,0 +1,229 @@ +import type { Hono } from '../hono'; +import type { HonoBase } from '../hono-base'; +import type { METHODS, METHOD_NAME_ALL_LOWERCASE } from '../router'; +import type { Endpoint, ExtractSchema, KnownResponseFormat, ResponseFormat, Schema } from '../types'; +import type { StatusCode, SuccessStatusCode } from '../utils/http-status'; +import type { HasRequiredKeys } from '../utils/types'; +/** + * Type representing the '$all' method name + */ +type MethodNameAll = `$${typeof METHOD_NAME_ALL_LOWERCASE}`; +/** + * Type representing all standard HTTP methods prefixed with '$' + * e.g., '$get' | '$post' | '$put' | '$delete' | '$options' | '$patch' | '$query' + */ +type StandardMethods = `$${(typeof METHODS)[number]}`; +/** + * Expands '$all' into all standard HTTP methods. + * If the schema contains '$all', it creates a type where all standard HTTP methods + * point to the same endpoint definition as '$all', while removing '$all' itself. + */ +type ExpandAllMethod = MethodNameAll extends keyof S ? { + [M in StandardMethods]: S[MethodNameAll]; +} & Omit : S; +type HonoRequest = (typeof Hono.prototype)['request']; +export type BuildSearchParamsFn = (query: Record) => URLSearchParams; +export type ClientRequestOptions = { + fetch?: typeof fetch | HonoRequest; + webSocket?: (...args: ConstructorParameters) => WebSocket; + /** + * Standard `RequestInit`, caution that this take highest priority + * and could be used to overwrite things that Hono sets for you, like `body | method | headers`. + * + * If you want to add some headers, use in `headers` instead of `init` + */ + init?: RequestInit; + /** + * Custom function to serialize query parameters into URLSearchParams. + * By default, arrays are serialized as multiple parameters with the same key (e.g., `key=a&key=b`). + * You can provide a custom function to change this behavior, for example to use bracket notation (e.g., `key[]=a&key[]=b`). + * + * @example + * ```ts + * const client = hc('http://localhost', { + * buildSearchParams: (query) => { + * return new URLSearchParams(qs.stringify(query)) + * } + * }) + * ``` + */ + buildSearchParams?: BuildSearchParamsFn; +} & (keyof T extends never ? { + headers?: Record | (() => Record | Promise>); +} : { + headers: T | (() => T | Promise); +}); +export type ClientRequest = { + [M in keyof ExpandAllMethod]: ExpandAllMethod[M] extends Endpoint & { + input: infer R; + } ? R extends object ? HasRequiredKeys extends true ? (args: R, options?: ClientRequestOptions) => Promise[M]>> : (args?: R, options?: ClientRequestOptions) => Promise[M]>> : never : never; +} & { + $url: (arg?: Arg) => HonoURL; + $path: (arg?: Arg) => BuildPath; +} & (S['$get'] extends { + outputFormat: 'ws'; +} ? S['$get'] extends { + input: infer I; +} ? { + $ws: (args?: I) => WebSocket; +} : {} : {}); +type ClientResponseOfEndpoint = T extends { + output: infer O; + outputFormat: infer F; + status: infer S; +} ? ClientResponse : never; +export interface ClientResponse { + readonly body: ReadableStream | null; + readonly bodyUsed: boolean; + ok: U extends SuccessStatusCode ? true : U extends Exclude ? false : boolean; + redirected: boolean; + status: U; + statusText: string; + type: 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'; + headers: Headers; + url: string; + redirect(url: string, status: number): Response; + clone(): Response; + bytes(): Promise>; + json(): F extends 'text' ? Promise : F extends 'json' ? Promise : Promise; + text(): F extends 'text' ? (T extends string ? Promise : Promise) : Promise; + blob(): Promise; + formData(): Promise; + arrayBuffer(): Promise; +} +type BuildSearch = Arg extends { + [K in Key]: infer Query; +} ? IsEmptyObject extends true ? '' : `?${string}` : ''; +type BuildPathname

= Arg extends { + param: infer Param; +} ? `${ApplyParam, Param>}` : `/${TrimStartSlash

}`; +type BuildPath

= `${BuildPathname}${BuildSearch}`; +type BuildTypedURL = TypedURL<`${Protocol}:`, Host, Port, BuildPathname, BuildSearch>; +type HonoURL = IsLiteral extends true ? TrimEndSlash extends `${infer Protocol}://${infer Rest}` ? Rest extends `${infer Hostname}/${infer P}` ? ParseHostName extends [infer Host extends string, infer Port extends string] ? BuildTypedURL : never : ParseHostName extends [infer Host extends string, infer Port extends string] ? BuildTypedURL : never : URL : URL; +type ParseHostName = T extends `${infer Host}:${infer Port}` ? [Host, Port] : [T, '']; +type TrimStartSlash = T extends `/${infer R}` ? TrimStartSlash : T; +type TrimEndSlash = T extends `${infer R}/` ? TrimEndSlash : T; +type IsLiteral = [T] extends [never] ? false : string extends T ? false : true; +type ApplyParam = Path extends `${infer Head}/${infer Rest}` ? Head extends `:${infer Param}` ? P extends Record ? IsLiteral extends true ? ApplyParam : ApplyParam : ApplyParam : ApplyParam : Path extends `:${infer Param}` ? P extends Record ? IsLiteral extends true ? `${Result}/${Value & string}` : `${Result}/${Path}` : `${Result}/${Path}` : `${Result}/${Path}`; +type IsEmptyObject = keyof T extends never ? true : false; +export interface TypedURL extends URL { + protocol: Protocol; + hostname: Hostname; + port: Port; + host: Port extends '' ? Hostname : `${Hostname}:${Port}`; + origin: `${Protocol}//${Hostname}${Port extends '' ? '' : `:${Port}`}`; + pathname: Pathname; + search: Search; + href: `${Protocol}//${Hostname}${Port extends '' ? '' : `:${Port}`}${Pathname}${Search}`; +} +export interface Response extends ClientResponse { +} +export type Fetch = (args?: InferRequestType, opt?: ClientRequestOptions) => Promise>>; +type InferEndpointType = T extends (args: infer R, options: any | undefined) => Promise ? U extends ClientResponse ? { + input: NonNullable; + output: O; + outputFormat: F; + status: S; +} extends Endpoint ? { + input: NonNullable; + output: O; + outputFormat: F; + status: S; +} : never : never : never; +export type InferResponseType = InferResponseTypeFromEndpoint, U>; +type InferResponseTypeFromEndpoint = T extends { + output: infer O; + status: infer S; +} ? S extends U ? O : never : never; +export type InferRequestType = T extends (args: infer R, options: any | undefined) => Promise> ? NonNullable : never; +export type InferRequestOptionsType = T extends (args: any, options: infer R) => Promise> ? NonNullable : never; +/** + * Filter a ClientResponse type so it only includes responses of specific status codes. + */ +export type FilterClientResponseByStatusCode, U extends number = StatusCode> = T extends ClientResponse ? RC extends U ? ClientResponse : never : never; +type PathToChain = Path extends `/${infer P}` ? PathToChain : Path extends `${infer P}/${infer R}` ? { + [K in P]: PathToChain; +} : { + [K in Path extends '' ? 'index' : Path]: ClientRequest ? E[Original] : never>; +}; +export type Client = T extends HonoBase ? S extends Record ? K extends string ? PathToChain : never : never : never; +export type Callback = (opts: CallbackOptions) => unknown; +interface CallbackOptions { + path: string[]; + args: any[]; +} +export type ObjectType = { + [key: string]: T; +}; +type GlobalResponseDefinition = { + [S in StatusCode]?: { + [F in KnownResponseFormat]?: unknown; + }; +}; +type ToEndpoints = { + [S in keyof Def & StatusCode]: { + [F in keyof Def[S] & KnownResponseFormat]: Omit & { + output: Def[S][F]; + status: S; + outputFormat: F; + }; + }[keyof Def[S] & KnownResponseFormat]; +}[keyof Def & StatusCode]; +type ModRoute = R extends Endpoint ? R | ToEndpoints : R; +type ModSchema = { + [K in keyof D]: { + [M in keyof D[K]]: ModRoute; + }; +}; +export type ApplyGlobalResponse = App extends HonoBase ? ModSchema, Def> extends infer S extends Schema ? Hono : never : never; +type PickRoute = R extends Endpoint ? R extends { + status: U; +} ? R : never : R; +type PickSchema = { + [K in keyof D]: { + [M in keyof D[K]]: PickRoute; + }; +}; +/** + * Keep only specific status code responses from all routes of an app. + * Useful when error responses are handled centrally (e.g., via custom fetch) + * and you want the client to only expose success response types. + * + * @example + * ```ts + * type AppSuccessOnly = PickResponseByStatusCode + * const client = hc('http://localhost') + * ``` + */ +export type PickResponseByStatusCode = App extends HonoBase ? PickSchema, U> extends infer S extends Schema ? Hono : never : never; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/client/utils.d.ts b/tools/ui/node_modules/hono/dist/types/client/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..496020bca071be85d84c8f15ff9d06d6406c0e89 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/client/utils.d.ts @@ -0,0 +1,18 @@ +import type { ClientErrorStatusCode, ContentfulStatusCode, ServerErrorStatusCode } from '../utils/http-status'; +import { DetailedError } from './fetch-result-please'; +import type { ClientResponse, FilterClientResponseByStatusCode } from './types'; +export { DetailedError }; +export declare const mergePath: (base: string, path: string) => string; +export declare const replaceUrlParam: (urlString: string, params: Record) => string; +export declare const buildSearchParams: (query: Record) => URLSearchParams; +export declare const replaceUrlProtocol: (urlString: string, protocol: "ws" | "http") => string; +export declare const removeIndexString: (urlString: string) => string; +export declare function deepMerge(target: T, source: Record): T; +/** + * Shortcut to get a consumable response from `hc`'s fetch calls (Response), with types inference. + * + * Smartly parse the response data, throwing a structured error if the response is not `ok`. ({@link DetailedError}) + * + * @example const result = await parseResponse(client.posts.$get()) + */ +export declare function parseResponse>(fetchRes: T | Promise): Promise> extends never ? undefined : FilterClientResponseByStatusCode> extends ClientResponse ? RF extends 'json' ? RT : RT extends string ? RT : string : undefined>; diff --git a/tools/ui/node_modules/hono/dist/types/compose.d.ts b/tools/ui/node_modules/hono/dist/types/compose.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..937905e7638d1af672d349d60bf0f5329941f41e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/compose.d.ts @@ -0,0 +1,14 @@ +import type { Context } from './context'; +import type { Env, ErrorHandler, Next, NotFoundHandler } from './types'; +/** + * Compose middleware functions into a single function based on `koa-compose` package. + * + * @template E - The environment type. + * + * @param {[[Function, unknown], unknown][] | [[Function]][]} middleware - An array of middleware functions and their corresponding parameters. + * @param {ErrorHandler} [onError] - An optional error handler function. + * @param {NotFoundHandler} [onNotFound] - An optional not-found handler function. + * + * @returns {(context: Context, next?: Next) => Promise} - A composed middleware function. + */ +export declare const compose: (middleware: [[Function, unknown], unknown][] | [[Function]][], onError?: ErrorHandler, onNotFound?: NotFoundHandler) => ((context: Context, next?: Next) => Promise); diff --git a/tools/ui/node_modules/hono/dist/types/context.d.ts b/tools/ui/node_modules/hono/dist/types/context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95206a4e50afdaf3adcc506623f3cc587399f2fa --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/context.d.ts @@ -0,0 +1,455 @@ +import { HonoRequest } from './request'; +import type { Result } from './router'; +import type { Env, FetchEventLike, H, Input, NotFoundHandler, RouterRoute, TypedResponse } from './types'; +import type { ResponseHeader } from './utils/headers'; +import type { ContentfulStatusCode, RedirectStatusCode, StatusCode } from './utils/http-status'; +import type { BaseMime } from './utils/mime'; +import type { InvalidJSONValue, IsAny, JSONParsed, JSONValue } from './utils/types'; +type HeaderRecord = Record<'Content-Type', BaseMime> | Record | Record; +/** + * Data type can be a string, ArrayBuffer, Uint8Array (buffer), or ReadableStream. + */ +export type Data = string | ArrayBuffer | ReadableStream | Uint8Array; +/** + * Interface for the execution context in a web worker or similar environment. + */ +export interface ExecutionContext { + /** + * Extends the lifetime of the event callback until the promise is settled. + * + * @param promise - A promise to wait for. + */ + waitUntil(promise: Promise): void; + /** + * Allows the event to be passed through to subsequent event listeners. + */ + passThroughOnException(): void; + /** + * For compatibility with Wrangler 4.x. + */ + props: any; + /** + * For compatibility with Wrangler 4.x. + */ + exports?: any; +} +/** + * Interface for context variable mapping. + */ +export interface ContextVariableMap { +} +/** + * Interface for context renderer. + */ +export interface ContextRenderer { +} +/** + * Interface representing a renderer for content. + * + * @interface DefaultRenderer + * @param {string | Promise} content - The content to be rendered, which can be either a string or a Promise resolving to a string. + * @returns {Response | Promise} - The response after rendering the content, which can be either a Response or a Promise resolving to a Response. + */ +interface DefaultRenderer { + (content: string | Promise): Response | Promise; +} +/** + * Renderer type which can either be a ContextRenderer or DefaultRenderer. + */ +export type Renderer = ContextRenderer extends Function ? ContextRenderer : DefaultRenderer; +/** + * Extracts the props for the renderer. + */ +export type PropsForRenderer = [...Required>] extends [unknown, infer Props] ? Props : unknown; +export type Layout> = (props: T) => any; +/** + * Interface for getting context variables. + * + * @template E - Environment type. + */ +interface Get { + (key: Key): E['Variables'][Key]; + (key: Key): ContextVariableMap[Key]; +} +/** + * Interface for setting context variables. + * + * @template E - Environment type. + */ +interface Set { + (key: Key, value: E['Variables'][Key]): void; + (key: Key, value: ContextVariableMap[Key]): void; +} +/** + * Interface for creating a new response. + */ +interface NewResponse { + (data: Data | null, status?: StatusCode, headers?: HeaderRecord): Response; + (data: Data | null, init?: ResponseOrInit): Response; +} +/** + * Interface for responding with a body. + */ +interface BodyRespond { + (data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; + (data: T, init?: ResponseOrInit): Response & TypedResponse; + (data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; + (data: T, init?: ResponseOrInit): Response & TypedResponse; +} +/** + * Interface for responding with text. + * + * @interface TextRespond + * @template T - The type of the text content. + * @template U - The type of the status code. + * + * @param {T} text - The text content to be included in the response. + * @param {U} [status] - An optional status code for the response. + * @param {HeaderRecord} [headers] - An optional record of headers to include in the response. + * + * @returns {Response & TypedResponse} - The response after rendering the text content, typed with the provided text and status code types. + */ +interface TextRespond { + (text: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; + (text: T, init?: ResponseOrInit): Response & TypedResponse; +} +/** + * Interface for responding with JSON. + * + * @interface JSONRespond + * @template T - The type of the JSON value or simplified unknown type. + * @template U - The type of the status code. + * + * @param {T} object - The JSON object to be included in the response. + * @param {U} [status] - An optional status code for the response. + * @param {HeaderRecord} [headers] - An optional record of headers to include in the response. + * + * @returns {JSONRespondReturn} - The response after rendering the JSON object, typed with the provided object and status code types. + */ +interface JSONRespond { + (object: T, status?: U, headers?: HeaderRecord): JSONRespondReturn; + (object: T, init?: ResponseOrInit): JSONRespondReturn; +} +/** + * @template T - The type of the JSON value or simplified unknown type. + * @template U - The type of the status code. + * + * @returns {Response & TypedResponse, U, 'json'>} - The response after rendering the JSON object, typed with the provided object and status code types. + */ +type JSONRespondReturn = Response & TypedResponse, U, 'json'>; +/** + * Interface representing a function that responds with HTML content. + * + * @param html - The HTML content to respond with, which can be a string or a Promise that resolves to a string. + * @param status - (Optional) The HTTP status code for the response. + * @param headers - (Optional) A record of headers to include in the response. + * @param init - (Optional) The response initialization object. + * + * @returns A Response object or a Promise that resolves to a Response object. + */ +interface HTMLRespond { + >(html: T, status?: ContentfulStatusCode, headers?: HeaderRecord): T extends string ? Response : Promise; + >(html: T, init?: ResponseOrInit): T extends string ? Response : Promise; +} +/** + * Options for configuring the context. + * + * @template E - Environment type. + */ +type ContextOptions = { + /** + * Bindings for the environment. + */ + env: E['Bindings']; + /** + * Execution context for the request. + */ + executionCtx?: FetchEventLike | ExecutionContext | undefined; + /** + * Handler for not found responses. + */ + notFoundHandler?: NotFoundHandler; + matchResult?: Result<[H, RouterRoute]>; + path?: string; +}; +interface SetHeadersOptions { + append?: boolean; +} +interface SetHeaders { + (name: 'Content-Type', value?: BaseMime, options?: SetHeadersOptions): void; + (name: ResponseHeader, value?: string, options?: SetHeadersOptions): void; + (name: string, value?: string, options?: SetHeadersOptions): void; +} +type ResponseHeadersInit = [string, string][] | Record<'Content-Type', BaseMime> | Record | Record | Headers; +interface ResponseInit { + headers?: ResponseHeadersInit; + status?: T; + statusText?: string; +} +type ResponseOrInit = ResponseInit | Response; +export declare const TEXT_PLAIN = "text/plain; charset=UTF-8"; +export declare class Context { + + /** + * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers. + * + * @see {@link https://hono.dev/docs/api/context#env} + * + * @example + * ```ts + * // Environment object for Cloudflare Workers + * app.get('*', async c => { + * const counter = c.env.COUNTER + * }) + * ``` + */ + env: E['Bindings']; + finalized: boolean; + /** + * `.error` can get the error object from the middleware if the Handler throws an error. + * + * @see {@link https://hono.dev/docs/api/context#error} + * + * @example + * ```ts + * app.use('*', async (c, next) => { + * await next() + * if (c.error) { + * // do something... + * } + * }) + * ``` + */ + error: Error | undefined; + /** + * Creates an instance of the Context class. + * + * @param req - The Request object. + * @param options - Optional configuration options for the context. + */ + constructor(req: Request, options?: ContextOptions); + /** + * `.req` is the instance of {@link HonoRequest}. + */ + get req(): HonoRequest; + /** + * @see {@link https://hono.dev/docs/api/context#event} + * The FetchEvent associated with the current request. + * + * @throws Will throw an error if the context does not have a FetchEvent. + */ + get event(): FetchEventLike; + /** + * @see {@link https://hono.dev/docs/api/context#executionctx} + * The ExecutionContext associated with the current request. + * + * @throws Will throw an error if the context does not have an ExecutionContext. + */ + get executionCtx(): ExecutionContext; + /** + * @see {@link https://hono.dev/docs/api/context#res} + * The Response object for the current request. + */ + get res(): Response; + /** + * Sets the Response object for the current request. + * + * @param _res - The Response object to set. + */ + set res(_res: Response | undefined); + /** + * `.render()` can create a response within a layout. + * + * @see {@link https://hono.dev/docs/api/context#render-setrenderer} + * + * @example + * ```ts + * app.get('/', (c) => { + * return c.render('Hello!') + * }) + * ``` + */ + render: Renderer; + /** + * Sets the layout for the response. + * + * @param layout - The layout to set. + * @returns The layout function. + */ + setLayout: (layout: Layout) => Layout; + /** + * Gets the current layout for the response. + * + * @returns The current layout function. + */ + getLayout: () => Layout | undefined; + /** + * `.setRenderer()` can set the layout in the custom middleware. + * + * @see {@link https://hono.dev/docs/api/context#render-setrenderer} + * + * @example + * ```tsx + * app.use('*', async (c, next) => { + * c.setRenderer((content) => { + * return c.html( + * + * + *

{content}

+ * + * + * ) + * }) + * await next() + * }) + * ``` + */ + setRenderer: (renderer: Renderer) => void; + /** + * `.header()` can set headers. + * + * @see {@link https://hono.dev/docs/api/context#header} + * + * @example + * ```ts + * app.get('/welcome', (c) => { + * // Set headers + * c.header('X-Message', 'Hello!') + * c.header('Content-Type', 'text/plain') + * + * return c.body('Thank you for coming') + * }) + * ``` + */ + header: SetHeaders; + status: (status: StatusCode) => void; + /** + * `.set()` can set the value specified by the key. + * + * @see {@link https://hono.dev/docs/api/context#set-get} + * + * @example + * ```ts + * app.use('*', async (c, next) => { + * c.set('message', 'Hono is hot!!') + * await next() + * }) + * ``` + */ + set: Set extends true ? { + Variables: ContextVariableMap & Record; + } : E>; + /** + * `.get()` can use the value specified by the key. + * + * @see {@link https://hono.dev/docs/api/context#set-get} + * + * @example + * ```ts + * app.get('/', (c) => { + * const message = c.get('message') + * return c.text(`The message is "${message}"`) + * }) + * ``` + */ + get: Get extends true ? { + Variables: ContextVariableMap & Record; + } : E>; + /** + * `.var` can access the value of a variable. + * + * @see {@link https://hono.dev/docs/api/context#var} + * + * @example + * ```ts + * const result = c.var.client.oneMethod() + * ``` + */ + get var(): Readonly extends true ? Record : E['Variables'])>; + newResponse: NewResponse; + /** + * `.body()` can return the HTTP response. + * You can set headers with `.header()` and set HTTP status code with `.status`. + * This can also be set in `.text()`, `.json()` and so on. + * + * @see {@link https://hono.dev/docs/api/context#body} + * + * @example + * ```ts + * app.get('/welcome', (c) => { + * // Set headers + * c.header('X-Message', 'Hello!') + * c.header('Content-Type', 'text/plain') + * // Set HTTP status code + * c.status(201) + * + * // Return the response body + * return c.body('Thank you for coming') + * }) + * ``` + */ + body: BodyRespond; + /** + * `.text()` can render text as `Content-Type:text/plain`. + * + * @see {@link https://hono.dev/docs/api/context#text} + * + * @example + * ```ts + * app.get('/say', (c) => { + * return c.text('Hello!') + * }) + * ``` + */ + text: TextRespond; + /** + * `.json()` can render JSON as `Content-Type:application/json`. + * + * @see {@link https://hono.dev/docs/api/context#json} + * + * @example + * ```ts + * app.get('/api', (c) => { + * return c.json({ message: 'Hello!' }) + * }) + * ``` + */ + json: JSONRespond; + html: HTMLRespond; + /** + * `.redirect()` can Redirect, default status code is 302. + * + * @see {@link https://hono.dev/docs/api/context#redirect} + * + * @example + * ```ts + * app.get('/redirect', (c) => { + * return c.redirect('/') + * }) + * app.get('/redirect-permanently', (c) => { + * return c.redirect('/', 301) + * }) + * ``` + */ + redirect: (location: string | URL, status?: T) => Response & TypedResponse; + /** + * `.notFound()` can return the Not Found Response. + * + * @see {@link https://hono.dev/docs/api/context#notfound} + * + * @example + * ```ts + * app.get('/notfound', (c) => { + * return c.notFound() + * }) + * ``` + */ + notFound: () => ReturnType; +} +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/accepts/accepts.d.ts b/tools/ui/node_modules/hono/dist/types/helper/accepts/accepts.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..55cbee14acb0da14400ba100b50f2a91daee9073 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/accepts/accepts.d.ts @@ -0,0 +1,30 @@ +import type { Context } from '../../context'; +import type { AcceptHeader } from '../../utils/headers'; +export interface Accept { + type: string; + params: Record; + q: number; +} +export interface acceptsConfig { + header: AcceptHeader; + supports: string[]; + default: string; +} +export interface acceptsOptions extends acceptsConfig { + match?: (accepts: Accept[], config: acceptsConfig) => string; +} +export declare const defaultMatch: (accepts: Accept[], config: acceptsConfig) => string; +/** + * Match the accept header with the given options. + * @example + * ```ts + * app.get('/users', (c) => { + * const lang = accepts(c, { + * header: 'Accept-Language', + * supports: ['en', 'zh'], + * default: 'en', + * }) + * }) + * ``` + */ +export declare const accepts: (c: Context, options: acceptsOptions) => string; diff --git a/tools/ui/node_modules/hono/dist/types/helper/accepts/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/accepts/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..946d23e39080b6f9ed284c6627e04f4328980678 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/accepts/index.d.ts @@ -0,0 +1,5 @@ +/** + * @module + * Accepts Helper for Hono. + */ +export { accepts } from './accepts'; diff --git a/tools/ui/node_modules/hono/dist/types/helper/adapter/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/adapter/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..838391ac456a713118fb15f0f0e7888da49947ad --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/adapter/index.d.ts @@ -0,0 +1,12 @@ +/** + * @module + * Adapter Helper for Hono. + */ +import type { Context } from '../../context'; +export type Runtime = 'node' | 'deno' | 'bun' | 'workerd' | 'fastly' | 'edge-light' | 'other'; +export declare const env: , C extends Context = Context<{ + Bindings: T; +}>>(c: T extends Record ? Context : C, runtime?: Runtime) => T & C["env"]; +export declare const knownUserAgents: Partial>; +export declare const getRuntimeKey: () => Runtime; +export declare const checkUserAgentEquals: (platform: string) => boolean; diff --git a/tools/ui/node_modules/hono/dist/types/helper/conninfo/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/conninfo/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..876fb1df6b41fac939f209485924f6ee72a4694a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/conninfo/index.d.ts @@ -0,0 +1,5 @@ +/** + * @module + * ConnInfo Helper for Hono. + */ +export type { AddressType, NetAddrInfo, ConnInfo, GetConnInfo } from './types'; diff --git a/tools/ui/node_modules/hono/dist/types/helper/conninfo/types.d.ts b/tools/ui/node_modules/hono/dist/types/helper/conninfo/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..466af764ba17639a89e153efc3e68d1fb5486f3b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/conninfo/types.d.ts @@ -0,0 +1,36 @@ +import type { Context } from '../../context'; +export type AddressType = 'IPv6' | 'IPv4' | undefined; +export type NetAddrInfo = { + /** + * Transport protocol type + */ + transport?: 'tcp' | 'udp'; + /** + * Transport port number + */ + port?: number; + address?: string; + addressType?: AddressType; +} & ({ + /** + * Host name such as IP Addr + */ + address: string; + /** + * Host name type + */ + addressType: AddressType; +} | {}); +/** + * HTTP Connection information + */ +export interface ConnInfo { + /** + * Remote information + */ + remote: NetAddrInfo; +} +/** + * Helper type + */ +export type GetConnInfo = (c: Context) => ConnInfo; diff --git a/tools/ui/node_modules/hono/dist/types/helper/cookie/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/cookie/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc421b9a792710524aa7650fcadbcbfb7525e2b0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/cookie/index.d.ts @@ -0,0 +1,24 @@ +/** + * @module + * Cookie Helper for Hono. + */ +import type { Context } from '../../context'; +import type { Cookie, CookieOptions, CookiePrefixOptions, SignedCookie } from '../../utils/cookie'; +interface GetCookie { + (c: Context, key: string): string | undefined; + (c: Context): Cookie; + (c: Context, key: string, prefixOptions?: CookiePrefixOptions): string | undefined; +} +interface GetSignedCookie { + (c: Context, secret: string | BufferSource, key: string): Promise; + (c: Context, secret: string | BufferSource): Promise; + (c: Context, secret: string | BufferSource, key: string, prefixOptions?: CookiePrefixOptions): Promise; +} +export declare const getCookie: GetCookie; +export declare const getSignedCookie: GetSignedCookie; +export declare const generateCookie: (name: string, value: string, opt?: CookieOptions) => string; +export declare const setCookie: (c: Context, name: string, value: string, opt?: CookieOptions) => void; +export declare const generateSignedCookie: (name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise; +export declare const setSignedCookie: (c: Context, name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise; +export declare const deleteCookie: (c: Context, name: string, opt?: CookieOptions) => string | undefined; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/css/common.d.ts b/tools/ui/node_modules/hono/dist/types/helper/css/common.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb72404c5cce38694d2c764baf4c801a261d3759 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/css/common.d.ts @@ -0,0 +1,59 @@ +export declare const PSEUDO_GLOBAL_SELECTOR = ":-hono-global"; +export declare const isPseudoGlobalSelectorRe: RegExp; +export declare const DEFAULT_STYLE_ID = "hono-css"; +export declare const SELECTOR: unique symbol; +export declare const CLASS_NAME: unique symbol; +export declare const STYLE_STRING: unique symbol; +export declare const SELECTORS: unique symbol; +export declare const EXTERNAL_CLASS_NAMES: unique symbol; +declare const CSS_ESCAPED: unique symbol; +export interface CssClassName { + [SELECTOR]: string; + [CLASS_NAME]: string; + [STYLE_STRING]: string; + [SELECTORS]: CssClassName[]; + [EXTERNAL_CLASS_NAMES]: string[]; +} +export declare const IS_CSS_ESCAPED: unique symbol; +interface CssEscapedString { + [CSS_ESCAPED]: string; +} +/** + * @experimental + * `rawCssString` is an experimental feature. + * The API might be changed. + */ +export declare const rawCssString: (value: string) => CssEscapedString; +export declare const minify: (css: string) => string; +type CssVariableBasicType = CssClassName | CssEscapedString | string | number | boolean | null | undefined; +type CssVariableAsyncType = Promise; +type CssVariableArrayType = (CssVariableBasicType | CssVariableAsyncType)[]; +export type CssVariableType = CssVariableBasicType | CssVariableAsyncType | CssVariableArrayType; +/** + * A function that customizes generated CSS class names. + * + * @param hash - The default hash-based class name (e.g. `css-1234567890`) + * @param label - The comment label extracted from the CSS template, may be empty. + * Whitespace is trimmed and inner spaces are replaced with hyphens. + * @param styleString - The minified CSS style string + * @returns The custom class name to use. Must be a safe CSS identifier; + * otherwise, the default hash is used as a fallback. + */ +export type ClassNameSlug = (hash: string, label: string, styleString: string) => string; +/** + * A callback function called when an invalid slug is returned from ClassNameSlug. + * + * @param slug - The invalid slug + */ +export type OnInvalidSlug = (slug: string) => void; +export declare const buildStyleString: (strings: TemplateStringsArray, values: CssVariableType[]) => [string, string, CssClassName[], string[]]; +export declare const cssCommon: (strings: TemplateStringsArray, values: CssVariableType[], classNameSlug?: ClassNameSlug, onInvalidSlug?: OnInvalidSlug) => CssClassName; +export declare const cxCommon: (args: (string | boolean | null | undefined | CssClassName)[]) => (string | boolean | null | undefined | CssClassName)[]; +export declare const keyframesCommon: (strings: TemplateStringsArray, values: CssVariableType[], classNameSlug?: ClassNameSlug, onInvalidSlug?: OnInvalidSlug) => CssClassName; +type ViewTransitionType = { + (strings: TemplateStringsArray, values: CssVariableType[], classNameSlug?: ClassNameSlug, onInvalidSlug?: OnInvalidSlug): CssClassName; + (content: CssClassName): CssClassName; + (): CssClassName; +}; +export declare const viewTransitionCommon: ViewTransitionType; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/css/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/css/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39c43a7211c59d4854cfa26f06d13823be1e817f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/css/index.d.ts @@ -0,0 +1,80 @@ +/** + * @module + * css Helper for Hono. + */ +import type { HtmlEscapedString } from '../../utils/html'; +import type { ClassNameSlug, CssClassName as CssClassNameCommon, CssVariableType, OnInvalidSlug } from './common'; +export { rawCssString } from './common'; +export type { ClassNameSlug, OnInvalidSlug } from './common'; +type CssClassName = HtmlEscapedString & CssClassNameCommon; +interface CssType { + (strings: TemplateStringsArray, ...values: CssVariableType[]): Promise; +} +interface CxType { + (...args: (CssClassName | Promise | string | boolean | null | undefined)[]): Promise; +} +interface KeyframesType { + (strings: TemplateStringsArray, ...values: CssVariableType[]): CssClassNameCommon; +} +interface ViewTransitionType { + (strings: TemplateStringsArray, ...values: CssVariableType[]): Promise; + (content: Promise): Promise; + (): Promise; +} +interface StyleType { + (args?: { + children?: Promise; + nonce?: string; + }): HtmlEscapedString; +} +/** + * @experimental + * `createCssContext` is an experimental feature. + * The API might be changed. + * + * @param options.id - The ID for the style element + * @param options.classNameSlug - Optional function to customize generated CSS class names + * @param options.onInvalidSlug - Optional callback function called when an invalid slug is returned from ClassNameSlug + */ +export declare const createCssContext: ({ id, classNameSlug, onInvalidSlug, }: { + id: Readonly; + classNameSlug?: ClassNameSlug; + onInvalidSlug?: OnInvalidSlug; +}) => DefaultContextType; +interface DefaultContextType { + css: CssType; + cx: CxType; + keyframes: KeyframesType; + viewTransition: ViewTransitionType; + Style: StyleType; +} +/** + * @experimental + * `css` is an experimental feature. + * The API might be changed. + */ +export declare const css: CssType; +/** + * @experimental + * `cx` is an experimental feature. + * The API might be changed. + */ +export declare const cx: CxType; +/** + * @experimental + * `keyframes` is an experimental feature. + * The API might be changed. + */ +export declare const keyframes: KeyframesType; +/** + * @experimental + * `viewTransition` is an experimental feature. + * The API might be changed. + */ +export declare const viewTransition: ViewTransitionType; +/** + * @experimental + * `Style` is an experimental feature. + * The API might be changed. + */ +export declare const Style: StyleType; diff --git a/tools/ui/node_modules/hono/dist/types/helper/dev/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/dev/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..28eb4086d57847c4fdd87b857dd5c46e857dfbc1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/dev/index.d.ts @@ -0,0 +1,20 @@ +/** + * @module + * Dev Helper for Hono. + */ +import type { Hono } from '../../hono'; +import type { Env } from '../../types'; +interface ShowRoutesOptions { + verbose?: boolean; + colorize?: boolean; +} +interface RouteData { + path: string; + method: string; + name: string; + isMiddleware: boolean; +} +export declare const inspectRoutes: (hono: Hono) => RouteData[]; +export declare const showRoutes: (hono: Hono, opts?: ShowRoutesOptions) => void; +export declare const getRouterName: (app: Hono) => string; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/factory/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/factory/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f14b48aa62aafc38078b98393eb5df57f2eb30bf --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/factory/index.d.ts @@ -0,0 +1,82 @@ +/** + * @module + * Factory Helper for Hono. + */ +import { Hono } from '../../hono'; +import type { HonoOptions } from '../../hono-base'; +import type { Env, H, HandlerResponse, Input, IntersectNonAnyTypes, MiddlewareHandler } from '../../types'; +type InitApp = (app: Hono) => void; +export interface CreateHandlersInterface { + = any, E2 extends Env = E>(handler1: H): [H]; + = any, R2 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(handler1: H, handler2: H): [H, H]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(handler1: H, handler2: H, handler3: H): [H, H, H]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(handler1: H, handler2: H, handler3: H, handler4: H): [H, H, H, H]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H): [H, H, H, H, H]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H): [ + H, + H, + H, + H, + H, + H + ]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H): [ + H, + H, + H, + H, + H, + H, + H + ]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, R8 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H, handler8: H): [ + H, + H, + H, + H, + H, + H, + H, + H + ]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, R8 extends HandlerResponse = any, R9 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H, handler8: H, handler9: H): [ + H, + H, + H, + H, + H, + H, + H, + H, + H + ]; + = any, R2 extends HandlerResponse = any, R3 extends HandlerResponse = any, R4 extends HandlerResponse = any, R5 extends HandlerResponse = any, R6 extends HandlerResponse = any, R7 extends HandlerResponse = any, R8 extends HandlerResponse = any, R9 extends HandlerResponse = any, R10 extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(handler1: H, handler2: H, handler3: H, handler4: H, handler5: H, handler6: H, handler7: H, handler8: H, handler9: H, handler10: H): [ + H, + H, + H, + H, + H, + H, + H, + H, + H, + H + ]; +} +export declare class Factory { + + private initApp?; + constructor(init?: { + initApp?: InitApp; + defaultAppOptions?: HonoOptions; + }); + createApp: (options?: HonoOptions) => Hono; + createMiddleware: | void = void>(middleware: MiddlewareHandler) => MiddlewareHandler; + createHandlers: CreateHandlersInterface; +} +export declare const createFactory: (init?: { + initApp?: InitApp; + defaultAppOptions?: HonoOptions; +}) => Factory; +export declare const createMiddleware: | void = void>(middleware: MiddlewareHandler) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/html/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/html/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce17eac4abcfde9db2939b7848ca57dea071fd56 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/html/index.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * html Helper for Hono. + */ +import { raw } from '../../utils/html'; +import type { HtmlEscapedString } from '../../utils/html'; +export { raw }; +export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => HtmlEscapedString | Promise; diff --git a/tools/ui/node_modules/hono/dist/types/helper/proxy/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/proxy/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4a5b334edd154cef630bb50f2260a018dc75377d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/proxy/index.d.ts @@ -0,0 +1,72 @@ +/** + * @module + * Proxy Helper for Hono. + */ +import type { RequestHeader } from '../../utils/headers'; +interface ProxyRequestInit extends Omit { + raw?: Request; + headers?: HeadersInit | [string, string][] | Record | Record; + customFetch?: (request: Request) => Promise; + /** + * Enable strict RFC 9110 compliance for Connection header processing. + * + * - `false` (default): Ignores Connection header to prevent potential + * Hop-by-Hop Header Injection attacks. Recommended for untrusted clients. + * - `true`: Processes Connection header per RFC 9110 and removes listed headers. + * Only use in trusted environments. + * + * @default false + * @see https://datatracker.ietf.org/doc/html/rfc9110#section-7.6.1 + */ + strictConnectionProcessing?: boolean; +} +interface ProxyFetch { + (input: string | URL | Request, init?: ProxyRequestInit): Promise; +} +/** + * Fetch API wrapper for proxy. + * The parameters and return value are the same as for `fetch` (except for the proxy-specific options). + * + * The “Accept-Encoding” header is replaced with an encoding that the current runtime can handle. + * Unnecessary response headers are deleted and a Response object is returned that can be returned + * as is as a response from the handler. + * + * @example + * ```ts + * app.get('/proxy/:path', (c) => { + * return proxy(`http://${originServer}/${c.req.param('path')}`, { + * headers: { + * ...c.req.header(), // optional, specify only when forwarding all the request data (including credentials) is necessary. + * 'X-Forwarded-For': '127.0.0.1', + * 'X-Forwarded-Host': c.req.header('host'), + * Authorization: undefined, // do not propagate request headers contained in c.req.header('Authorization') + * }, + * }).then((res) => { + * res.headers.delete('Set-Cookie') + * return res + * }) + * }) + * + * app.all('/proxy/:path', (c) => { + * return proxy(`http://${originServer}/${c.req.param('path')}`, { + * ...c.req, // optional, specify only when forwarding all the request data (including credentials) is necessary. + * headers: { + * ...c.req.header(), + * 'X-Forwarded-For': '127.0.0.1', + * 'X-Forwarded-Host': c.req.header('host'), + * Authorization: undefined, // do not propagate request headers contained in c.req.header('Authorization') + * }, + * }) + * }) + * + * // Strict RFC compliance mode (use only in trusted environments) + * app.get('/internal-proxy/:path', (c) => { + * return proxy(`http://${internalServer}/${c.req.param('path')}`, { + * ...c.req, + * strictConnectionProcessing: true, + * }) + * }) + * ``` + */ +export declare const proxy: ProxyFetch; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/route/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/route/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f5af1e6392bdac5baf8b17bf01c79c0211b2eb92 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/route/index.d.ts @@ -0,0 +1,75 @@ +import type { Context } from '../../context'; +import type { RouterRoute } from '../../types'; +/** + * Get matched routes in the handler + * + * @param {Context} c - The context object + * @returns An array of matched routes + * + * @example + * ```ts + * import { matchedRoutes } from 'hono/route' + * + * app.use('*', async function logger(c, next) { + * await next() + * matchedRoutes(c).forEach(({ handler, method, path }, i) => { + * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') + * console.log( + * method, + * ' ', + * path, + * ' '.repeat(Math.max(10 - path.length, 0)), + * name, + * i === c.req.routeIndex ? '<- respond from here' : '' + * ) + * }) + * }) + * ``` + */ +export declare const matchedRoutes: (c: Context) => RouterRoute[]; +/** + * Get the route path registered within the handler + * + * @param {Context} c - The context object + * @param {number} index - The index of the root from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching root. Defaults to the current root index. + * @returns The route path registered within the handler + * + * @example + * ```ts + * import { routePath } from 'hono/route' + * + * app.use('*', (c, next) => { + * console.log(routePath(c)) // '*' + * console.log(routePath(c, -1)) // '/posts/:id' + * return next() + * }) + * + * app.get('/posts/:id', (c) => { + * return c.text(routePath(c)) // '/posts/:id' + * }) + * ``` + */ +export declare const routePath: (c: Context, index?: number) => string; +/** + * Get the basePath of the as-is route specified by routing. + * + * @param {Context} c - The context object + * @param {number} index - The index of the root from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching root. Defaults to the current root index. + * @returns The basePath of the as-is route specified by routing. + * + * @example + * ```ts + * import { baseRoutePath } from 'hono/route' + * + * const app = new Hono() + * + * const subApp = new Hono() + * subApp.get('/posts/:id', (c) => { + * return c.text(baseRoutePath(c)) // '/:sub' + * }) + * + * app.route('/:sub', subApp) + * ``` + */ +export declare const baseRoutePath: (c: Context, index?: number) => string; +export declare const basePath: (c: Context, index?: number) => string; diff --git a/tools/ui/node_modules/hono/dist/types/helper/ssg/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/ssg/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c2b66c56e5fbfd336494663a838a9df868a9a5b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/ssg/index.d.ts @@ -0,0 +1,7 @@ +/** + * @module + * SSG Helper for Hono. + */ +export * from './ssg'; +export { X_HONO_DISABLE_SSG_HEADER_KEY, ssgParams, isSSGContext, disableSSG, onlySSG, } from './middleware'; +export { defaultPlugin, redirectPlugin } from './plugins'; diff --git a/tools/ui/node_modules/hono/dist/types/helper/ssg/middleware.d.ts b/tools/ui/node_modules/hono/dist/types/helper/ssg/middleware.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..791ee402e8f518144084f5343478d05b074ad8c5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/ssg/middleware.d.ts @@ -0,0 +1,44 @@ +import type { Context } from '../../context'; +import type { Env, MiddlewareHandler } from '../../types'; +export declare const SSG_CONTEXT = "HONO_SSG_CONTEXT"; +export declare const X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg"; +/** + * @deprecated + * Use `X_HONO_DISABLE_SSG_HEADER_KEY` instead. + * This constant will be removed in the next minor version. + */ +export declare const SSG_DISABLED_RESPONSE: Response; +interface SSGParam { + [key: string]: string; +} +export type SSGParams = SSGParam[]; +interface SSGParamsMiddleware { + (generateParams: (c: Context) => SSGParams | Promise): MiddlewareHandler; + (params: SSGParams): MiddlewareHandler; +} +export type AddedSSGDataRequest = Request & { + ssgParams?: SSGParams; +}; +/** + * Define SSG Route + */ +export declare const ssgParams: SSGParamsMiddleware; +/** + * @experimental + * `isSSGContext` is an experimental feature. + * The API might be changed. + */ +export declare const isSSGContext: (c: Context) => boolean; +/** + * @experimental + * `disableSSG` is an experimental feature. + * The API might be changed. + */ +export declare const disableSSG: () => MiddlewareHandler; +/** + * @experimental + * `onlySSG` is an experimental feature. + * The API might be changed. + */ +export declare const onlySSG: () => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/ssg/plugins.d.ts b/tools/ui/node_modules/hono/dist/types/helper/ssg/plugins.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9623b219c948da1005cc3794467f0cd500df21ac --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/ssg/plugins.d.ts @@ -0,0 +1,27 @@ +import type { SSGPlugin } from './ssg'; +/** + * The default plugin that defines the recommended behavior. + * + * @experimental + * `defaultPlugin` is an experimental feature. + * The API might be changed. + */ +export declare const defaultPlugin: () => SSGPlugin; +/** + * The redirect plugin that generates HTML redirect pages for HTTP redirect responses for status codes 301, 302, 303, 307 and 308. + * + * When used with `defaultPlugin`, place `redirectPlugin` before it, because `defaultPlugin` skips non-200 responses. + * + * ```ts + * // ✅ Will work as expected + * toSSG(app, fs, { plugins: [redirectPlugin(), defaultPlugin()] }) + * + * // ❌ Will not work as expected + * toSSG(app, fs, { plugins: [defaultPlugin(), redirectPlugin()] }) + * ``` + * + * @experimental + * `redirectPlugin` is an experimental feature. + * The API might be changed. + */ +export declare const redirectPlugin: () => SSGPlugin; diff --git a/tools/ui/node_modules/hono/dist/types/helper/ssg/ssg.d.ts b/tools/ui/node_modules/hono/dist/types/helper/ssg/ssg.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e590443f5327df97fd4a9f62d8cda099d216983 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/ssg/ssg.d.ts @@ -0,0 +1,91 @@ +import type { Hono } from '../../hono'; +import type { Env, Schema } from '../../types'; +export declare const DEFAULT_OUTPUT_DIR = "./static"; +/** + * @experimental + * `FileSystemModule` is an experimental feature. + * The API might be changed. + */ +export interface FileSystemModule { + writeFile(path: string, data: string | Uint8Array): Promise; + mkdir(path: string, options: { + recursive: boolean; + }): Promise; +} +/** + * @experimental + * `ToSSGResult` is an experimental feature. + * The API might be changed. + */ +export interface ToSSGResult { + success: boolean; + files: string[]; + error?: Error; +} +export declare const defaultExtensionMap: Record; +export type BeforeRequestHook = (req: Request) => Request | false | Promise; +export type AfterResponseHook = (res: Response) => Response | false | Promise; +export type AfterGenerateHook = (result: ToSSGResult, fsModule: FileSystemModule, options?: ToSSGOptions) => void | Promise; +export declare const combineBeforeRequestHooks: (hooks: BeforeRequestHook | BeforeRequestHook[]) => BeforeRequestHook; +export declare const combineAfterResponseHooks: (hooks: AfterResponseHook | AfterResponseHook[]) => AfterResponseHook; +export declare const combineAfterGenerateHooks: (hooks: AfterGenerateHook | AfterGenerateHook[], fsModule: FileSystemModule, options?: ToSSGOptions) => AfterGenerateHook; +export interface SSGPlugin { + beforeRequestHook?: BeforeRequestHook | BeforeRequestHook[]; + afterResponseHook?: AfterResponseHook | AfterResponseHook[]; + afterGenerateHook?: AfterGenerateHook | AfterGenerateHook[]; +} +export interface ToSSGOptions { + dir?: string; + /** + * @deprecated Use plugins[].beforeRequestHook instead. + */ + beforeRequestHook?: BeforeRequestHook | BeforeRequestHook[]; + /** + * @deprecated Use plugins[].afterResponseHook instead. + */ + afterResponseHook?: AfterResponseHook | AfterResponseHook[]; + /** + * @deprecated Use plugins[].afterGenerateHook instead. + */ + afterGenerateHook?: AfterGenerateHook | AfterGenerateHook[]; + concurrency?: number; + extensionMap?: Record; + plugins?: SSGPlugin[]; +} +/** + * @experimental + * `fetchRoutesContent` is an experimental feature. + * The API might be changed. + */ +export declare const fetchRoutesContent: (app: Hono, beforeRequestHook?: BeforeRequestHook, afterResponseHook?: AfterResponseHook, concurrency?: number) => Generator> | undefined>>; +export declare const saveContentToFile: (data: Promise<{ + routePath: string; + content: string | ArrayBuffer; + mimeType: string; +} | undefined>, fsModule: FileSystemModule, outDir: string, extensionMap?: Record) => Promise; +/** + * @experimental + * `ToSSGInterface` is an experimental feature. + * The API might be changed. + */ +export interface ToSSGInterface { + (app: Hono, fsModule: FileSystemModule, options?: ToSSGOptions): Promise; +} +/** + * @experimental + * `ToSSGAdaptorInterface` is an experimental feature. + * The API might be changed. + */ +export interface ToSSGAdaptorInterface { + (app: Hono, options?: ToSSGOptions): Promise; +} +/** + * @experimental + * `toSSG` is an experimental feature. + * The API might be changed. + */ +export declare const toSSG: ToSSGInterface; diff --git a/tools/ui/node_modules/hono/dist/types/helper/ssg/utils.d.ts b/tools/ui/node_modules/hono/dist/types/helper/ssg/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..121b69985c6eda56fc4cdc672fbf16185cd57325 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/ssg/utils.d.ts @@ -0,0 +1,16 @@ +import type { Hono } from '../../hono'; +import type { Env } from '../../types'; +/** + * Get dirname + * @param path File Path + * @returns Parent dir path + */ +export declare const dirname: (path: string) => string; +export declare const joinPaths: (...paths: string[]) => string; +interface FilterStaticGenerateRouteData { + path: string; +} +export declare const filterStaticGenerateRoutes: (hono: Hono) => FilterStaticGenerateRouteData[]; +export declare const isDynamicRoute: (path: string) => boolean; +export declare const ensureWithinOutDir: (outDir: string, filePath: string) => void; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/streaming/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/streaming/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c89d67ef50b51626630ad48e48c964e55d78f6a6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/streaming/index.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * Streaming Helper for Hono. + */ +export { stream } from './stream'; +export type { SSEMessage } from './sse'; +export { streamSSE, SSEStreamingApi } from './sse'; +export { streamText } from './text'; diff --git a/tools/ui/node_modules/hono/dist/types/helper/streaming/sse.d.ts b/tools/ui/node_modules/hono/dist/types/helper/streaming/sse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c4cf6595b8dcb582901db5dfbdae86b68217d263 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/streaming/sse.d.ts @@ -0,0 +1,13 @@ +import type { Context } from '../../context'; +import { StreamingApi } from '../../utils/stream'; +export interface SSEMessage { + data: string | Promise; + event?: string; + id?: string; + retry?: number; +} +export declare class SSEStreamingApi extends StreamingApi { + constructor(writable: WritableStream, readable: ReadableStream); + writeSSE(message: SSEMessage): Promise; +} +export declare const streamSSE: (c: Context, cb: (stream: SSEStreamingApi) => Promise, onError?: (e: Error, stream: SSEStreamingApi) => Promise) => Response; diff --git a/tools/ui/node_modules/hono/dist/types/helper/streaming/stream.d.ts b/tools/ui/node_modules/hono/dist/types/helper/streaming/stream.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2c34ef8ec28dca00eb45fc08784ce155d7d35f76 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/streaming/stream.d.ts @@ -0,0 +1,3 @@ +import type { Context } from '../../context'; +import { StreamingApi } from '../../utils/stream'; +export declare const stream: (c: Context, cb: (stream: StreamingApi) => Promise, onError?: (e: Error, stream: StreamingApi) => Promise) => Response; diff --git a/tools/ui/node_modules/hono/dist/types/helper/streaming/text.d.ts b/tools/ui/node_modules/hono/dist/types/helper/streaming/text.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39934dcdb66d57b75fe13c3fbd6af06f42c531c1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/streaming/text.d.ts @@ -0,0 +1,3 @@ +import type { Context } from '../../context'; +import type { StreamingApi } from '../../utils/stream'; +export declare const streamText: (c: Context, cb: (stream: StreamingApi) => Promise, onError?: (e: Error, stream: StreamingApi) => Promise) => Response; diff --git a/tools/ui/node_modules/hono/dist/types/helper/streaming/utils.d.ts b/tools/ui/node_modules/hono/dist/types/helper/streaming/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ae4c7689bcd7a06624b52d0ba9ac6e727d182c0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/streaming/utils.d.ts @@ -0,0 +1 @@ +export declare let isOldBunVersion: () => boolean; diff --git a/tools/ui/node_modules/hono/dist/types/helper/testing/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/testing/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..208d3102e52ceddbbdc43b0249af1056a788d68d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/testing/index.d.ts @@ -0,0 +1,12 @@ +/** + * @module + * Testing Helper for Hono. + */ +import type { Client, ClientRequestOptions } from '../../client/types'; +import type { ExecutionContext } from '../../context'; +import type { Hono } from '../../hono'; +import type { Schema } from '../../types'; +import type { UnionToIntersection } from '../../utils/types'; +type ExtractEnv = T extends Hono ? E : never; +export declare const testClient: >(app: T, Env?: ExtractEnv["Bindings"] | {}, executionCtx?: ExecutionContext, options?: Omit) => UnionToIntersection>; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/helper/websocket/index.d.ts b/tools/ui/node_modules/hono/dist/types/helper/websocket/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..675792b1001b8742d977796fa86493761947317a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/helper/websocket/index.d.ts @@ -0,0 +1,69 @@ +/** + * @module + * WebSocket Helper for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler, TypedResponse } from '../../types'; +import type { StatusCode } from '../../utils/http-status'; +/** + * WebSocket Event Listeners type + */ +export interface WSEvents { + onOpen?: (evt: Event, ws: WSContext) => void; + onMessage?: (evt: MessageEvent, ws: WSContext) => void; + onClose?: (evt: CloseEvent, ws: WSContext) => void; + onError?: (evt: Event, ws: WSContext) => void; +} +/** + * Upgrade WebSocket Type + */ +export interface UpgradeWebSocket> { + (createEvents: (c: Context) => _WSEvents | Promise<_WSEvents>, options?: U): MiddlewareHandler; + (c: Context, events: _WSEvents, options?: U): Promise>; +} +/** + * ReadyState for WebSocket + */ +export type WSReadyState = 0 | 1 | 2 | 3; +/** + * An argument for WSContext class + */ +export interface WSContextInit { + send(data: string | ArrayBuffer | Uint8Array, options: SendOptions): void; + close(code?: number, reason?: string): void; + raw?: T; + readyState: WSReadyState; + url?: string | URL | null; + protocol?: string | null; +} +/** + * Options for sending message + */ +export interface SendOptions { + compress?: boolean; +} +/** + * A context for controlling WebSockets + */ +export declare class WSContext { + + constructor(init: WSContextInit); + send(source: string | ArrayBuffer | Uint8Array, options?: SendOptions): void; + raw?: T; + binaryType: BinaryType; + get readyState(): WSReadyState; + url: URL | null; + protocol: string | null; + close(code?: number, reason?: string): void; +} +export type WSMessageReceive = string | Blob | ArrayBufferLike; +export declare const createWSMessageEvent: (source: WSMessageReceive) => MessageEvent; +export interface WebSocketHelperDefineContext { +} +export type WebSocketHelperDefineHandler = (c: Context, events: WSEvents, options?: U) => Promise | Response | void; +/** + * Create a WebSocket adapter/helper + */ +export declare const defineWebSocketHelper: (handler: WebSocketHelperDefineHandler) => UpgradeWebSocket; diff --git a/tools/ui/node_modules/hono/dist/types/hono-base.d.ts b/tools/ui/node_modules/hono/dist/types/hono-base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1b6ea92b3afaf075375b3bf57a3ef9989169d5f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/hono-base.d.ts @@ -0,0 +1,221 @@ +/** + * @module + * This module is the base module for the Hono object. + */ +import { Context } from './context'; +import type { ExecutionContext } from './context'; +import type { Router } from './router'; +import type { Env, ErrorHandler, H, HandlerInterface, MergePath, MergeSchemaPath, MiddlewareHandlerInterface, NotFoundHandler, OnHandlerInterface, RouterRoute, Schema } from './types'; +type GetPath = (request: Request, options?: { + env?: E['Bindings']; +}) => string; +export type HonoOptions = { + /** + * `strict` option specifies whether to distinguish whether the last path is a directory or not. + * + * @see {@link https://hono.dev/docs/api/hono#strict-mode} + * + * @default true + */ + strict?: boolean; + /** + * `router` option specifies which router to use. + * + * @see {@link https://hono.dev/docs/api/hono#router-option} + * + * @example + * ```ts + * const app = new Hono({ router: new RegExpRouter() }) + * ``` + */ + router?: Router<[H, RouterRoute]>; + /** + * `getPath` can handle the host header value. + * + * @see {@link https://hono.dev/docs/api/routing#routing-with-host-header-value} + * + * @example + * ```ts + * const app = new Hono({ + * getPath: (req) => + * '/' + req.headers.get('host') + req.url.replace(/^https?:\/\/[^/]+(\/[^?]*)/, '$1'), + * }) + * + * app.get('/www1.example.com/hello', () => c.text('hello www1')) + * + * // A following request will match the route: + * // new Request('http://www1.example.com/hello', { + * // headers: { host: 'www1.example.com' }, + * // }) + * ``` + */ + getPath?: GetPath; +}; +type MountOptionHandler = (c: Context) => unknown; +type MountReplaceRequest = (originalRequest: Request) => Request; +type MountOptions = MountOptionHandler | { + optionHandler?: MountOptionHandler; + replaceRequest?: MountReplaceRequest | false; +}; +declare class Hono { + + get: HandlerInterface; + post: HandlerInterface; + put: HandlerInterface; + delete: HandlerInterface; + options: HandlerInterface; + patch: HandlerInterface; + query: HandlerInterface; + all: HandlerInterface; + on: OnHandlerInterface; + use: MiddlewareHandlerInterface; + router: Router<[H, RouterRoute]>; + readonly getPath: GetPath; + private _basePath; + routes: RouterRoute[]; + constructor(options?: HonoOptions); + private errorHandler; + /** + * `.route()` allows grouping other Hono instance in routes. + * + * @see {@link https://hono.dev/docs/api/routing#grouping} + * + * @param {string} path - base Path + * @param {Hono} app - other Hono instance + * @returns {Hono} routed Hono instance + * + * @example + * ```ts + * const app = new Hono() + * const app2 = new Hono() + * + * app2.get("/user", (c) => c.text("user")) + * app.route("/api", app2) // GET /api/user + * ``` + */ + route(path: SubPath, app: Hono): Hono> | S, BasePath, CurrentPath>; + /** + * `.basePath()` allows base paths to be specified. + * + * @see {@link https://hono.dev/docs/api/routing#base-path} + * + * @param {string} path - base Path + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * const api = new Hono().basePath('/api') + * ``` + */ + basePath(path: SubPath): Hono, MergePath>; + /** + * `.onError()` handles an error and returns a customized Response. + * + * @see {@link https://hono.dev/docs/api/hono#error-handling} + * + * @param {ErrorHandler} handler - request Handler for error + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * app.onError((err, c) => { + * console.error(`${err}`) + * return c.text('Custom Error Message', 500) + * }) + * ``` + */ + onError: (handler: ErrorHandler) => Hono; + /** + * `.notFound()` allows you to customize a Not Found Response. + * + * @see {@link https://hono.dev/docs/api/hono#not-found} + * + * @param {NotFoundHandler} handler - request handler for not-found + * @returns {Hono} changed Hono instance + * + * @example + * ```ts + * app.notFound((c) => { + * return c.text('Custom 404 Message', 404) + * }) + * ``` + */ + notFound: (handler: NotFoundHandler) => Hono; + /** + * `.mount()` allows you to mount applications built with other frameworks into your Hono application. + * + * @see {@link https://hono.dev/docs/api/hono#mount} + * + * @param {string} path - base Path + * @param {Function} applicationHandler - other Request Handler + * @param {MountOptions} [options] - options of `.mount()` + * @returns {Hono} mounted Hono instance + * + * @example + * ```ts + * import { Router as IttyRouter } from 'itty-router' + * import { Hono } from 'hono' + * // Create itty-router application + * const ittyRouter = IttyRouter() + * // GET /itty-router/hello + * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) + * + * const app = new Hono() + * app.mount('/itty-router', ittyRouter.handle) + * ``` + * + * @example + * ```ts + * const app = new Hono() + * // Send the request to another application without modification. + * app.mount('/app', anotherApp, { + * replaceRequest: (req) => req, + * }) + * ``` + */ + mount(path: string, applicationHandler: (request: Request, ...args: any) => Response | Promise, options?: MountOptions): Hono; + /** + * `.fetch()` will be entry point of your app. + * + * @see {@link https://hono.dev/docs/api/hono#fetch} + * + * @param {Request} request - request Object of request + * @param {Env} env - env Object + * @param {ExecutionContext} executionCtx - context of execution + * @returns {Response | Promise} response of request + * + */ + fetch: (request: Request, env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => Response | Promise; + /** + * `.request()` is a useful method for testing. + * You can pass a URL or pathname to send a GET request. + * app will return a Response object. + * ```ts + * test('GET /hello is ok', async () => { + * const res = await app.request('/hello') + * expect(res.status).toBe(200) + * }) + * ``` + * @see https://hono.dev/docs/api/hono#request + */ + request: (input: Request | string | URL, requestInit?: RequestInit, Env?: E["Bindings"] | {}, executionCtx?: ExecutionContext) => Response | Promise; + /** + * `.fire()` automatically adds a global fetch event listener. + * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. + * @deprecated + * Use `fire` from `hono/service-worker` instead. + * ```ts + * import { Hono } from 'hono' + * import { fire } from 'hono/service-worker' + * + * const app = new Hono() + * // ... + * fire(app) + * ``` + * @see https://hono.dev/docs/api/hono#fire + * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API + * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ + */ + fire: () => void; +} +export { Hono as HonoBase }; diff --git a/tools/ui/node_modules/hono/dist/types/hono.d.ts b/tools/ui/node_modules/hono/dist/types/hono.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..caeb4dcf45d4442226606594c5dff4b6387b4a72 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/hono.d.ts @@ -0,0 +1,19 @@ +import { HonoBase } from './hono-base'; +import type { HonoOptions } from './hono-base'; +import type { BlankEnv, BlankSchema, Env, Schema } from './types'; +/** + * The Hono class extends the functionality of the HonoBase class. + * It sets up routing and allows for custom options to be passed. + * + * @template E - The environment type. + * @template S - The schema type. + * @template BasePath - The base path type. + */ +export declare class Hono extends HonoBase { + /** + * Creates an instance of the Hono class. + * + * @param options - Optional configuration options for the Hono instance. + */ + constructor(options?: HonoOptions); +} diff --git a/tools/ui/node_modules/hono/dist/types/http-exception.d.ts b/tools/ui/node_modules/hono/dist/types/http-exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b90ccabae9f8528f4dee6c19b3020f87d82ec1a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/http-exception.d.ts @@ -0,0 +1,59 @@ +/** + * @module + * This module provides the `HTTPException` class. + */ +import type { ContentfulStatusCode } from './utils/http-status'; +/** + * Options for creating an `HTTPException`. + * @property res - Optional response object to use. + * @property message - Optional custom error message. + * @property cause - Optional cause of the error. + */ +type HTTPExceptionOptions = { + res?: Response; + message?: string; + cause?: unknown; +}; +/** + * `HTTPException` must be used when a fatal error such as authentication failure occurs. + * + * @see {@link https://hono.dev/docs/api/exception} + * + * @param {StatusCode} status - status code of HTTPException + * @param {HTTPExceptionOptions} options - options of HTTPException + * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException + * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException + * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException + * + * @example + * ```ts + * import { HTTPException } from 'hono/http-exception' + * + * // ... + * + * app.post('/auth', async (c, next) => { + * // authentication + * if (authorized === false) { + * throw new HTTPException(401, { message: 'Custom error message' }) + * } + * await next() + * }) + * ``` + */ +export declare class HTTPException extends Error { + readonly res?: Response; + readonly status: ContentfulStatusCode; + /** + * Creates an instance of `HTTPException`. + * @param status - HTTP status code for the exception. Defaults to 500. + * @param options - Additional options for the exception. + */ + constructor(status?: ContentfulStatusCode, options?: HTTPExceptionOptions); + /** + * Returns the response object associated with the exception. + * If a response object is not provided, a new response is created with the error message and status code. + * @returns The response object. + */ + getResponse(): Response; +} +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/index.d.ts b/tools/ui/node_modules/hono/dist/types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e7b982fd1f66aa57e749859a220d293984f37c9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/index.d.ts @@ -0,0 +1,37 @@ +/** + * @module + * + * Hono - Web Framework built on Web Standards + * + * @example + * ```ts + * import { Hono } from 'hono' + * const app = new Hono() + * + * app.get('/', (c) => c.text('Hono!')) + * + * export default app + * ``` + */ +import { Hono } from './hono'; +/** + * Types for environment variables, error handlers, handlers, middleware handlers, and more. + */ +export type { Env, ErrorHandler, Handler, MiddlewareHandler, Next, NotFoundResponse, NotFoundHandler, ValidationTargets, Input, Schema, ToSchema, TypedResponse, } from './types'; +/** + * Types for context, context variable map, context renderer, and execution context. + */ +export { Context } from './context'; +export type { ContextVariableMap, ContextRenderer, ExecutionContext } from './context'; +/** + * Type for HonoRequest. + */ +export type { HonoRequest } from './request'; +/** + * Types for inferring request and response types and client request options. + */ +export type { InferRequestType, InferResponseType, ClientRequestOptions } from './client'; +/** + * Hono framework for building web applications. + */ +export { Hono }; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/base.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..270308d6a0bc2156c250f28c696faec89c593057 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/base.d.ts @@ -0,0 +1,58 @@ +import type { HtmlEscaped, HtmlEscapedString, StringBufferWithCallbacks } from '../utils/html'; +import { DOM_MEMO } from './constants'; +import type { Context } from './context'; +import type { JSX as HonoJSX, IntrinsicElements as IntrinsicElementsDefined } from './intrinsic-elements'; +export type Props = Record; +type FunctionComponentResult = HtmlEscapedString | Child[] | Promise | null; +export type FC

= { + (props: P): FunctionComponentResult; + defaultProps?: Partial

| undefined; + displayName?: string | undefined; +}; +export type DOMAttributes = HonoJSX.HTMLAttributes; +export declare namespace JSX { + type Element = HtmlEscapedString | Promise; + type ElementType = string | ((props: never) => FunctionComponentResult); + interface ElementChildrenAttribute { + children: Child; + } + interface IntrinsicElements extends IntrinsicElementsDefined { + [tagName: string]: Props; + } + interface IntrinsicAttributes { + key?: string | number | bigint | null | undefined; + } +} +export declare const getNameSpaceContext: () => Context | undefined; +export declare const booleanAttributes: string[]; +export type Child = string | Promise | number | JSXNode | null | undefined | boolean | Child[]; +export declare class JSXNode implements HtmlEscaped { + tag: string | Function; + props: Props; + key?: string; + children: Child[]; + isEscaped: true; + constructor(tag: string | Function, props: Props, children: Child[]); + get type(): string | Function; + get ref(): any; + toString(): string | Promise; + toStringToBuffer(buffer: StringBufferWithCallbacks): void; +} +export declare class JSXFragmentNode extends JSXNode { + toStringToBuffer(buffer: StringBufferWithCallbacks): void; +} +export declare const jsx: (tag: string | Function, props: Props | null, ...children: Child[]) => JSXNode; +export declare const jsxFn: (tag: string | Function, props: Props, children: Child[]) => JSXNode; +export declare const shallowEqual: (a: Props, b: Props) => boolean; +export type MemorableFC = FC & { + [DOM_MEMO]: (prevProps: Readonly, nextProps: Readonly) => boolean; +}; +export declare const memo: (component: FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => FC; +export declare const Fragment: ({ children, }: { + key?: string; + children?: Child | HtmlEscapedString; +}) => HtmlEscapedString; +export declare const isValidElement: (element: unknown) => element is JSXNode; +export declare const cloneElement: (element: T, props: Partial, ...children: Child[]) => T; +export declare const reactAPICompatVersion = "19.0.0-hono-jsx"; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/children.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/children.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e13b27938f18fa077b5245038eeb84ccb07e2d1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/children.d.ts @@ -0,0 +1,9 @@ +import type { Child } from './base'; +export declare const toArray: (children: Child) => Child[]; +export declare const Children: { + map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[]; + forEach: (children: Child[], fn: (child: Child, index: number) => void) => void; + count: (children: Child[]) => number; + only: (_children: Child[]) => Child; + toArray: (children: Child) => Child[]; +}; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/components.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/components.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ede9201f7989b3912f634fcc5435be726961af7d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/components.d.ts @@ -0,0 +1,15 @@ +import type { HtmlEscapedString } from '../utils/html'; +import type { Child, FC, PropsWithChildren } from './'; +export declare const childrenToString: (children: Child[]) => Promise; +export type ErrorHandler = (error: Error) => void; +export type FallbackRender = (error: Error) => Child; +/** + * @experimental + * `ErrorBoundary` is an experimental feature. + * The API might be changed. + */ +export declare const ErrorBoundary: FC>; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/constants.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..27b96060a3e6a05fc24cee571a7e82ff25b049f9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/constants.d.ts @@ -0,0 +1,6 @@ +export declare const DOM_RENDERER: unique symbol; +export declare const DOM_ERROR_HANDLER: unique symbol; +export declare const DOM_STASH: unique symbol; +export declare const DOM_INTERNAL_TAG: unique symbol; +export declare const DOM_MEMO: unique symbol; +export declare const PERMALINK: unique symbol; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/context.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..79891255e1009ece582e7f1638072c51b410881f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/context.d.ts @@ -0,0 +1,51 @@ +import type { FC, PropsWithChildren } from './'; +export interface Context extends FC> { + values: T[]; + Provider: FC>; +} +export declare const globalContexts: Context[]; +/** Per-render context store, isolated per request so values never leak across renders. */ +type RenderStore = WeakMap, unknown[]>; +/** + * Establish the request-scoped context store for a render. + * + * `resumeStore` continues a suspended subtree in the same store on the fallback + * path (ignored when `AsyncLocalStorage` is available, where isolation is + * automatic). + * + * Without `AsyncLocalStorage` a render can't be followed across `await`, so the + * store lives in `fallbackStore` only during synchronous work (mirroring + * React's request storage). Reading context after `await` then finds no store + * and falls back to the default value — never another request's value. + */ +export declare const runWithRenderContext: (callback: () => T, resumeStore?: RenderStore) => T; +/** + * Capture the current render store and return a resumer that re-establishes it + * around a deferred continuation (e.g. a re-render after a suspended promise + * settles). Shared by every suspension point so none reimplements it. + */ +export declare const captureRenderContext: () => ((callback: () => T) => T); +/** + * Create a context whose value can be provided with `` and + * read with {@link useContext}. + * + * Server-side renders are isolated per request, so a provided value never leaks + * into a concurrent request — even across `await` in an async component, when + * `AsyncLocalStorage` is available (Node.js >= 20.16, Deno, Bun, Cloudflare + * Workers with `nodejs_compat`). Without it, reading context after `await` + * returns the default value; synchronous components and `use()`-based + * suspension are unaffected. + */ +export declare const createContext: (defaultValue: T) => Context; +/** + * Read the current value of a context created with {@link createContext}. + * + * Safe to call from async components after `await`. See {@link createContext} + * for the per-runtime isolation guarantees. + */ +export declare const useContext: (context: Context) => T; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/client.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/client.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a30e3e416ab17da6e6c4bc99da582cb96e2afce7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/client.d.ts @@ -0,0 +1,31 @@ +/** + * @module + * This module provides APIs for `hono/jsx/dom/client`, which is compatible with `react-dom/client`. + */ +import type { Child } from '../base'; +export interface Root { + render(children: Child): void; + unmount(): void; +} +export type RootOptions = Record; +/** + * Create a root object for rendering + * @param element Render target + * @param options Options for createRoot (not supported yet) + * @returns Root object has `render` and `unmount` methods + */ +export declare const createRoot: (element: HTMLElement | DocumentFragment, options?: RootOptions) => Root; +/** + * Create a root object and hydrate app to the target element. + * In hono/jsx/dom, hydrate is equivalent to render. + * @param element Render target + * @param reactNode A JSXNode to render + * @param options Options for createRoot (not supported yet) + * @returns Root object has `render` and `unmount` methods + */ +export declare const hydrateRoot: (element: HTMLElement | DocumentFragment, reactNode: Child, options?: RootOptions) => Root; +declare const _default: { + createRoot: (element: HTMLElement | DocumentFragment, options?: RootOptions) => Root; + hydrateRoot: (element: HTMLElement | DocumentFragment, reactNode: Child, options?: RootOptions) => Root; +}; +export default _default; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/components.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/components.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..54beaef4474e6e81130bc768b7020fd4f3130a3e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/components.d.ts @@ -0,0 +1,10 @@ +import type { Child, FC, PropsWithChildren } from '../'; +import type { ErrorHandler, FallbackRender } from '../components'; +export declare const ErrorBoundary: FC>; +export declare const Suspense: FC>; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/context.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ba9b54b8aabf36ab420a54d56f0ccca67c7c3aaa --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/context.d.ts @@ -0,0 +1,3 @@ +import type { Context } from '../context'; +export declare const createContextProviderFunction: (values: T[]) => Function; +export declare const createContext: (defaultValue: T) => Context; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/css.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/css.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..484b07965b762f2c4ffdcc153bb6d9b960911ad4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/css.d.ts @@ -0,0 +1,83 @@ +/** + * @module + * This module provides APIs that enable `hono/jsx/dom` to support. + */ +import type { FC, PropsWithChildren } from '../'; +import type { ClassNameSlug, CssClassName, CssVariableType, OnInvalidSlug } from '../../helper/css/common'; +export { rawCssString } from '../../helper/css/common'; +interface CreateCssJsxDomObjectsType { + (args: { + id: Readonly; + }): readonly [ + { + toString(this: CssClassName): string; + }, + FC> + ]; +} +export declare const createCssJsxDomObjects: CreateCssJsxDomObjectsType; +interface CssType { + (strings: TemplateStringsArray, ...values: CssVariableType[]): string; +} +interface CxType { + (...args: (string | boolean | null | undefined)[]): string; +} +interface KeyframesType { + (strings: TemplateStringsArray, ...values: CssVariableType[]): CssClassName; +} +interface ViewTransitionType { + (strings: TemplateStringsArray, ...values: CssVariableType[]): string; + (content: string): string; + (): string; +} +interface DefaultContextType { + css: CssType; + cx: CxType; + keyframes: KeyframesType; + viewTransition: ViewTransitionType; + Style: FC>; +} +/** + * @experimental + * `createCssContext` is an experimental feature. + * The API might be changed. + * + * @param options.id - The ID for the style element + * @param options.classNameSlug - Optional function to customize generated CSS class names + * @param options.onInvalidSlug - Optional callback function called when an invalid slug is returned from ClassNameSlug + */ +export declare const createCssContext: ({ id, classNameSlug, onInvalidSlug, }: { + id: Readonly; + classNameSlug?: ClassNameSlug; + onInvalidSlug?: OnInvalidSlug; +}) => DefaultContextType; +/** + * @experimental + * `css` is an experimental feature. + * The API might be changed. + */ +export declare const css: CssType; +/** + * @experimental + * `cx` is an experimental feature. + * The API might be changed. + */ +export declare const cx: CxType; +/** + * @experimental + * `keyframes` is an experimental feature. + * The API might be changed. + */ +export declare const keyframes: KeyframesType; +/** + * @experimental + * `viewTransition` is an experimental feature. + * The API might be changed. + */ +export declare const viewTransition: ViewTransitionType; +/** + * @experimental + * `Style` is an experimental feature. + * The API might be changed. + */ +export declare const Style: FC>; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eca26aedc6b08fc9a83ef99f78fc2e4c31e51646 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts @@ -0,0 +1,39 @@ +/** + * Provide hooks used only in jsx/dom + */ +import type { Context } from '../../context'; +type FormStatus = { + pending: false; + data: null; + method: null; + action: null; +} | { + pending: true; + data: FormData; + method: 'get' | 'post'; + action: string | ((formData: FormData) => void | Promise); +}; +export declare const FormContext: Context; +export declare const registerAction: (action: Promise) => void; +/** + * This hook returns the current form status + * @returns FormStatus + */ +export declare const useFormStatus: () => FormStatus; +/** + * This hook returns the current state and a function to update the state optimistically + * The current state is updated optimistically and then reverted to the original state when all actions are resolved + * @param state + * @param updateState + * @returns [T, (action: N) => void] + */ +export declare const useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; +/** + * This hook returns the current state and a function to update the state by form action + * @param fn + * @param initialState + * @param permalink + * @returns [T, (data: FormData) => void] + */ +export declare const useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/index.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bda7c2ea45c0f79d09b453b093f96c20d8c7660 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/index.d.ts @@ -0,0 +1,88 @@ +/** + * @module + * This module provides APIs for `hono/jsx/dom`. + */ +import { isValidElement, reactAPICompatVersion } from '../base'; +import type { Child, DOMAttributes, JSX, JSXNode, Props, FC } from '../base'; +import { Children } from '../children'; +import { useContext } from '../context'; +import { createRef, forwardRef, startTransition, startViewTransition, use, useCallback, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition } from '../hooks'; +import { ErrorBoundary, Suspense } from './components'; +import { createContext } from './context'; +import { useActionState, useFormStatus, useOptimistic } from './hooks'; +import { Fragment } from './jsx-runtime'; +import { createPortal, flushSync } from './render'; +export { render } from './render'; +declare const createElement: (tag: string | ((props: Props) => JSXNode), props: Props | null, ...children: Child[]) => JSXNode; +declare const cloneElement: (element: T, props: Props, ...children: Child[]) => T; +declare const memo: (component: FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => FC; +export { reactAPICompatVersion as version, createElement as jsx, useState, useEffect, useRef, useCallback, use, startTransition, useTransition, useDeferredValue, startViewTransition, useViewTransition, useMemo, useLayoutEffect, useInsertionEffect, useReducer, useId, useDebugValue, createRef, forwardRef, useImperativeHandle, useSyncExternalStore, useFormStatus, useActionState, useOptimistic, Suspense, ErrorBoundary, createContext, useContext, memo, isValidElement, createElement, cloneElement, Children, Fragment, Fragment as StrictMode, DOMAttributes, flushSync, createPortal, }; +declare const _default: { + version: string; + useState: { + (initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void]; + (): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void]; + }; + useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useRef: typeof useRef; + useCallback: (callback: T, deps: readonly unknown[]) => T; + use: (promise: Promise) => T; + startTransition: (callback: () => void) => void; + useTransition: () => [boolean, (callback: () => void | Promise) => void]; + useDeferredValue: (value: T, initialValue?: T) => T; + startViewTransition: (callback: () => void) => void; + useViewTransition: () => [boolean, (callback: () => void) => void]; + useMemo: (factory: () => T, deps: readonly unknown[]) => T; + useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; + useId: () => string; + useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; + createRef: () => import("..").RefObject; + forwardRef: (Component: (props: P, ref?: import("..").RefObject) => JSX.Element) => ((props: P & { + ref?: import("..").RefObject; + }) => JSX.Element); + useImperativeHandle: (ref: import("..").RefObject, createHandle: () => T, deps: readonly unknown[]) => void; + useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; + useFormStatus: () => { + pending: false; + data: null; + method: null; + action: null; + } | { + pending: true; + data: FormData; + method: "get" | "post"; + action: string | ((formData: FormData) => void | Promise); + }; + useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; + useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; + Suspense: FC>; + ErrorBoundary: FC>; + createContext: (defaultValue: T) => import("..").Context; + useContext: (context: import("..").Context) => T; + memo: (component: FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => FC; + isValidElement: (element: unknown) => element is JSXNode; + createElement: (tag: string | ((props: Props) => JSXNode), props: Props | null, ...children: Child[]) => JSXNode; + cloneElement: (element: T, props: Props, ...children: Child[]) => T; + Children: { + map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[]; + forEach: (children: Child[], fn: (child: Child, index: number) => void) => void; + count: (children: Child[]) => number; + only: (_children: Child[]) => Child; + toArray: (children: Child) => Child[]; + }; + Fragment: (props: Record) => JSXNode; + StrictMode: (props: Record) => JSXNode; + flushSync: (callback: () => void) => void; + createPortal: (children: Child, container: HTMLElement, key?: string) => Child; +}; +export default _default; +export type { Context } from '../context'; +export type * from '../types'; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f6e7eb6a665c02fb9e9ae5c30d85f15e3377389 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts @@ -0,0 +1,16 @@ +import type { IntrinsicElements } from '../../intrinsic-elements'; +import type { FC, PropsWithChildren, RefObject } from '../../types'; +export declare const clearCache: () => void; +export declare const composeRef: (ref: RefObject | Function | undefined, cb: (e: T) => void | (() => void)) => ((e: T) => () => void); +export declare const title: FC; +export declare const script: FC>; +export declare const style: FC>; +export declare const link: FC>; +export declare const meta: FC; +export declare const form: FC | ((e: HTMLFormElement | null) => void | (() => void)); +}>>; +export declare const input: FC>; +export declare const button: FC>; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2316d31b713156d36af589bc1ecedcd95666f61d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * This module provides the `hono/jsx/dom` dev runtime. + */ +import type { JSXNode, Props } from '../base'; +export type { JSX } from '../base'; +export declare const jsxDEV: (tag: string | Function, props: Props, key?: string) => JSXNode; +export declare const Fragment: (props: Record) => JSXNode; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..884ccb99a4e3b2103f77697e4e7b5a22ac373c80 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts @@ -0,0 +1,7 @@ +/** + * @module + * This module provides the `hono/jsx/dom` runtime. + */ +export { jsxDEV as jsx, Fragment } from './jsx-dev-runtime'; +export { jsxDEV as jsxs } from './jsx-dev-runtime'; +export type { JSX } from './jsx-dev-runtime'; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/render.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/render.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b12d554f957119f9e94a79ec73c369170f43799 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/render.d.ts @@ -0,0 +1,73 @@ +import type { Child, FC, JSXNode, Props } from '../base'; +import { DOM_RENDERER, DOM_STASH } from '../constants'; +import type { Context as JSXContext } from '../context'; +export type HasRenderToDom = FC & { + [DOM_RENDERER]: FC; +}; +export type ErrorHandler = (error: any, retry: () => void) => Child | undefined; +type Container = HTMLElement | DocumentFragment; +type LocalJSXContexts = [JSXContext, unknown][] | undefined; +type SupportedElement = HTMLElement | SVGElement | MathMLElement; +export type PreserveNodeType = 1 | 2; +export type NodeObject = { + pP: Props | undefined; + nN: Node | undefined; + vC: Node[]; + pC?: Node[]; + vR: Node[]; + n?: string; + f?: boolean; + s?: boolean; + c: Container | undefined; + e: SupportedElement | Text | undefined; + p?: PreserveNodeType; + a?: boolean; + o?: NodeObject; + [DOM_STASH]: [ + number, + any[][], + LocalJSXContexts, + [ + Context, + Function, + NodeObject + ] + ] | [number, any[][]]; +} & JSXNode; +type NodeString = { + t: string; + d: boolean; + s?: boolean; +} & { + e?: Text; + vC: undefined; + nN: undefined; + p?: true; + key: undefined; + tag: undefined; +}; +export type Node = NodeString | NodeObject; +export type PendingType = 0 | 1 | 2; +export type UpdateHook = (context: Context, node: Node, cb: (context: Context) => void) => Promise; +export type Context = [ + PendingType, + boolean, + UpdateHook, + boolean, + boolean, + [ + Context, + Function, + NodeObject + ][] +] | [PendingType, boolean, UpdateHook, boolean] | [PendingType, boolean, UpdateHook] | [PendingType, boolean] | [PendingType] | []; +export declare const buildDataStack: [Context, Node][]; +export declare const getNameSpaceContext: () => JSXContext | undefined; +export declare const build: (context: Context, node: NodeObject, children?: Child[]) => void; +export declare const buildNode: (node: Child) => Node | undefined; +export declare const update: (context: Context, node: NodeObject) => Promise; +export declare const renderNode: (node: NodeObject, container: Container) => void; +export declare const render: (jsxNode: Child, container: Container) => void; +export declare const flushSync: (callback: () => void) => void; +export declare const createPortal: (children: Child, container: HTMLElement, key?: string) => Child; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/server.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/server.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b6f59a790e94ae8ddcedb391e49cb88ace7bfa9e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/server.d.ts @@ -0,0 +1,106 @@ +/** + * @module + * This module provides APIs for `hono/jsx/server`, which is compatible with `react-dom/server`. + */ +import type { Child } from '../base'; +import version from './'; +export interface RenderToStringOptions { + identifierPrefix?: string; +} +/** + * Render JSX element to string. + * @param element JSX element to render. + * @param options Options for rendering. + * @returns Rendered string. + */ +declare const renderToString: (element: Child, options?: RenderToStringOptions) => string; +export interface RenderToReadableStreamOptions { + identifierPrefix?: string; + namespaceURI?: string; + nonce?: string; + bootstrapScriptContent?: string; + bootstrapScripts?: string[]; + bootstrapModules?: string[]; + progressiveChunkSize?: number; + signal?: AbortSignal; + onError?: (error: unknown) => string | void; +} +/** + * Render JSX element to readable stream. + * @param element JSX element to render. + * @param options Options for rendering. + * @returns Rendered readable stream. + */ +declare const renderToReadableStream: (element: Child, options?: RenderToReadableStreamOptions) => Promise>; +export { renderToString, renderToReadableStream, version }; +declare const _default: { + renderToString: (element: Child, options?: RenderToStringOptions) => string; + renderToReadableStream: (element: Child, options?: RenderToReadableStreamOptions) => Promise>; + version: { + version: string; + useState: { + (initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void]; + (): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void]; + }; + useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useRef: typeof import("..").useRef; + useCallback: (callback: T, deps: readonly unknown[]) => T; + use: (promise: Promise) => T; + startTransition: (callback: () => void) => void; + useTransition: () => [boolean, (callback: () => void | Promise) => void]; + useDeferredValue: (value: T, initialValue?: T) => T; + startViewTransition: (callback: () => void) => void; + useViewTransition: () => [boolean, (callback: () => void) => void]; + useMemo: (factory: () => T, deps: readonly unknown[]) => T; + useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; + useId: () => string; + useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; + createRef: () => import("..").RefObject; + forwardRef: (Component: (props: P, ref?: import("..").RefObject) => import("./jsx-dev-runtime").JSX.Element) => ((props: P & { + ref?: import("..").RefObject; + }) => import("./jsx-dev-runtime").JSX.Element); + useImperativeHandle: (ref: import("..").RefObject, createHandle: () => T, deps: readonly unknown[]) => void; + useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; + useFormStatus: () => { + pending: false; + data: null; + method: null; + action: null; + } | { + pending: true; + data: FormData; + method: "get" | "post"; + action: string | ((formData: FormData) => void | Promise); + }; + useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; + useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; + Suspense: import("..").FC>; + ErrorBoundary: import("..").FC>; + createContext: (defaultValue: T) => import("..").Context; + useContext: (context: import("..").Context) => T; + memo: (component: import("..").FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => import("..").FC; + isValidElement: (element: unknown) => element is import("..").JSXNode; + createElement: (tag: string | ((props: import("../base").Props) => import("..").JSXNode), props: import("../base").Props | null, ...children: Child[]) => import("..").JSXNode; + cloneElement: (element: T, props: import("../base").Props, ...children: Child[]) => T; + Children: { + map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[]; + forEach: (children: Child[], fn: (child: Child, index: number) => void) => void; + count: (children: Child[]) => number; + only: (_children: Child[]) => Child; + toArray: (children: Child) => Child[]; + }; + Fragment: (props: Record) => import("..").JSXNode; + StrictMode: (props: Record) => import("..").JSXNode; + flushSync: (callback: () => void) => void; + createPortal: (children: Child, container: HTMLElement, key?: string) => Child; + }; +}; +export default _default; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/dom/utils.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/dom/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1d29f6a4ef51a5bd717a8189cd15f48bbd20f79 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/dom/utils.d.ts @@ -0,0 +1 @@ +export declare const setInternalTagFlag: (fn: Function) => Function; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/hooks/index.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/hooks/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a376f3a13642ec65a66692b670a4d17737e03ff --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/hooks/index.d.ts @@ -0,0 +1,47 @@ +import type { JSX } from '../base'; +type UpdateStateFunction = (newState: T | ((currentState: T) => T)) => void; +export declare const STASH_EFFECT = 1; +export type EffectData = [ + readonly unknown[] | undefined, + // deps + (() => void | (() => void)) | undefined, + // layout effect + (() => void) | undefined, + // cleanup + (() => void) | undefined, + // effect + (() => void) | undefined +]; +export declare const startViewTransition: (callback: () => void) => void; +export declare const useViewTransition: () => [boolean, (callback: () => void) => void]; +export declare const startTransition: (callback: () => void) => void; +export declare const useTransition: () => [boolean, (callback: () => void | Promise) => void]; +type UseDeferredValue = (value: T, initialValue?: T) => T; +export declare const useDeferredValue: UseDeferredValue; +type UseStateType = { + (initialState: T | (() => T)): [T, UpdateStateFunction]; + (): [T | undefined, UpdateStateFunction]; +}; +export declare const useState: UseStateType; +export declare const useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; +export declare const useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; +export declare const useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; +export declare const useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; +export declare const useCallback: (callback: T, deps: readonly unknown[]) => T; +export type RefObject = { + current: T; +}; +export declare function useRef(initialValue: T): RefObject; +export declare function useRef(initialValue: T | null): RefObject; +export declare function useRef(initialValue: T | undefined): RefObject; +export declare const use: (promise: Promise) => T; +export declare const useMemo: (factory: () => T, deps: readonly unknown[]) => T; +export declare const useId: () => string; +export declare const useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; +export declare const createRef: () => RefObject; +export declare const forwardRef: (Component: (props: P, ref?: RefObject) => JSX.Element) => ((props: P & { + ref?: RefObject; +}) => JSX.Element); +export declare const useImperativeHandle: (ref: RefObject, createHandle: () => T, deps: readonly unknown[]) => void; +export declare const useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/index.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..06e12f18d99e7a3fefd6a3b5821c2b77ed0c7c7d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/index.d.ts @@ -0,0 +1,75 @@ +/** + * @module + * JSX for Hono. + */ +import { Fragment, cloneElement, isValidElement, jsx, memo, reactAPICompatVersion } from './base'; +import type { DOMAttributes } from './base'; +import { Children } from './children'; +import { ErrorBoundary } from './components'; +import { createContext, useContext } from './context'; +import { useActionState, useOptimistic } from './dom/hooks'; +import { createRef, forwardRef, startTransition, startViewTransition, use, useCallback, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition } from './hooks'; +import { Suspense } from './streaming'; +export { reactAPICompatVersion as version, jsx, memo, Fragment, Fragment as StrictMode, isValidElement, jsx as createElement, cloneElement, ErrorBoundary, createContext, useContext, useState, useEffect, useRef, useCallback, useReducer, useId, useDebugValue, use, startTransition, useTransition, useDeferredValue, startViewTransition, useViewTransition, useMemo, useLayoutEffect, useInsertionEffect, createRef, forwardRef, useImperativeHandle, useSyncExternalStore, useActionState, useOptimistic, Suspense, Children, DOMAttributes, }; +declare const _default: { + version: string; + memo: (component: import("./base").FC, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => import("./base").FC; + Fragment: ({ children, }: { + key?: string; + children?: import("./base").Child | import("../utils/html").HtmlEscapedString; + }) => import("../utils/html").HtmlEscapedString; + StrictMode: ({ children, }: { + key?: string; + children?: import("./base").Child | import("../utils/html").HtmlEscapedString; + }) => import("../utils/html").HtmlEscapedString; + isValidElement: (element: unknown) => element is import("./base").JSXNode; + createElement: (tag: string | Function, props: import("./base").Props | null, ...children: import("./base").Child[]) => import("./base").JSXNode; + cloneElement: (element: T, props: Partial, ...children: import("./base").Child[]) => T; + ErrorBoundary: import("./base").FC>; + createContext: (defaultValue: T) => import("./context").Context; + useContext: (context: import("./context").Context) => T; + useState: { + (initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void]; + (): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void]; + }; + useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useRef: typeof useRef; + useCallback: (callback: T, deps: readonly unknown[]) => T; + useReducer: (reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void]; + useId: () => string; + useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void; + use: (promise: Promise) => T; + startTransition: (callback: () => void) => void; + useTransition: () => [boolean, (callback: () => void | Promise) => void]; + useDeferredValue: (value: T, initialValue?: T) => T; + startViewTransition: (callback: () => void) => void; + useViewTransition: () => [boolean, (callback: () => void) => void]; + useMemo: (factory: () => T, deps: readonly unknown[]) => T; + useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void; + createRef: () => import("./hooks").RefObject; + forwardRef: (Component: (props: P, ref?: import("./hooks").RefObject) => import("./base").JSX.Element) => ((props: P & { + ref?: import("./hooks").RefObject; + }) => import("./base").JSX.Element); + useImperativeHandle: (ref: import("./hooks").RefObject, createHandle: () => T, deps: readonly unknown[]) => void; + useSyncExternalStore: (subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T; + useActionState: (fn: Function, initialState: T, permalink?: string) => [T, Function]; + useOptimistic: (state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void]; + Suspense: import("./base").FC>; + Children: { + map: (children: import("./base").Child[], fn: (child: import("./base").Child, index: number) => import("./base").Child) => import("./base").Child[]; + forEach: (children: import("./base").Child[], fn: (child: import("./base").Child, index: number) => void) => void; + count: (children: import("./base").Child[]) => number; + only: (_children: import("./base").Child[]) => import("./base").Child; + toArray: (children: import("./base").Child) => import("./base").Child[]; + }; +}; +export default _default; +export type * from './types'; +export type { JSX } from './intrinsic-elements'; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26d4ddb227d5b97e08b2459629c76569dc6ae770 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts @@ -0,0 +1,6 @@ +import type { Props } from '../base'; +export declare const deDupeKeyMap: Record; +export declare const domRenderers: Record; +export declare const dataPrecedenceAttr = "data-precedence"; +export declare const isStylesheetLinkWithPrecedence: (props: Props) => boolean; +export declare const shouldDeDupeByKey: (tagName: string, supportSort: boolean) => boolean; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..77d0849985f25a5c6348a9f91ef55f7f9c8ff61f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts @@ -0,0 +1,13 @@ +import type { IntrinsicElements } from '../intrinsic-elements'; +import type { FC, PropsWithChildren } from '../types'; +export declare const title: FC; +export declare const script: FC>; +export declare const style: FC>; +export declare const link: FC>; +export declare const meta: FC; +export declare const form: FC>; +export declare const input: (props: PropsWithChildren) => unknown; +export declare const button: (props: PropsWithChildren) => unknown; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f35b34f36d5370ade366d634579b300783e2b911 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts @@ -0,0 +1,722 @@ +import type { BaseMime } from '../utils/mime'; +import type { StringLiteralUnion } from '../utils/types'; +/** + * This code is based on React. + * https://github.com/facebook/react + * MIT License + * Copyright (c) Meta Platforms, Inc. and affiliates. + */ +export declare namespace JSX { + export type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined; + export interface CSSProperties { + [propertyKey: string]: unknown; + } + type AnyAttributes = { + [attributeName: string]: any; + }; + interface JSXAttributes { + dangerouslySetInnerHTML?: { + __html: string; + }; + } + interface EventAttributes { + onScroll?: (event: Event) => void; + onScrollCapture?: (event: Event) => void; + onScrollEnd?: (event: Event) => void; + onScrollEndCapture?: (event: Event) => void; + onWheel?: (event: WheelEvent) => void; + onWheelCapture?: (event: WheelEvent) => void; + onAnimationCancel?: (event: AnimationEvent) => void; + onAnimationCancelCapture?: (event: AnimationEvent) => void; + onAnimationEnd?: (event: AnimationEvent) => void; + onAnimationEndCapture?: (event: AnimationEvent) => void; + onAnimationIteration?: (event: AnimationEvent) => void; + onAnimationIterationCapture?: (event: AnimationEvent) => void; + onAnimationStart?: (event: AnimationEvent) => void; + onAnimationStartCapture?: (event: AnimationEvent) => void; + onCopy?: (event: ClipboardEvent) => void; + onCopyCapture?: (event: ClipboardEvent) => void; + onCut?: (event: ClipboardEvent) => void; + onCutCapture?: (event: ClipboardEvent) => void; + onPaste?: (event: ClipboardEvent) => void; + onPasteCapture?: (event: ClipboardEvent) => void; + onCompositionEnd?: (event: CompositionEvent) => void; + onCompositionEndCapture?: (event: CompositionEvent) => void; + onCompositionStart?: (event: CompositionEvent) => void; + onCompositionStartCapture?: (event: CompositionEvent) => void; + onCompositionUpdate?: (event: CompositionEvent) => void; + onCompositionUpdateCapture?: (event: CompositionEvent) => void; + onBlur?: (event: FocusEvent) => void; + onBlurCapture?: (event: FocusEvent) => void; + onFocus?: (event: FocusEvent) => void; + onFocusCapture?: (event: FocusEvent) => void; + onFocusIn?: (event: FocusEvent) => void; + onFocusInCapture?: (event: FocusEvent) => void; + onFocusOut?: (event: FocusEvent) => void; + onFocusOutCapture?: (event: FocusEvent) => void; + onFullscreenChange?: (event: Event) => void; + onFullscreenChangeCapture?: (event: Event) => void; + onFullscreenError?: (event: Event) => void; + onFullscreenErrorCapture?: (event: Event) => void; + onKeyDown?: (event: KeyboardEvent) => void; + onKeyDownCapture?: (event: KeyboardEvent) => void; + onKeyPress?: (event: KeyboardEvent) => void; + onKeyPressCapture?: (event: KeyboardEvent) => void; + onKeyUp?: (event: KeyboardEvent) => void; + onKeyUpCapture?: (event: KeyboardEvent) => void; + onAuxClick?: (event: MouseEvent) => void; + onAuxClickCapture?: (event: MouseEvent) => void; + onClick?: (event: MouseEvent) => void; + onClickCapture?: (event: MouseEvent) => void; + onContextMenu?: (event: MouseEvent) => void; + onContextMenuCapture?: (event: MouseEvent) => void; + onDoubleClick?: (event: MouseEvent) => void; + onDoubleClickCapture?: (event: MouseEvent) => void; + onMouseDown?: (event: MouseEvent) => void; + onMouseDownCapture?: (event: MouseEvent) => void; + onMouseEnter?: (event: MouseEvent) => void; + onMouseEnterCapture?: (event: MouseEvent) => void; + onMouseLeave?: (event: MouseEvent) => void; + onMouseLeaveCapture?: (event: MouseEvent) => void; + onMouseMove?: (event: MouseEvent) => void; + onMouseMoveCapture?: (event: MouseEvent) => void; + onMouseOut?: (event: MouseEvent) => void; + onMouseOutCapture?: (event: MouseEvent) => void; + onMouseOver?: (event: MouseEvent) => void; + onMouseOverCapture?: (event: MouseEvent) => void; + onMouseUp?: (event: MouseEvent) => void; + onMouseUpCapture?: (event: MouseEvent) => void; + onMouseWheel?: (event: WheelEvent) => void; + onMouseWheelCapture?: (event: WheelEvent) => void; + onGotPointerCapture?: (event: PointerEvent) => void; + onGotPointerCaptureCapture?: (event: PointerEvent) => void; + onLostPointerCapture?: (event: PointerEvent) => void; + onLostPointerCaptureCapture?: (event: PointerEvent) => void; + onPointerCancel?: (event: PointerEvent) => void; + onPointerCancelCapture?: (event: PointerEvent) => void; + onPointerDown?: (event: PointerEvent) => void; + onPointerDownCapture?: (event: PointerEvent) => void; + onPointerEnter?: (event: PointerEvent) => void; + onPointerEnterCapture?: (event: PointerEvent) => void; + onPointerLeave?: (event: PointerEvent) => void; + onPointerLeaveCapture?: (event: PointerEvent) => void; + onPointerMove?: (event: PointerEvent) => void; + onPointerMoveCapture?: (event: PointerEvent) => void; + onPointerOut?: (event: PointerEvent) => void; + onPointerOutCapture?: (event: PointerEvent) => void; + onPointerOver?: (event: PointerEvent) => void; + onPointerOverCapture?: (event: PointerEvent) => void; + onPointerUp?: (event: PointerEvent) => void; + onPointerUpCapture?: (event: PointerEvent) => void; + onTouchCancel?: (event: TouchEvent) => void; + onTouchCancelCapture?: (event: TouchEvent) => void; + onTouchEnd?: (event: TouchEvent) => void; + onTouchEndCapture?: (event: TouchEvent) => void; + onTouchMove?: (event: TouchEvent) => void; + onTouchMoveCapture?: (event: TouchEvent) => void; + onTouchStart?: (event: TouchEvent) => void; + onTouchStartCapture?: (event: TouchEvent) => void; + onTransitionCancel?: (event: TransitionEvent) => void; + onTransitionCancelCapture?: (event: TransitionEvent) => void; + onTransitionEnd?: (event: TransitionEvent) => void; + onTransitionEndCapture?: (event: TransitionEvent) => void; + onTransitionRun?: (event: TransitionEvent) => void; + onTransitionRunCapture?: (event: TransitionEvent) => void; + onTransitionStart?: (event: TransitionEvent) => void; + onTransitionStartCapture?: (event: TransitionEvent) => void; + onFormData?: (event: FormDataEvent) => void; + onFormDataCapture?: (event: FormDataEvent) => void; + onReset?: (event: Event) => void; + onResetCapture?: (event: Event) => void; + onSubmit?: (event: Event) => void; + onSubmitCapture?: (event: Event) => void; + onInvalid?: (event: Event) => void; + onInvalidCapture?: (event: Event) => void; + onSelect?: (event: Event) => void; + onSelectCapture?: (event: Event) => void; + onSelectChange?: (event: Event) => void; + onSelectChangeCapture?: (event: Event) => void; + onInput?: (event: InputEvent) => void; + onInputCapture?: (event: InputEvent) => void; + onBeforeInput?: (event: InputEvent) => void; + onBeforeInputCapture?: (event: InputEvent) => void; + onChange?: (event: Event) => void; + onChangeCapture?: (event: Event) => void; + } + export interface HTMLAttributes extends JSXAttributes, EventAttributes, AnyAttributes { + accesskey?: string | undefined; + autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters' | undefined; + autofocus?: boolean | undefined; + class?: string | Promise | undefined; + contenteditable?: boolean | 'inherit' | 'plaintext-only' | undefined; + contextmenu?: string | undefined; + dir?: string | undefined; + draggable?: 'true' | 'false' | boolean | undefined; + enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined; + hidden?: boolean | undefined; + id?: string | undefined; + inert?: boolean | undefined; + inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' | undefined; + is?: string | undefined; + itemid?: string | undefined; + itemprop?: string | undefined; + itemref?: string | undefined; + itemscope?: boolean | undefined; + itemtype?: string | undefined; + lang?: string | undefined; + nonce?: string | undefined; + placeholder?: string | undefined; + /** @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API */ + popover?: boolean | 'auto' | 'manual' | undefined; + slot?: string | undefined; + spellcheck?: boolean | undefined; + style?: CSSProperties | string | undefined; + tabindex?: number | undefined; + title?: string | undefined; + translate?: 'yes' | 'no' | undefined; + itemProp?: string | undefined; + } + type HTMLAttributeReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; + type HTMLAttributeAnchorTarget = StringLiteralUnion<'_self' | '_blank' | '_parent' | '_top'>; + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: string | boolean | undefined; + href?: string | undefined; + hreflang?: string | undefined; + media?: string | undefined; + ping?: string | undefined; + target?: HTMLAttributeAnchorTarget | undefined; + type?: StringLiteralUnion | undefined; + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; + } + interface AudioHTMLAttributes extends MediaHTMLAttributes { + } + interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string | undefined; + coords?: string | undefined; + download?: string | boolean | undefined; + href?: string | undefined; + hreflang?: string | undefined; + media?: string | undefined; + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; + shape?: string | undefined; + target?: HTMLAttributeAnchorTarget | undefined; + } + interface BaseHTMLAttributes extends HTMLAttributes { + href?: string | undefined; + target?: HTMLAttributeAnchorTarget | undefined; + } + interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + } + /** @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API */ + type HTMLAttributePopoverTargetAction = 'show' | 'hide' | 'toggle'; + interface ButtonHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + form?: string | undefined; + formenctype?: HTMLAttributeFormEnctype | undefined; + formmethod?: HTMLAttributeFormMethod | undefined; + formnovalidate?: boolean | undefined; + formtarget?: HTMLAttributeAnchorTarget | undefined; + name?: string | undefined; + type?: 'submit' | 'reset' | 'button' | undefined; + value?: string | ReadonlyArray | number | undefined; + popovertarget?: string | undefined; + popovertargetaction?: HTMLAttributePopoverTargetAction | undefined; + formAction?: string | Function | undefined; + } + interface CanvasHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + width?: number | string | undefined; + } + interface ColHTMLAttributes extends HTMLAttributes { + span?: number | undefined; + width?: number | string | undefined; + } + interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number | undefined; + } + interface DataHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined; + } + interface DetailsHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined; + } + interface DelHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + dateTime?: string | undefined; + } + interface DialogHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined; + } + interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + src?: string | undefined; + type?: StringLiteralUnion | undefined; + width?: number | string | undefined; + } + interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + form?: string | undefined; + name?: string | undefined; + } + /** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method */ + type HTMLAttributeFormMethod = 'get' | 'post' | 'dialog'; + /** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#enctype */ + type HTMLAttributeFormEnctype = 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; + /** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#autocomplete */ + type HTMLAttributeFormAutocomplete = 'on' | 'off'; + interface FormHTMLAttributes extends HTMLAttributes { + 'accept-charset'?: StringLiteralUnion<'utf-8'> | undefined; + autocomplete?: HTMLAttributeFormAutocomplete | undefined; + enctype?: HTMLAttributeFormEnctype | undefined; + method?: HTMLAttributeFormMethod | undefined; + name?: string | undefined; + novalidate?: boolean | undefined; + target?: HTMLAttributeAnchorTarget | undefined; + action?: string | Function | undefined; + } + interface HtmlHTMLAttributes extends HTMLAttributes { + manifest?: string | undefined; + } + interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string | undefined; + allowfullscreen?: boolean | undefined; + height?: number | string | undefined; + loading?: 'eager' | 'lazy' | undefined; + name?: string | undefined; + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; + sandbox?: string | undefined; + seamless?: boolean | undefined; + src?: string | undefined; + srcdoc?: string | undefined; + width?: number | string | undefined; + } + interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string | undefined; + crossorigin?: CrossOrigin; + decoding?: 'async' | 'auto' | 'sync' | undefined; + height?: number | string | undefined; + loading?: 'eager' | 'lazy' | undefined; + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; + sizes?: string | undefined; + src?: string | undefined; + srcset?: string | undefined; + usemap?: string | undefined; + width?: number | string | undefined; + } + interface InsHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + datetime?: string | undefined; + } + type HTMLInputTypeAttribute = StringLiteralUnion<'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week'>; + type AutoFillAddressKind = 'billing' | 'shipping'; + type AutoFillBase = '' | 'off' | 'on'; + type AutoFillContactField = 'email' | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-national'; + type AutoFillContactKind = 'home' | 'mobile' | 'work'; + type AutoFillCredentialField = 'webauthn'; + type AutoFillNormalField = 'additional-name' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'address-line1' | 'address-line2' | 'address-line3' | 'bday-day' | 'bday-month' | 'bday-year' | 'cc-csc' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-family-name' | 'cc-given-name' | 'cc-name' | 'cc-number' | 'cc-type' | 'country' | 'country-name' | 'current-password' | 'family-name' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'name' | 'new-password' | 'one-time-code' | 'organization' | 'postal-code' | 'street-address' | 'transaction-amount' | 'transaction-currency' | 'username'; + type OptionalPrefixToken = `${T} ` | ''; + type OptionalPostfixToken = ` ${T}` | ''; + type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken}${AutoFillContactField}`; + type AutoFillSection = `section-${string}`; + type AutoFill = AutoFillBase | `${OptionalPrefixToken}${OptionalPrefixToken}${AutoFillField}${OptionalPostfixToken}`; + interface InputHTMLAttributes extends HTMLAttributes { + accept?: string | undefined; + alt?: string | undefined; + autocomplete?: StringLiteralUnion | undefined; + capture?: boolean | 'user' | 'environment' | undefined; + checked?: boolean | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + formenctype?: HTMLAttributeFormEnctype | undefined; + formmethod?: HTMLAttributeFormMethod | undefined; + formnovalidate?: boolean | undefined; + formtarget?: HTMLAttributeAnchorTarget | undefined; + height?: number | string | undefined; + list?: string | undefined; + max?: number | string | undefined; + maxlength?: number | undefined; + min?: number | string | undefined; + minlength?: number | undefined; + multiple?: boolean | undefined; + name?: string | undefined; + pattern?: string | undefined; + placeholder?: string | undefined; + readonly?: boolean | undefined; + required?: boolean | undefined; + size?: number | undefined; + src?: string | undefined; + step?: number | string | undefined; + type?: HTMLInputTypeAttribute | undefined; + value?: string | ReadonlyArray | number | undefined; + width?: number | string | undefined; + popovertarget?: string | undefined; + popovertargetaction?: HTMLAttributePopoverTargetAction | undefined; + formAction?: string | Function | undefined; + } + interface KeygenHTMLAttributes extends HTMLAttributes { + challenge?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + keytype?: string | undefined; + name?: string | undefined; + } + interface LabelHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + for?: string | undefined; + } + interface LiHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined; + } + interface LinkHTMLAttributes extends HTMLAttributes { + as?: string | undefined; + crossorigin?: CrossOrigin; + href?: string | undefined; + hreflang?: string | undefined; + integrity?: string | undefined; + media?: string | undefined; + imagesrcset?: string | undefined; + imagesizes?: string | undefined; + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; + sizes?: string | undefined; + type?: StringLiteralUnion | undefined; + charSet?: string | undefined; + rel?: string | undefined; + precedence?: string | undefined; + title?: string | undefined; + disabled?: boolean | undefined; + onError?: ((event: Event) => void) | undefined; + onLoad?: ((event: Event) => void) | undefined; + blocking?: 'render' | undefined; + } + interface MapHTMLAttributes extends HTMLAttributes { + name?: string | undefined; + } + interface MenuHTMLAttributes extends HTMLAttributes { + type?: string | undefined; + } + interface MediaHTMLAttributes extends HTMLAttributes { + autoplay?: boolean | undefined; + controls?: boolean | undefined; + controlslist?: string | undefined; + crossorigin?: CrossOrigin; + loop?: boolean | undefined; + mediagroup?: string | undefined; + muted?: boolean | undefined; + playsinline?: boolean | undefined; + preload?: string | undefined; + src?: string | undefined; + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#http-equiv + */ + type MetaHttpEquiv = 'content-security-policy' | 'content-type' | 'default-style' | 'x-ua-compatible' | 'refresh'; + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name + */ + type MetaName = 'application-name' | 'author' | 'description' | 'generator' | 'keywords' | 'referrer' | 'theme-color' | 'color-scheme' | 'viewport' | 'creator' | 'googlebot' | 'publisher' | 'robots'; + /** + * @see https://ogp.me/ + */ + type MetaProperty = 'og:title' | 'og:type' | 'og:image' | 'og:url' | 'og:audio' | 'og:description' | 'og:determiner' | 'og:locale' | 'og:locale:alternate' | 'og:site_name' | 'og:video' | 'og:image:url' | 'og:image:secure_url' | 'og:image:type' | 'og:image:width' | 'og:image:height' | 'og:image:alt'; + interface MetaHTMLAttributes extends HTMLAttributes { + charset?: StringLiteralUnion<'utf-8'> | undefined; + 'http-equiv'?: StringLiteralUnion | undefined; + name?: StringLiteralUnion | undefined; + media?: string | undefined; + content?: string | undefined; + property?: StringLiteralUnion | undefined; + httpEquiv?: StringLiteralUnion | undefined; + } + interface MeterHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + high?: number | undefined; + low?: number | undefined; + max?: number | string | undefined; + min?: number | string | undefined; + optimum?: number | undefined; + value?: string | ReadonlyArray | number | undefined; + } + interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + } + interface ObjectHTMLAttributes extends HTMLAttributes { + data?: string | undefined; + form?: string | undefined; + height?: number | string | undefined; + name?: string | undefined; + type?: StringLiteralUnion | undefined; + usemap?: string | undefined; + width?: number | string | undefined; + } + interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean | undefined; + start?: number | undefined; + type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined; + } + interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + label?: string | undefined; + } + interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + label?: string | undefined; + selected?: boolean | undefined; + value?: string | ReadonlyArray | number | undefined; + } + interface OutputHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + for?: string | undefined; + name?: string | undefined; + } + interface ParamHTMLAttributes extends HTMLAttributes { + name?: string | undefined; + value?: string | ReadonlyArray | number | undefined; + } + interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string | undefined; + value?: string | ReadonlyArray | number | undefined; + } + interface SlotHTMLAttributes extends HTMLAttributes { + name?: string | undefined; + } + interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean | undefined; + crossorigin?: CrossOrigin; + defer?: boolean | undefined; + integrity?: string | undefined; + nomodule?: boolean | undefined; + referrerpolicy?: HTMLAttributeReferrerPolicy | undefined; + src?: string | undefined; + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type + */ + type?: StringLiteralUnion<'' | 'text/javascript' | 'importmap' | 'module'> | undefined; + crossOrigin?: CrossOrigin; + fetchPriority?: string | undefined; + noModule?: boolean | undefined; + referrer?: HTMLAttributeReferrerPolicy | undefined; + onError?: ((event: Event) => void) | undefined; + onLoad?: ((event: Event) => void) | undefined; + blocking?: 'render' | undefined; + } + interface SelectHTMLAttributes extends HTMLAttributes { + autocomplete?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + multiple?: boolean | undefined; + name?: string | undefined; + required?: boolean | undefined; + size?: number | undefined; + value?: string | ReadonlyArray | number | undefined; + } + type MediaMime = BaseMime & (`image/${string}` | `audio/${string}` | `video/${string}`); + interface SourceHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + media?: string | undefined; + sizes?: string | undefined; + src?: string | undefined; + srcset?: string | undefined; + type?: StringLiteralUnion | undefined; + width?: number | string | undefined; + } + interface StyleHTMLAttributes extends HTMLAttributes { + media?: string | undefined; + scoped?: boolean | undefined; + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style#type + */ + type?: '' | 'text/css' | undefined; + href?: string | undefined; + precedence?: string | undefined; + title?: string | undefined; + disabled?: boolean | undefined; + blocking?: 'render' | undefined; + } + interface TableHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | undefined; + bgcolor?: string | undefined; + border?: number | undefined; + cellpadding?: number | string | undefined; + cellspacing?: number | string | undefined; + frame?: boolean | undefined; + rules?: 'none' | 'groups' | 'rows' | 'columns' | 'all' | undefined; + summary?: string | undefined; + width?: number | string | undefined; + } + interface TextareaHTMLAttributes extends HTMLAttributes { + autocomplete?: string | undefined; + cols?: number | undefined; + dirname?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + maxlength?: number | undefined; + minlength?: number | undefined; + name?: string | undefined; + placeholder?: string | undefined; + readonly?: boolean | undefined; + required?: boolean | undefined; + rows?: number | undefined; + value?: string | ReadonlyArray | number | undefined; + wrap?: string | undefined; + } + interface TdHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; + colspan?: number | undefined; + headers?: string | undefined; + rowspan?: number | undefined; + scope?: string | undefined; + abbr?: string | undefined; + height?: number | string | undefined; + width?: number | string | undefined; + valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined; + } + interface ThHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; + colspan?: number | undefined; + headers?: string | undefined; + rowspan?: number | undefined; + scope?: 'row' | 'col' | 'rowgroup' | 'colgroup' | string | undefined; + abbr?: string | undefined; + } + interface TimeHTMLAttributes extends HTMLAttributes { + datetime?: string | undefined; + } + interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean | undefined; + kind?: string | undefined; + label?: string | undefined; + src?: string | undefined; + srclang?: string | undefined; + } + interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string | undefined; + playsinline?: boolean | undefined; + poster?: string | undefined; + width?: number | string | undefined; + disablePictureInPicture?: boolean | undefined; + disableRemotePlayback?: boolean | undefined; + } + export interface IntrinsicElements { + a: AnchorHTMLAttributes; + abbr: HTMLAttributes; + address: HTMLAttributes; + area: AreaHTMLAttributes; + article: HTMLAttributes; + aside: HTMLAttributes; + audio: AudioHTMLAttributes; + b: HTMLAttributes; + base: BaseHTMLAttributes; + bdi: HTMLAttributes; + bdo: HTMLAttributes; + big: HTMLAttributes; + blockquote: BlockquoteHTMLAttributes; + body: HTMLAttributes; + br: HTMLAttributes; + button: ButtonHTMLAttributes; + canvas: CanvasHTMLAttributes; + caption: HTMLAttributes; + center: HTMLAttributes; + cite: HTMLAttributes; + code: HTMLAttributes; + col: ColHTMLAttributes; + colgroup: ColgroupHTMLAttributes; + data: DataHTMLAttributes; + datalist: HTMLAttributes; + dd: HTMLAttributes; + del: DelHTMLAttributes; + details: DetailsHTMLAttributes; + dfn: HTMLAttributes; + dialog: DialogHTMLAttributes; + div: HTMLAttributes; + dl: HTMLAttributes; + dt: HTMLAttributes; + em: HTMLAttributes; + embed: EmbedHTMLAttributes; + fieldset: FieldsetHTMLAttributes; + figcaption: HTMLAttributes; + figure: HTMLAttributes; + footer: HTMLAttributes; + form: FormHTMLAttributes; + h1: HTMLAttributes; + h2: HTMLAttributes; + h3: HTMLAttributes; + h4: HTMLAttributes; + h5: HTMLAttributes; + h6: HTMLAttributes; + head: HTMLAttributes; + header: HTMLAttributes; + hgroup: HTMLAttributes; + hr: HTMLAttributes; + html: HtmlHTMLAttributes; + i: HTMLAttributes; + iframe: IframeHTMLAttributes; + img: ImgHTMLAttributes; + input: InputHTMLAttributes; + ins: InsHTMLAttributes; + kbd: HTMLAttributes; + keygen: KeygenHTMLAttributes; + label: LabelHTMLAttributes; + legend: HTMLAttributes; + li: LiHTMLAttributes; + link: LinkHTMLAttributes; + main: HTMLAttributes; + map: MapHTMLAttributes; + mark: HTMLAttributes; + menu: MenuHTMLAttributes; + menuitem: HTMLAttributes; + meta: MetaHTMLAttributes; + meter: MeterHTMLAttributes; + nav: HTMLAttributes; + noscript: HTMLAttributes; + object: ObjectHTMLAttributes; + ol: OlHTMLAttributes; + optgroup: OptgroupHTMLAttributes; + option: OptionHTMLAttributes; + output: OutputHTMLAttributes; + p: HTMLAttributes; + param: ParamHTMLAttributes; + picture: HTMLAttributes; + pre: HTMLAttributes; + progress: ProgressHTMLAttributes; + q: QuoteHTMLAttributes; + rp: HTMLAttributes; + rt: HTMLAttributes; + ruby: HTMLAttributes; + s: HTMLAttributes; + samp: HTMLAttributes; + search: HTMLAttributes; + slot: SlotHTMLAttributes; + script: ScriptHTMLAttributes; + section: HTMLAttributes; + select: SelectHTMLAttributes; + small: HTMLAttributes; + source: SourceHTMLAttributes; + span: HTMLAttributes; + strong: HTMLAttributes; + style: StyleHTMLAttributes; + sub: HTMLAttributes; + summary: HTMLAttributes; + sup: HTMLAttributes; + table: TableHTMLAttributes; + template: HTMLAttributes; + tbody: HTMLAttributes; + td: TdHTMLAttributes; + textarea: TextareaHTMLAttributes; + tfoot: HTMLAttributes; + th: ThHTMLAttributes; + thead: HTMLAttributes; + time: TimeHTMLAttributes; + title: HTMLAttributes; + tr: HTMLAttributes; + track: TrackHTMLAttributes; + u: HTMLAttributes; + ul: HTMLAttributes; + var: HTMLAttributes; + video: VideoHTMLAttributes; + wbr: HTMLAttributes; + } + export {}; +} +export interface IntrinsicElements extends JSX.IntrinsicElements { +} diff --git a/tools/ui/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa11518adec8767380f6f577a9e33e911acdf057 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * This module provides Hono's JSX dev runtime. + */ +import type { JSXNode } from './base'; +export { Fragment } from './base'; +export type { JSX } from './base'; +export declare function jsxDEV(tag: string | Function, props: Record, key?: string): JSXNode; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..41ab6691a9c9dccefd18922d0d1cd6410e25daa9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts @@ -0,0 +1,12 @@ +/** + * @module + * This module provides Hono's JSX runtime. + */ +export { jsxDEV as jsx, Fragment } from './jsx-dev-runtime'; +export { jsxDEV as jsxs } from './jsx-dev-runtime'; +export type { JSX } from './jsx-dev-runtime'; +import { html } from '../helper/html'; +import type { HtmlEscapedString } from '../utils/html'; +export { html as jsxTemplate }; +export declare const jsxAttr: (key: string, v: string | Promise | Record) => HtmlEscapedString | Promise; +export declare const jsxEscape: (value: string) => string; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/streaming.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/streaming.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c85baeed8385dc02b0b51dff5686d3feaaf1f54 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/streaming.d.ts @@ -0,0 +1,36 @@ +/** + * @module + * This module enables JSX to supports streaming Response. + */ +import type { HtmlEscapedString } from '../utils/html'; +import { JSXNode } from './base'; +import type { FC, PropsWithChildren, Context as JSXContext } from './'; +/** + * Used to specify nonce for scripts generated by `Suspense` and `ErrorBoundary`. + * + * @example + * ```tsx + * + * Loading...

}> + * + * + * + * ``` + */ +export declare const StreamingContext: JSXContext<{ + scriptNonce: string; +} | null>; +/** + * @experimental + * `Suspense` is an experimental feature. + * The API might be changed. + */ +export declare const Suspense: FC>; +/** + * @experimental + * `renderToReadableStream()` is an experimental feature. + * The API might be changed. + */ +export declare const renderToReadableStream: (content: HtmlEscapedString | JSXNode | Promise, onError?: (e: unknown) => string | void) => ReadableStream; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/types.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95bef045cbfe3d6017b2fa330fa842a846bbd637 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/types.d.ts @@ -0,0 +1,35 @@ +/** + * All types exported from "hono/jsx" are in this file. + */ +import type { Child, JSXNode } from './base'; +import type { JSX } from './intrinsic-elements'; +export type { Child, JSXNode, FC } from './base'; +export type { RefObject } from './hooks'; +export type { Context } from './context'; +export type PropsWithChildren

= P & { + children?: Child | undefined; +}; +export type CSSProperties = JSX.CSSProperties; +/** + * React types + */ +type ReactElement

= JSXNode & { + type: T; + props: P; + key: string | null; +}; +type ReactNode = ReactElement | string | number | boolean | null | undefined; +type ComponentClass<_P = {}, _S = {}> = unknown; +export type { ReactElement, ReactNode, ComponentClass }; +export type Event = globalThis.Event; +export type MouseEvent = globalThis.MouseEvent; +export type KeyboardEvent = globalThis.KeyboardEvent; +export type FocusEvent = globalThis.FocusEvent; +export type ClipboardEvent = globalThis.ClipboardEvent; +export type InputEvent = globalThis.InputEvent; +export type PointerEvent = globalThis.PointerEvent; +export type TouchEvent = globalThis.TouchEvent; +export type WheelEvent = globalThis.WheelEvent; +export type AnimationEvent = globalThis.AnimationEvent; +export type TransitionEvent = globalThis.TransitionEvent; +export type DragEvent = globalThis.DragEvent; diff --git a/tools/ui/node_modules/hono/dist/types/jsx/utils.d.ts b/tools/ui/node_modules/hono/dist/types/jsx/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a47859621c0966e6f2beb69fdf79a27a9812266 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/jsx/utils.d.ts @@ -0,0 +1,4 @@ +export declare const normalizeIntrinsicElementKey: (key: string) => string; +export declare const isValidTagName: (name: unknown) => name is string; +export declare const isValidAttributeName: (name: string) => boolean; +export declare const styleObjectForEach: (style: Record, fn: (key: string, value: string | null) => void) => void; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..db53047a8044fe6495abe9b2cd2eb81aebac7d1b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts @@ -0,0 +1,75 @@ +/** + * @module + * Basic Auth Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +type MessageFunction = (c: Context) => string | object | Promise; +type BasicAuthOptions = { + username: string; + password: string; + realm?: string; + hashFunction?: Function; + invalidUserMessage?: string | object | MessageFunction; + onAuthSuccess?: (c: Context, username: string) => void | Promise; +} | { + verifyUser: (username: string, password: string, c: Context) => boolean | Promise; + realm?: string; + hashFunction?: Function; + invalidUserMessage?: string | object | MessageFunction; + onAuthSuccess?: (c: Context, username: string) => void | Promise; +}; +/** + * Basic Auth Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/basic-auth} + * + * @param {BasicAuthOptions} options - The options for the basic authentication middleware. + * @param {string} options.username - The username for authentication. + * @param {string} options.password - The password for authentication. + * @param {string} [options.realm="Secure Area"] - The realm attribute for the WWW-Authenticate header. + * @param {Function} [options.hashFunction] - The hash function used for secure comparison. + * @param {Function} [options.verifyUser] - The function to verify user credentials. + * @param {string | object | MessageFunction} [options.invalidUserMessage="Unauthorized"] - The invalid user message. + * @param {Function} [options.onAuthSuccess] - Callback function called on successful authentication. + * @returns {MiddlewareHandler} The middleware handler function. + * @throws {HTTPException} If neither "username and password" nor "verifyUser" options are provided. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use( + * '/auth/*', + * basicAuth({ + * username: 'hono', + * password: 'ahotproject', + * }) + * ) + * + * app.get('/auth/page', (c) => { + * return c.text('You are authorized') + * }) + * ``` + * + * @example + * ```ts + * // With onAuthSuccess callback + * app.use( + * '/auth/*', + * basicAuth({ + * username: 'hono', + * password: 'ahotproject', + * onAuthSuccess: (c, username) => { + * c.set('user', { name: username, role: 'admin' }) + * console.log(`User ${username} authenticated`) + * }, + * }) + * ) + * ``` + */ +export declare const basicAuth: (options: BasicAuthOptions, ...users: { + username: string; + password: string; +}[]) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a22b092da166a720a64c4c4061ccdf9695feed22 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts @@ -0,0 +1,92 @@ +/** + * @module + * Bearer Auth Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { Env, MiddlewareHandler } from '../../types'; +type MessageFunction = (c: Context) => string | object | Promise; +type CustomizedErrorResponseOptions = { + wwwAuthenticateHeader?: string | object | MessageFunction; + message?: string | object | MessageFunction; +}; +type BearerAuthOptions = { + token: string | string[]; + realm?: string; + prefix?: string; + headerName?: string; + hashFunction?: Function; + /** + * @deprecated Use noAuthenticationHeader.message instead + */ + noAuthenticationHeaderMessage?: string | object | MessageFunction; + noAuthenticationHeader?: CustomizedErrorResponseOptions; + /** + * @deprecated Use invalidAuthenticationHeader.message instead + */ + invalidAuthenticationHeaderMessage?: string | object | MessageFunction; + invalidAuthenticationHeader?: CustomizedErrorResponseOptions; + /** + * @deprecated Use invalidToken.message instead + */ + invalidTokenMessage?: string | object | MessageFunction; + invalidToken?: CustomizedErrorResponseOptions; +} | { + realm?: string; + prefix?: string; + headerName?: string; + verifyToken: (token: string, c: Context) => boolean | Promise; + hashFunction?: Function; + /** + * @deprecated Use noAuthenticationHeader.message instead + */ + noAuthenticationHeaderMessage?: string | object | MessageFunction; + noAuthenticationHeader?: CustomizedErrorResponseOptions; + /** + * @deprecated Use invalidAuthenticationHeader.message instead + */ + invalidAuthenticationHeaderMessage?: string | object | MessageFunction; + invalidAuthenticationHeader?: CustomizedErrorResponseOptions; + /** + * @deprecated Use invalidToken.message instead + */ + invalidTokenMessage?: string | object | MessageFunction; + invalidToken?: CustomizedErrorResponseOptions; +}; +/** + * Bearer Auth Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/bearer-auth} + * + * @template E - The environment type. + * @param {BearerAuthOptions} options - The options for the bearer authentication middleware. + * @param {string | string[]} [options.token] - The string or array of strings to validate the incoming bearer token against. + * @param {Function} [options.verifyToken] - The function to verify the token. + * @param {string} [options.realm=""] - The domain name of the realm, as part of the returned WWW-Authenticate challenge header. + * @param {string} [options.prefix="Bearer"] - The prefix (or known as `schema`) for the Authorization header value. If set to the empty string, no prefix is expected. + * @param {string} [options.headerName=Authorization] - The header name. + * @param {Function} [options.hashFunction] - A function to handle hashing for safe comparison of authentication tokens. + * @param {string | object | MessageFunction} [options.noAuthenticationHeader.message="Unauthorized"] - The no authentication header message. + * @param {string | object | MessageFunction} [options.noAuthenticationHeader.wwwAuthenticateHeader="Bearer realm=\"\""] - The response header value for the WWW-Authenticate header when no authentication header is provided. + * @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.message="Bad Request"] - The invalid authentication header message. + * @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.wwwAuthenticateHeader="Bearer error=\"invalid_request\""] - The response header value for the WWW-Authenticate header when authentication header is invalid. + * @param {string | object | MessageFunction} [options.invalidToken.message="Unauthorized"] - The invalid token message. + * @param {string | object | MessageFunction} [options.invalidToken.wwwAuthenticateHeader="Bearer error=\"invalid_token\""] - The response header value for the WWW-Authenticate header when token is invalid. + * @returns {MiddlewareHandler} The middleware handler function. + * @throws {Error} If neither "token" nor "verifyToken" options are provided. + * @throws {HTTPException} If authentication fails, with 401 status code for missing or invalid token, or 400 status code for invalid request. + * + * @example + * ```ts + * const app = new Hono() + * + * const token = 'honoishot' + * + * app.use('/api/*', bearerAuth({ token })) + * + * app.get('/api/page', (c) => { + * return c.json({ message: 'You are authorized' }) + * }) + * ``` + */ +export declare const bearerAuth: (options: BearerAuthOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/body-limit/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/body-limit/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..754e9eca286146919aa1b2ff0abc83741fd90e53 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/body-limit/index.d.ts @@ -0,0 +1,45 @@ +/** + * @module + * Body Limit Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +type OnError = (c: Context) => Response | Promise; +type BodyLimitOptions = { + maxSize: number; + onError?: OnError; +}; +/** + * Body Limit Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/body-limit} + * + * @param {BodyLimitOptions} options - The options for the body limit middleware. + * @param {number} options.maxSize - The maximum body size allowed. + * @param {OnError} [options.onError] - The error handler to be invoked if the specified body size is exceeded. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.post( + * '/upload', + * bodyLimit({ + * maxSize: 50 * 1024, // 50kb + * onError: (c) => { + * return c.text('overflow :(', 413) + * }, + * }), + * async (c) => { + * const body = await c.req.parseBody() + * if (body['file'] instanceof File) { + * console.log(`Got file sized: ${body['file'].size}`) + * } + * return c.text('pass :)') + * } + * ) + * ``` + */ +export declare const bodyLimit: (options: BodyLimitOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/cache/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/cache/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ab5486c8a72cebd8cfa6244d5e13f36d6d255148 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/cache/index.d.ts @@ -0,0 +1,45 @@ +/** + * @module + * Cache Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +import type { StatusCode } from '../../utils/http-status'; +/** + * Cache Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/cache} + * + * @param {Object} options - The options for the cache middleware. + * @param {string | Function} options.cacheName - The name of the cache. Can be used to store multiple caches with different identifiers. + * @param {boolean} [options.wait=false] - A boolean indicating if Hono should wait for the Promise of the `cache.put` function to resolve before continuing with the request. Required to be true for the Deno environment. + * @param {string} [options.cacheControl] - A string of directives for the `Cache-Control` header. + * @param {string | string[]} [options.vary] - Adds the configured request headers to the cache key variants and sets the `Vary` header in the response. If the original response header already contains a `Vary` header, the values are merged, removing any duplicates. + * @param {Function} [options.keyGenerator] - Generates keys for every request in the `cacheName` store. This can be used to cache data based on request parameters or context parameters. QUERY keys additionally include a digest of the request content and its representation metadata. + * @param {number} [options.maxQueryBodySize=65536] - The maximum QUERY request body size in bytes that can be cached. Larger QUERY requests bypass the cache. + * @param {number[]} [options.cacheableStatusCodes=[200]] - An array of status codes that can be cached. + * @param {Function | false} [options.onCacheNotAvailable] - A callback invoked with the reason when `globalThis.caches` is not available or QUERY caching cannot use Web Crypto. By default, the reason is logged to the console. Set to `false` to suppress the log, or provide a custom function. + * @returns {MiddlewareHandler} The middleware handler function. + * @throws {Error} If the `vary` option includes "*". + * + * @example + * ```ts + * app.use( + * '*', + * cache({ + * cacheName: 'my-app', + * cacheControl: 'max-age=3600', + * }) + * ) + * ``` + */ +export declare const cache: (options: { + cacheName: string | ((c: Context) => Promise | string); + wait?: boolean; + cacheControl?: string; + vary?: string | string[]; + keyGenerator?: (c: Context) => Promise | string; + maxQueryBodySize?: number; + cacheableStatusCodes?: StatusCode[]; + onCacheNotAvailable?: ((reason: string) => void) | false; +}) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/combine/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/combine/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f651de4dba72ace0de7adf2874ba4263beb4215 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/combine/index.d.ts @@ -0,0 +1,85 @@ +/** + * @module + * Combine Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +type Condition = (c: Context) => boolean; +/** + * Create a composed middleware that runs the first middleware that returns true. + * + * @param middleware - An array of MiddlewareHandler or Condition functions. + * Middleware is applied in the order it is passed, and if any middleware exits without returning + * an exception first, subsequent middleware will not be executed. + * You can also pass a condition function that returns a boolean value. If returns true + * the evaluation will be halted, and rest of the middleware will not be executed. + * @returns A composed middleware. + * + * @example + * ```ts + * import { some } from 'hono/combine' + * import { bearerAuth } from 'hono/bearer-auth' + * import { myRateLimit } from '@/rate-limit' + * + * // If client has a valid token, then skip rate limiting. + * // Otherwise, apply rate limiting. + * app.use('/api/*', some( + * bearerAuth({ token }), + * myRateLimit({ limit: 100 }), + * )); + * ``` + */ +export declare const some: (...middleware: (MiddlewareHandler | Condition)[]) => MiddlewareHandler; +/** + * Create a composed middleware that runs all middleware and throws an error if any of them fail. + * + * @param middleware - An array of MiddlewareHandler or Condition functions. + * Middleware is applied in the order it is passed, and if any middleware throws an error, + * subsequent middleware will not be executed. + * You can also pass a condition function that returns a boolean value. If returns false + * the evaluation will be halted, and rest of the middleware will not be executed. + * @returns A composed middleware. + * + * @example + * ```ts + * import { some, every } from 'hono/combine' + * import { bearerAuth } from 'hono/bearer-auth' + * import { myCheckLocalNetwork } from '@/check-local-network' + * import { myRateLimit } from '@/rate-limit' + * + * // If client is in local network, then skip authentication and rate limiting. + * // Otherwise, apply authentication and rate limiting. + * app.use('/api/*', some( + * myCheckLocalNetwork(), + * every( + * bearerAuth({ token }), + * myRateLimit({ limit: 100 }), + * ), + * )); + * ``` + */ +export declare const every: (...middleware: (MiddlewareHandler | Condition)[]) => MiddlewareHandler; +/** + * Create a composed middleware that runs all middleware except when the condition is met. + * + * @param condition - A string or Condition function. + * If there are multiple targets to match any of them, they can be passed as an array. + * If a string is passed, it will be treated as a path pattern to match. + * If a Condition function is passed, it will be evaluated against the request context. + * @param middleware - A composed middleware + * + * @example + * ```ts + * import { except } from 'hono/combine' + * import { bearerAuth } from 'hono/bearer-auth' + * + * // If client is accessing public API, then skip authentication. + * // Otherwise, require a valid token. + * app.use('/api/*', except( + * '/api/public/*', + * bearerAuth({ token }), + * )); + * ``` + */ +export declare const except: (condition: string | Condition | (string | Condition)[], ...middleware: MiddlewareHandler[]) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/compress/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/compress/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b0ff2de8cc41aee1ea5c7bf9395680f18a89d2e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/compress/index.d.ts @@ -0,0 +1,40 @@ +/** + * @module + * Compress Middleware for Hono. + */ +import type { MiddlewareHandler } from '../../types'; +import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from '../../utils/compress'; +export { COMPRESSIBLE_CONTENT_TYPE_REGEX }; +declare const ENCODING_TYPES: readonly ["gzip", "deflate"]; +type Encoding = (typeof ENCODING_TYPES)[number]; +type ContentTypeFilter = RegExp | ((contentType: string) => boolean); +interface CompressionOptions { + encoding?: Encoding; + threshold?: number; + contentTypeFilter?: ContentTypeFilter; +} +/** + * Compress Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/compress} + * + * @param {CompressionOptions} [options] - The options for the compress middleware. + * @param {'gzip' | 'deflate'} [options.encoding] - The compression scheme to allow for response compression. Either 'gzip' or 'deflate'. If not defined, both are allowed and will be used based on the Accept-Encoding header. 'gzip' is prioritized if this option is not provided and the client provides both in the Accept-Encoding header. + * @param {number} [options.threshold=1024] - The minimum size in bytes to compress. Defaults to 1024 bytes. + * @param {RegExp | Function} [options.contentTypeFilter=COMPRESSIBLE_CONTENT_TYPE_REGEX] - A RegExp or function to determine if the response Content-Type should be compressed. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use(compress()) + * + * // Compress only JSON responses + * app.use(compress({ contentTypeFilter: /^application\/json/ })) + * + * // Compress based on custom Content-Type logic + * app.use(compress({ contentTypeFilter: (type) => COMPRESSIBLE_CONTENT_TYPE_REGEX.test(type) || type === "application/x-myformat" })) + * ``` + */ +export declare const compress: (options?: CompressionOptions) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/context-storage/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/context-storage/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de0409204ad4ac58c1ebff0e21d1bf9119874a91 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/context-storage/index.d.ts @@ -0,0 +1,40 @@ +/** + * @module + * Context Storage Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { Env, MiddlewareHandler } from '../../types'; +/** + * Context Storage Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/context-storage} + * + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * type Env = { + * Variables: { + * message: string + * } + * } + * + * const app = new Hono() + * + * app.use(contextStorage()) + * + * app.use(async (c, next) => { + * c.set('message', 'Hono is hot!!') + * await next() + * }) + * + * app.get('/', async (c) => c.text(getMessage())) + * + * const getMessage = () => { + * return getContext().var.message + * } + * ``` + */ +export declare const contextStorage: () => MiddlewareHandler; +export declare const tryGetContext: () => Context | undefined; +export declare const getContext: () => Context; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/cors/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/cors/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..32cdbd1d45237f501c76034899a788e5caaf8a38 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/cors/index.d.ts @@ -0,0 +1,55 @@ +/** + * @module + * CORS Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +type CORSOptions = { + origin?: string | string[] | ((origin: string, c: Context) => Promise | string | undefined | null); + allowMethods?: string[] | ((origin: string, c: Context) => Promise | string[]); + allowHeaders?: string[]; + maxAge?: number; + credentials?: boolean; + exposeHeaders?: string[]; +}; +/** + * CORS Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/cors} + * + * @param {CORSOptions} [options] - The options for the CORS middleware. + * @param {string | string[] | ((origin: string, c: Context) => Promise | string | undefined | null)} [options.origin='*'] - The value of "Access-Control-Allow-Origin" CORS header. + * @param {string[] | ((origin: string, c: Context) => Promise | string[])} [options.allowMethods=['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH', 'QUERY']] - The value of "Access-Control-Allow-Methods" CORS header. + * @param {string[]} [options.allowHeaders=[]] - The value of "Access-Control-Allow-Headers" CORS header. + * @param {number} [options.maxAge] - The value of "Access-Control-Max-Age" CORS header. + * @param {boolean} [options.credentials] - The value of "Access-Control-Allow-Credentials" CORS header. + * @param {string[]} [options.exposeHeaders=[]] - The value of "Access-Control-Expose-Headers" CORS header. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use('/api/*', cors()) + * app.use( + * '/api2/*', + * cors({ + * origin: 'http://example.com', + * allowHeaders: ['X-Custom-Header', 'Upgrade-Insecure-Requests'], + * allowMethods: ['POST', 'GET', 'OPTIONS'], + * exposeHeaders: ['Content-Length', 'X-Kuma-Revision'], + * maxAge: 600, + * credentials: true, + * }) + * ) + * + * app.all('/api/abc', (c) => { + * return c.json({ success: true }) + * }) + * app.all('/api2/abc', (c) => { + * return c.json({ success: true }) + * }) + * ``` + */ +export declare const cors: (options?: CORSOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/csrf/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/csrf/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc478548aff8d6b521227f65e0d10d453e47875d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/csrf/index.d.ts @@ -0,0 +1,78 @@ +/** + * @module + * CSRF Protection Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +type IsAllowedOriginHandler = (origin: string, context: Context) => boolean | Promise; +declare const secFetchSiteValues: readonly ["same-origin", "same-site", "none", "cross-site"]; +type SecFetchSite = (typeof secFetchSiteValues)[number]; +type IsAllowedSecFetchSiteHandler = (secFetchSite: SecFetchSite, context: Context) => boolean | Promise; +interface CSRFOptions { + origin?: string | string[] | IsAllowedOriginHandler; + secFetchSite?: SecFetchSite | SecFetchSite[] | IsAllowedSecFetchSiteHandler; +} +/** + * CSRF Protection Middleware for Hono. + * + * Protects against Cross-Site Request Forgery attacks by validating request origins + * and sec-fetch-site headers. The request is allowed if either validation passes. + * + * @see {@link https://hono.dev/docs/middleware/builtin/csrf} + * + * @param {CSRFOptions} [options] - The options for the CSRF protection middleware. + * @param {string|string[]|(origin: string, context: Context) => boolean} [options.origin] - + * Allowed origins for requests. + * - string: Single allowed origin (e.g., 'https://example.com') + * - string[]: Multiple allowed origins + * - function: Custom validation logic + * - Default: Only same origin as the request URL + * @param {string|string[]|(secFetchSite: string, context: Context) => boolean} [options.secFetchSite] - + * Sec-Fetch-Site header validation. Standard values include 'same-origin', 'same-site', 'cross-site', 'none'. + * - string: Single allowed value (e.g., 'same-origin') + * - string[]: Multiple allowed values (e.g., ['same-origin', 'same-site']) + * - function: Custom validation with access to context + * - Default: Only allows 'same-origin' + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * // Default: both origin and sec-fetch-site validation + * app.use('*', csrf()) + * + * // Allow specific origins + * app.use('*', csrf({ origin: 'https://example.com' })) + * app.use('*', csrf({ origin: ['https://app.com', 'https://api.com'] })) + * + * // Allow specific sec-fetch-site values + * app.use('*', csrf({ secFetchSite: 'same-origin' })) + * app.use('*', csrf({ secFetchSite: ['same-origin', 'same-site'] })) + * + * // Dynamic sec-fetch-site validation + * app.use('*', csrf({ + * secFetchSite: (secFetchSite, c) => { + * // Always allow same-origin + * if (secFetchSite === 'same-origin') return true + * // Allow cross-site for webhook endpoints + * if (secFetchSite === 'cross-site' && c.req.path.startsWith('/webhook/')) { + * return true + * } + * return false + * } + * })) + * + * // Dynamic origin validation + * app.use('*', csrf({ + * origin: (origin, c) => { + * // Allow same origin + * if (origin === new URL(c.req.url).origin) return true + * // Allow specific trusted domains + * return ['https://app.example.com', 'https://admin.example.com'].includes(origin) + * } + * })) + * ``` + */ +export declare const csrf: (options?: CSRFOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/etag/digest.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/etag/digest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dcc773a99ce482b2aff0f9277b9ec979941ab05a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/etag/digest.d.ts @@ -0,0 +1 @@ +export declare const generateDigest: (stream: ReadableStream> | null, generator: (body: Uint8Array) => ArrayBuffer | Promise) => Promise; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/etag/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/etag/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..415d028bb622b7e6a62e437f3fc8b4cada57a1dd --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/etag/index.d.ts @@ -0,0 +1,42 @@ +/** + * @module + * ETag Middleware for Hono. + */ +import type { MiddlewareHandler } from '../../types'; +type ETagOptions = { + retainedHeaders?: string[]; + weak?: boolean; + generateDigest?: (body: Uint8Array) => ArrayBuffer | Promise; +}; +/** + * Default headers to pass through on 304 responses. From the spec: + * > The response must not contain a body and must include the headers that + * > would have been sent in an equivalent 200 OK response: Cache-Control, + * > Content-Location, Date, ETag, Expires, and Vary. + */ +export declare const RETAINED_304_HEADERS: string[]; +/** + * ETag Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/etag} + * + * @param {ETagOptions} [options] - The options for the ETag middleware. + * @param {boolean} [options.weak=false] - Define using or not using a weak validation. If true is set, then `W/` is added to the prefix of the value. + * @param {string[]} [options.retainedHeaders=RETAINED_304_HEADERS] - The headers that you want to retain in the 304 Response. + * @param {function(Uint8Array): ArrayBuffer | Promise} [options.generateDigest] - + * A custom digest generation function. By default, it uses 'SHA-1' + * This function is called with the response body as a `Uint8Array` and should return a hash as an `ArrayBuffer` or a Promise of one. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use('/etag/*', etag()) + * app.get('/etag/abc', (c) => { + * return c.text('Hono is hot') + * }) + * ``` + */ +export declare const etag: (options?: ETagOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0fa76dc1b2e19631d49aa522187a794fd92c57c2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts @@ -0,0 +1,67 @@ +/** + * IP Restriction Middleware for Hono + * @module + */ +import type { Context, MiddlewareHandler } from '../..'; +import type { AddressType, GetConnInfo } from '../../helper/conninfo'; +/** + * Function to get IP Address + */ +type GetIPAddr = GetConnInfo | ((c: Context) => string); +export type IPRestrictionRule = string | ((addr: { + addr: string; + type: AddressType; +}) => boolean); +/** + * Rules for IP Restriction Middleware + */ +export interface IPRestrictionRules { + denyList?: IPRestrictionRule[]; + allowList?: IPRestrictionRule[]; +} +/** + * IP Restriction Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/ip-restriction} + * + * @param {GetConnInfo | ((c: Context) => string)} getIP - A function to retrieve the client IP address. Use `getConnInfo` from the appropriate runtime adapter. + * @param {IPRestrictionRules} rules - An object with optional `denyList` and `allowList` arrays of IP rules. Each rule can be a static IP, a CIDR range, or a custom function. + * @param {(remote: { addr: string; type: AddressType }, c: Context) => Response | Promise} [onError] - Optional custom handler invoked when a request is blocked. Defaults to returning a 403 Forbidden response. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * import { Hono } from 'hono' + * import { ipRestriction } from 'hono/ip-restriction' + * import { getConnInfo } from 'hono/cloudflare-workers' + * + * const app = new Hono() + * + * app.use( + * '*', + * ipRestriction(getConnInfo, { + * // Block a specific IP and an entire subnet + * denyList: ['192.168.0.5', '10.0.0.0/8'], + * // Only allow requests from localhost and a private range + * allowList: ['127.0.0.1', '::1', '192.168.1.0/24'], + * }) + * ) + * + * // With a custom error handler + * app.use( + * '/admin/*', + * ipRestriction( + * getConnInfo, + * { allowList: ['203.0.113.0/24'] }, + * (remote, c) => c.text(`Access denied for ${remote.addr}`, 403) + * ) + * ) + * + * app.get('/', (c) => c.text('Hello!')) + * ``` + */ +export declare const ipRestriction: (getIP: GetIPAddr, { denyList, allowList }: IPRestrictionRules, onError?: (remote: { + addr: string; + type: AddressType; +}, c: Context) => Response | Promise) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..03d105f762a5ada49192aaee7fb2e2b5f3735711 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts @@ -0,0 +1,77 @@ +/** + * @module + * JSX Renderer Middleware for Hono. + */ +import type { Context, PropsForRenderer } from '../../context'; +import type { FC, Context as JSXContext, PropsWithChildren } from '../../jsx'; +import type { Env, Input, MiddlewareHandler } from '../../types'; +export declare const RequestContext: JSXContext | null>; +type RendererOptions = { + docType?: boolean | string; + stream?: boolean | Record; +}; +type ComponentResult = Exclude, null>; +type ComponentWithChildren = (props: PropsWithChildren, c: Context) => ComponentResult; +/** + * JSX Renderer Middleware for hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/jsx-renderer} + * + * @param {ComponentWithChildren} [component] - The component to render, which can accept children and props. + * @param {RendererOptions} [options] - The options for the JSX renderer middleware. + * @param {boolean | string} [options.docType=true] - The DOCTYPE to be added at the beginning of the HTML. If set to false, no DOCTYPE will be added. + * @param {boolean | Record} [options.stream=false] - If set to true, enables streaming response with default headers. If a record is provided, custom headers will be used. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.get( + * '/page/*', + * jsxRenderer(({ children }) => { + * return ( + * + * + *

Menu
+ *
{children}
+ * + * + * ) + * }) + * ) + * + * app.get('/page/about', (c) => { + * return c.render(

About me!

) + * }) + * ``` + */ +export declare const jsxRenderer: (component?: ComponentWithChildren, options?: RendererOptions | ((c: Context) => RendererOptions)) => MiddlewareHandler; +/** + * useRequestContext for Hono. + * + * @template E - The environment type. + * @template P - The parameter type. + * @template I - The input type. + * @returns {Context} An instance of Context. + * + * @example + * ```ts + * const RequestUrlBadge: FC = () => { + * const c = useRequestContext() + * return {c.req.url} + * } + * + * app.get('/page/info', (c) => { + * return c.render( + *
+ * You are accessing: + *
+ * ) + * }) + * ``` + */ +export declare const useRequestContext: () => Context; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/jwk/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/jwk/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ff7158d27e98b2210b0ef1f9d660390d03c71514 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/jwk/index.d.ts @@ -0,0 +1 @@ +export { jwk } from './jwk'; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e92f20ef47f38de60dceefdfc4d011565ac7e41 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts @@ -0,0 +1,56 @@ +/** + * @module + * JWK Auth Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +import type { CookiePrefixOptions } from '../../utils/cookie'; +import '../../context'; +import type { AsymmetricAlgorithm } from '../../utils/jwt/jwa'; +import type { HonoJsonWebKey } from '../../utils/jwt/jws'; +import type { VerifyOptions } from '../../utils/jwt/jwt'; +/** + * JWK Auth Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/jwk} + * + * @param {object} options - The options for the JWK middleware. + * @param {HonoJsonWebKey[] | ((ctx: Context) => Promise | HonoJsonWebKey[])} [options.keys] - The public keys used for JWK verification, or a function that returns them. + * @param {string | ((ctx: Context) => Promise | string)} [options.jwks_uri] - If set to a URI string or a function that returns a URI string, attempt to fetch JWKs from it. The response must be a JSON object containing a `keys` array, which will be merged with the `keys` option. + * @param {boolean} [options.allow_anon] - If set to `true`, the middleware allows requests without a token to proceed without authentication. + * @param {string} [options.cookie] - If set, the middleware attempts to retrieve the token from a cookie with these options (optionally signed) only if no token is found in the header. + * @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'. + * @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL. + * @param {AsymmetricAlgorithm[]} options.alg - An array of allowed asymmetric algorithms for JWT verification. Only tokens signed with these algorithms will be accepted. + * @param {RequestInit} [init] - Optional init options for the `fetch` request when retrieving JWKS from a URI. + * @param {VerifyOptions} [options.verification] - Additional options for JWK payload verification. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use("/auth/*", jwk({ + * jwks_uri: (c) => `https://${c.env.authServer}/.well-known/jwks.json`, + * headerName: 'x-custom-auth-header', // Optional, default is 'Authorization' + * })) + * + * app.get('/auth/page', (c) => { + * return c.text('You are authorized') + * }) + * ``` + */ +export declare const jwk: (options: { + keys?: HonoJsonWebKey[] | ((ctx: Context) => Promise | HonoJsonWebKey[]); + jwks_uri?: string | ((ctx: Context) => Promise | string); + allow_anon?: boolean; + cookie?: string | { + key: string; + secret?: string | BufferSource; + prefixOptions?: CookiePrefixOptions; + }; + headerName?: string; + alg: AsymmetricAlgorithm[]; + realm?: string; + verification?: VerifyOptions; +}, init?: RequestInit) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/jwt/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/jwt/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4acd6f08fd81bfc083d871f7fd9ce7a049504ee1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/jwt/index.d.ts @@ -0,0 +1,8 @@ +import type { JwtVariables } from './jwt'; +export type { JwtVariables }; +export { jwt, verifyWithJwks, verify, decode, sign } from './jwt'; +export { AlgorithmTypes } from '../../utils/jwt/jwa'; +declare module '../..' { + interface ContextVariableMap extends JwtVariables { + } +} diff --git a/tools/ui/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9fe571643cc80cf2866e91b945eab676209e9842 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts @@ -0,0 +1,69 @@ +/** + * @module + * JWT Auth Middleware for Hono. + */ +import type { MiddlewareHandler } from '../../types'; +import type { CookiePrefixOptions } from '../../utils/cookie'; +import '../../context'; +import type { SignatureAlgorithm } from '../../utils/jwt/jwa'; +import type { SignatureKey } from '../../utils/jwt/jws'; +import type { VerifyOptions } from '../../utils/jwt/jwt'; +export type JwtVariables = { + jwtPayload: T; +}; +/** + * JWT Auth Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/jwt} + * + * @param {object} options - The options for the JWT middleware. + * @param {SignatureKey} options.secret - A value of your secret key. + * @param {string} [options.cookie] - If this value is set, then the value is retrieved from the cookie header using that value as a key, which is then validated as a token. + * @param {SignatureAlgorithm} options.alg - An algorithm type that is used for verifying (required). Available types are `HS256` | `HS384` | `HS512` | `RS256` | `RS384` | `RS512` | `PS256` | `PS384` | `PS512` | `ES256` | `ES384` | `ES512` | `EdDSA`. + * @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'. + * @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL. + * @param {VerifyOptions} [options.verification] - Additional options for JWT payload verification. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use( + * '/auth/*', + * jwt({ + * secret: 'it-is-very-secret', + * alg: 'HS256', + * headerName: 'x-custom-auth-header', // Optional, default is 'Authorization' + * }) + * ) + * + * app.get('/auth/page', (c) => { + * return c.text('You are authorized') + * }) + * ``` + */ +export declare const jwt: (options: { + secret: SignatureKey; + cookie?: string | { + key: string; + secret?: string | BufferSource; + prefixOptions?: CookiePrefixOptions; + }; + alg: SignatureAlgorithm; + headerName?: string; + realm?: string; + verification?: VerifyOptions; +}) => MiddlewareHandler; +export declare const verifyWithJwks: (token: string, options: { + keys?: import("../../utils/jwt/jws").HonoJsonWebKey[]; + jwks_uri?: string; + verification?: VerifyOptions; + allowedAlgorithms: readonly import("../../utils/jwt/jwa").AsymmetricAlgorithm[]; +}, init?: RequestInit) => Promise; +export declare const verify: (token: string, publicKey: SignatureKey, algOrOptions: SignatureAlgorithm | import("../../utils/jwt/jwt").VerifyOptionsWithAlg) => Promise; +export declare const decode: (token: string) => { + header: import("../../utils/jwt/jwt").TokenHeader; + payload: import("../../utils/jwt/types").JWTPayload; +}; +export declare const sign: (payload: import("../../utils/jwt/types").JWTPayload, privateKey: SignatureKey, alg?: SignatureAlgorithm) => Promise; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/language/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/language/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..51cc2ee43e816cb1670e1e000de72cd18f334296 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/language/index.d.ts @@ -0,0 +1,7 @@ +import type { LanguageVariables, DetectorOptions, DetectorType, CacheType } from './language'; +export type { LanguageVariables, DetectorOptions, DetectorType, CacheType }; +export { languageDetector, detectFromCookie, detectFromHeader, detectFromPath, detectFromQuery, } from './language'; +declare module '../..' { + interface ContextVariableMap extends LanguageVariables { + } +} diff --git a/tools/ui/node_modules/hono/dist/types/middleware/language/language.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/language/language.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..913bf4beae29f32912b9addd7d0e48c45cae11c9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/language/language.d.ts @@ -0,0 +1,120 @@ +/** + * @module + * Language module for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +export type DetectorType = 'path' | 'querystring' | 'cookie' | 'header'; +export type CacheType = 'cookie'; +export interface DetectorOptions { + /** Order of language detection strategies */ + order: DetectorType[]; + /** Query parameter name for language */ + lookupQueryString: string; + /** Cookie name for language */ + lookupCookie: string; + /** Index in URL path where language code appears */ + lookupFromPathIndex: number; + /** Header key for language detection */ + lookupFromHeaderKey: string; + /** Caching strategies */ + caches: CacheType[] | false; + /** Cookie configuration options */ + cookieOptions?: { + domain?: string; + path?: string; + sameSite?: 'Strict' | 'Lax' | 'None'; + secure?: boolean; + maxAge?: number; + httpOnly?: boolean; + }; + /** Whether to ignore case in language codes */ + ignoreCase: boolean; + /** Default language if none detected */ + fallbackLanguage: string; + /** List of supported language codes */ + supportedLanguages: string[]; + /** Optional function to transform detected language codes */ + convertDetectedLanguage?: (lang: string) => string; + /** Enable debug logging */ + debug?: boolean; +} +export interface LanguageVariables { + language: string; +} +export declare const DEFAULT_OPTIONS: DetectorOptions; +/** + * Parse Accept-Language header values with quality scores + * @param header Accept-Language header string + * @returns Array of parsed languages with quality scores + */ +export declare function parseAcceptLanguage(header: string): Array<{ + lang: string; + q: number; +}>; +/** + * Validate and normalize language codes + * @param lang Language code to normalize + * @param options Detector options + * @returns Normalized language code or undefined + */ +export declare const normalizeLanguage: (lang: string | null | undefined, options: DetectorOptions) => string | undefined; +/** + * Detects language from query parameter + */ +export declare const detectFromQuery: (c: Context, options: DetectorOptions) => string | undefined; +/** + * Detects language from cookie + */ +export declare const detectFromCookie: (c: Context, options: DetectorOptions) => string | undefined; +/** + * Detects language from Accept-Language header + */ +export declare function detectFromHeader(c: Context, options: DetectorOptions): string | undefined; +/** + * Detects language from URL path + */ +export declare function detectFromPath(c: Context, options: DetectorOptions): string | undefined; +/** + * Collection of all language detection strategies + */ +export declare const detectors: { + readonly querystring: (c: Context, options: DetectorOptions) => string | undefined; + readonly cookie: (c: Context, options: DetectorOptions) => string | undefined; + readonly header: typeof detectFromHeader; + readonly path: typeof detectFromPath; +}; +/** Type for detector functions */ +export type DetectorFunction = (c: Context, options: DetectorOptions) => string | undefined; +/** Type-safe detector map */ +export type Detectors = Record; +/** + * Validate detector options + * @param options Detector options to validate + * @throws Error if options are invalid + */ +export declare function validateOptions(options: DetectorOptions): void; +/** + * Language detector middleware factory + * @param userOptions Configuration options for the language detector + * @returns Hono middleware function + * + * @example + * ```ts + * type Variables = LanguageVariables + * const app = new Hono<{ Variables: Variables }>() + * + * app.use( + * languageDetector({ + * supportedLanguages: ['en', 'ja'], // Must include fallback + * fallbackLanguage: 'en', // Required + * }) + * ) + * + * app.get('/', (c) => { + * const lang = c.get('language') + * return c.text(`Current language: ${lang}`) + * }) + * ``` + */ +export declare const languageDetector: (userOptions: Partial) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/logger/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/logger/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a36100ef99232fdaecf88f823a4131e145c12659 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/logger/index.d.ts @@ -0,0 +1,24 @@ +/** + * @module + * Logger Middleware for Hono. + */ +import type { MiddlewareHandler } from '../../types'; +type PrintFunc = (str: string, ...rest: string[]) => void; +/** + * Logger Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/logger} + * + * @param {PrintFunc} [fn=console.log] - Optional function for customized logging behavior. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use(logger()) + * app.get('/', (c) => c.text('Hello Hono!')) + * ``` + */ +export declare const logger: (fn?: PrintFunc) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..36c9d1e447281277f31ea9625a03dd46f68481ad --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts @@ -0,0 +1,49 @@ +/** + * @module + * Method Not Allowed Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { Hono } from '../../hono'; +import type { Env, MiddlewareHandler } from '../../types'; +type MethodNotAllowedHandler = (c: Context, allowedMethods: string[]) => Response | Promise; +type MethodNotAllowedOptions = { + app: Hono; + onMethodNotAllowed?: MethodNotAllowedHandler; +}; +/** + * Method Not Allowed Middleware for Hono. + * + * Returns a `405 Method Not Allowed` response with an `Allow` header when the request path + * matches a registered route but the request method is not supported. + * + * @param {MethodNotAllowedOptions} options - The options for the middleware. + * @param {Hono} options.app - The Hono instance used by the application. + * @param {MethodNotAllowedHandler} [options.onMethodNotAllowed] - Generates the response, including its `Allow` header. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use(methodNotAllowed({ app })) + * + * app.get('/hello', (c) => c.text('Hello!')) + * app.post('/hello', (c) => c.text('Posted!')) + * + * // PUT /hello -> 405 Method Not Allowed + * // Allow: GET, HEAD, POST + * ``` + * + * @example + * ```ts + * app.use( + * methodNotAllowed({ + * app, + * onMethodNotAllowed: (c, methods) => + * c.json({ error: 'Method Not Allowed' }, 405, { Allow: methods.join(', ') }), + * }) + * ) + * ``` + */ +export declare const methodNotAllowed: (options: MethodNotAllowedOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/method-override/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/method-override/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0217975e64d262e7c7ea8d14969ebf28f21e29c3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/method-override/index.d.ts @@ -0,0 +1,48 @@ +/** + * @module + * Method Override Middleware for Hono. + */ +import type { Hono } from '../../hono'; +import type { MiddlewareHandler } from '../../types'; +type MethodOverrideOptions = { + app: Hono; +} & ({ + form?: string; + header?: never; + query?: never; +} | { + form?: never; + header: string; + query?: never; +} | { + form?: never; + header?: never; + query: string; +}); +/** + * Method Override Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/method-override} + * + * @param {MethodOverrideOptions} options - The options for the method override middleware. + * @param {Hono} options.app - The instance of Hono is used in your application. + * @param {string} [options.form=_method] - Form key with a value containing the method name. + * @param {string} [options.header] - Header name with a value containing the method name. + * @param {string} [options.query] - Query parameter key with a value containing the method name. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * // If no options are specified, the value of `_method` in the form, + * // e.g. DELETE, is used as the method. + * app.use('/posts', methodOverride({ app })) + * + * app.delete('/posts', (c) => { + * // .... + * }) + * ``` + */ +export declare const methodOverride: (options: MethodOverrideOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/powered-by/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/powered-by/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9091970939ea3652d9857be33d2e32d8d499836f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/powered-by/index.d.ts @@ -0,0 +1,29 @@ +/** + * @module + * Powered By Middleware for Hono. + */ +import type { MiddlewareHandler } from '../../types'; +type PoweredByOptions = { + /** + * The value for X-Powered-By header. + * @default Hono + */ + serverName?: string; +}; +/** + * Powered By Middleware for Hono. + * + * @param options - The options for the Powered By Middleware. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * import { poweredBy } from 'hono/powered-by' + * + * const app = new Hono() + * + * app.use(poweredBy()) // With options: poweredBy({ serverName: "My Server" }) + * ``` + */ +export declare const poweredBy: (options?: PoweredByOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..256d4ce6d49e02fc26a8a7e1be7d081d2b3452e3 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts @@ -0,0 +1,42 @@ +/** + * @module + * Pretty JSON Middleware for Hono. + */ +import type { MiddlewareHandler } from '../../types'; +interface PrettyOptions { + /** + * Number of spaces for indentation. + * @default 2 + */ + space?: number; + /** + * Query conditions for when to Pretty. + * @default 'pretty' + */ + query?: string; + /** + * Force prettification of JSON responses regardless of query parameters. + * @default false + */ + force?: boolean; +} +/** + * Pretty JSON Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/pretty-json} + * + * @param options - The options for the pretty JSON middleware. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use(prettyJSON()) // With options: prettyJSON({ space: 4 }) + * app.get('/', (c) => { + * return c.json({ message: 'Hono!' }) + * }) + * ``` + */ +export declare const prettyJSON: (options?: PrettyOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/request-id/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/request-id/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc895b9a8d34213ab1bfaa38d3faeb26eb5359b2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/request-id/index.d.ts @@ -0,0 +1,7 @@ +import type { RequestIdVariables } from './request-id'; +export type { RequestIdVariables }; +export { requestId } from './request-id'; +declare module '../..' { + interface ContextVariableMap extends RequestIdVariables { + } +} diff --git a/tools/ui/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd1fdea4c9a3196abe8062c93a4342ef01a96ff9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts @@ -0,0 +1,37 @@ +/** + * @module + * Request ID Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +export type RequestIdVariables = { + requestId: string; +}; +export type RequestIdOptions = { + limitLength?: number; + headerName?: string; + generator?: (c: Context) => string; +}; +/** + * Request ID Middleware for Hono. + * + * @param {object} options - Options for Request ID middleware. + * @param {number} [options.limitLength=255] - The maximum length of request id. + * @param {string} [options.headerName=X-Request-Id] - The header name used in request id. + * @param {generator} [options.generator=() => crypto.randomUUID()] - The request id generation function. + * + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * type Variables = RequestIdVariables + * const app = new Hono<{Variables: Variables}>() + * + * app.use(requestId()) + * app.get('/', (c) => { + * console.log(c.get('requestId')) // Debug + * return c.text('Hello World!') + * }) + * ``` + */ +export declare const requestId: ({ limitLength, headerName, generator, }?: RequestIdOptions) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e351a8665f96f86d071d4c8394ed29dd04fa149 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts @@ -0,0 +1,8 @@ +export type { ContentSecurityPolicyOptionHandler } from './secure-headers'; +export { NONCE, secureHeaders } from './secure-headers'; +import type { SecureHeadersVariables } from './secure-headers'; +export type { SecureHeadersVariables }; +declare module '../..' { + interface ContextVariableMap extends SecureHeadersVariables { + } +} diff --git a/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a4c40ea96783c0ca4dbab99abba94c03374139c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts @@ -0,0 +1,14 @@ +export type PermissionsPolicyDirective = StandardizedFeatures | ProposedFeatures | ExperimentalFeatures; +/** + * These features have been declared in a published version of the respective specification. + */ +type StandardizedFeatures = 'accelerometer' | 'ambientLightSensor' | 'attributionReporting' | 'autoplay' | 'battery' | 'bluetooth' | 'camera' | 'chUa' | 'chUaArch' | 'chUaBitness' | 'chUaFullVersion' | 'chUaFullVersionList' | 'chUaMobile' | 'chUaModel' | 'chUaPlatform' | 'chUaPlatformVersion' | 'chUaWow64' | 'computePressure' | 'crossOriginIsolated' | 'directSockets' | 'displayCapture' | 'encryptedMedia' | 'executionWhileNotRendered' | 'executionWhileOutOfViewport' | 'fullscreen' | 'geolocation' | 'gyroscope' | 'hid' | 'identityCredentialsGet' | 'idleDetection' | 'keyboardMap' | 'magnetometer' | 'microphone' | 'midi' | 'navigationOverride' | 'payment' | 'pictureInPicture' | 'publickeyCredentialsGet' | 'screenWakeLock' | 'serial' | 'storageAccess' | 'syncXhr' | 'usb' | 'webShare' | 'windowManagement' | 'xrSpatialTracking'; +/** + * These features have been proposed, but the definitions have not yet been integrated into their respective specs. + */ +type ProposedFeatures = 'clipboardRead' | 'clipboardWrite' | 'gamepad' | 'sharedAutofill' | 'speakerSelection'; +/** + * These features generally have an explainer only, but may be available for experimentation by web developers. + */ +type ExperimentalFeatures = 'allScreensCapture' | 'browsingTopics' | 'capturedSurfaceControl' | 'conversionMeasurement' | 'digitalCredentialsGet' | 'focusWithoutUserActivation' | 'joinAdInterestGroup' | 'localFonts' | 'runAdAuction' | 'smartCard' | 'syncScript' | 'trustTokenRedemption' | 'unload' | 'verticalScroll'; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a632b52f3d4e9879f432643384c156ab8b5bce9f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts @@ -0,0 +1,109 @@ +/** + * @module + * Secure Headers Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +import type { PermissionsPolicyDirective } from './permissions-policy'; +export type SecureHeadersVariables = { + secureHeadersNonce?: string; +}; +export type ContentSecurityPolicyOptionHandler = (ctx: Context, directive: string) => string; +type ContentSecurityPolicyOptionValue = (string | ContentSecurityPolicyOptionHandler)[]; +interface ContentSecurityPolicyOptions { + defaultSrc?: ContentSecurityPolicyOptionValue; + baseUri?: ContentSecurityPolicyOptionValue; + childSrc?: ContentSecurityPolicyOptionValue; + connectSrc?: ContentSecurityPolicyOptionValue; + fontSrc?: ContentSecurityPolicyOptionValue; + formAction?: ContentSecurityPolicyOptionValue; + frameAncestors?: ContentSecurityPolicyOptionValue; + frameSrc?: ContentSecurityPolicyOptionValue; + imgSrc?: ContentSecurityPolicyOptionValue; + manifestSrc?: ContentSecurityPolicyOptionValue; + mediaSrc?: ContentSecurityPolicyOptionValue; + objectSrc?: ContentSecurityPolicyOptionValue; + reportTo?: string; + reportUri?: string | string[]; + sandbox?: ContentSecurityPolicyOptionValue; + scriptSrc?: ContentSecurityPolicyOptionValue; + scriptSrcAttr?: ContentSecurityPolicyOptionValue; + scriptSrcElem?: ContentSecurityPolicyOptionValue; + styleSrc?: ContentSecurityPolicyOptionValue; + styleSrcAttr?: ContentSecurityPolicyOptionValue; + styleSrcElem?: ContentSecurityPolicyOptionValue; + upgradeInsecureRequests?: ContentSecurityPolicyOptionValue; + workerSrc?: ContentSecurityPolicyOptionValue; + requireTrustedTypesFor?: ContentSecurityPolicyOptionValue; + trustedTypes?: ContentSecurityPolicyOptionValue; +} +interface ReportToOptions { + group: string; + max_age: number; + endpoints: ReportToEndpoint[]; +} +interface ReportToEndpoint { + url: string; +} +interface ReportingEndpointOptions { + name: string; + url: string; +} +type PermissionsPolicyValue = '*' | 'self' | 'src' | 'none' | string; +type PermissionsPolicyOptions = Partial>; +type overridableHeader = boolean | string; +interface SecureHeadersOptions { + contentSecurityPolicy?: ContentSecurityPolicyOptions; + contentSecurityPolicyReportOnly?: ContentSecurityPolicyOptions; + crossOriginEmbedderPolicy?: overridableHeader; + crossOriginResourcePolicy?: overridableHeader; + crossOriginOpenerPolicy?: overridableHeader; + originAgentCluster?: overridableHeader; + referrerPolicy?: overridableHeader; + reportingEndpoints?: ReportingEndpointOptions[]; + reportTo?: ReportToOptions[]; + strictTransportSecurity?: overridableHeader; + xContentTypeOptions?: overridableHeader; + xDnsPrefetchControl?: overridableHeader; + xDownloadOptions?: overridableHeader; + xFrameOptions?: overridableHeader; + xPermittedCrossDomainPolicies?: overridableHeader; + xXssProtection?: overridableHeader; + removePoweredBy?: boolean; + permissionsPolicy?: PermissionsPolicyOptions; +} +export declare const NONCE: ContentSecurityPolicyOptionHandler; +/** + * Secure Headers Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/secure-headers} + * + * @param {Partial} [customOptions] - The options for the secure headers middleware. + * @param {ContentSecurityPolicyOptions} [customOptions.contentSecurityPolicy] - Settings for the Content-Security-Policy header. + * @param {ContentSecurityPolicyOptions} [customOptions.contentSecurityPolicyReportOnly] - Settings for the Content-Security-Policy-Report-Only header. + * @param {overridableHeader} [customOptions.crossOriginEmbedderPolicy=false] - Settings for the Cross-Origin-Embedder-Policy header. + * @param {overridableHeader} [customOptions.crossOriginResourcePolicy=true] - Settings for the Cross-Origin-Resource-Policy header. + * @param {overridableHeader} [customOptions.crossOriginOpenerPolicy=true] - Settings for the Cross-Origin-Opener-Policy header. + * @param {overridableHeader} [customOptions.originAgentCluster=true] - Settings for the Origin-Agent-Cluster header. + * @param {overridableHeader} [customOptions.referrerPolicy=true] - Settings for the Referrer-Policy header. + * @param {ReportingEndpointOptions[]} [customOptions.reportingEndpoints] - Settings for the Reporting-Endpoints header. + * @param {ReportToOptions[]} [customOptions.reportTo] - Settings for the Report-To header. + * @param {overridableHeader} [customOptions.strictTransportSecurity=true] - Settings for the Strict-Transport-Security header. + * @param {overridableHeader} [customOptions.xContentTypeOptions=true] - Settings for the X-Content-Type-Options header. + * @param {overridableHeader} [customOptions.xDnsPrefetchControl=true] - Settings for the X-DNS-Prefetch-Control header. + * @param {overridableHeader} [customOptions.xDownloadOptions=true] - Settings for the X-Download-Options header. + * @param {overridableHeader} [customOptions.xFrameOptions=true] - Settings for the X-Frame-Options header. + * @param {overridableHeader} [customOptions.xPermittedCrossDomainPolicies=true] - Settings for the X-Permitted-Cross-Domain-Policies header. + * @param {overridableHeader} [customOptions.xXssProtection=true] - Settings for the X-XSS-Protection header. + * @param {boolean} [customOptions.removePoweredBy=true] - Settings for remove X-Powered-By header. + * @param {PermissionsPolicyOptions} [customOptions.permissionsPolicy] - Settings for the Permissions-Policy header. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * app.use(secureHeaders()) + * ``` + */ +export declare const secureHeaders: (customOptions?: SecureHeadersOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/serve-static/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/serve-static/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8fd60628fffb3844b75cc6643c65aabb1ee24e6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/serve-static/index.d.ts @@ -0,0 +1,31 @@ +/** + * @module + * Serve Static Middleware for Hono. + */ +import type { Context, Data } from '../../context'; +import type { Env, MiddlewareHandler } from '../../types'; +export type ServeStaticOptions = { + root?: string; + path?: string; + precompressed?: boolean; + mimes?: Record; + rewriteRequestPath?: (path: string) => string; + onFound?: (path: string, c: Context) => void | Promise; + onNotFound?: (path: string, c: Context) => void | Promise; +}; +/** + * This middleware is not directly used by the user. Create a wrapper specifying `getContent()` by the environment such as Deno or Bun. + */ +export declare const serveStatic: (options: ServeStaticOptions & { + getContent: (path: string, c: Context) => Promise; + /** + * + * `join` option according to the runtime. Example `import { join } from 'node:path`. If not specified, it will fall back to the default join function.` + */ + join?: (...paths: string[]) => string; + /** + * @deprecated Currently, `pathResolve` is no longer used. + */ + pathResolve?: (path: string) => string; + isDir?: (path: string) => boolean | undefined | Promise; +}) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/serve-static/path.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/serve-static/path.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d2e95e9d9244072617b09ac6f5c6d7a33748529 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/serve-static/path.d.ts @@ -0,0 +1,5 @@ +/** + * `defaultJoin` does not support Windows paths and always uses `/` separators. + * If you need Windows path support, please use `join` exported from `node:path` etc. instead. + */ +export declare const defaultJoin: (...paths: string[]) => string; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/timeout/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/timeout/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..28d533f902f97bbb39fd60a8b87385b6e48866ce --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/timeout/index.d.ts @@ -0,0 +1,31 @@ +/** + * @module + * Timeout Middleware for Hono. + */ +import type { Context } from '../../context'; +import { HTTPException } from '../../http-exception'; +import type { MiddlewareHandler } from '../../types'; +export type HTTPExceptionFunction = (context: Context) => HTTPException; +/** + * Timeout Middleware for Hono. + * + * @param {number} duration - The timeout duration in milliseconds. + * @param {HTTPExceptionFunction | HTTPException} [exception=defaultTimeoutException] - The exception to throw when the timeout occurs. Can be a function that returns an HTTPException or an HTTPException object. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use( + * '/long-request', + * timeout(5000) // Set timeout to 5 seconds + * ) + * + * app.get('/long-request', async (c) => { + * await someLongRunningFunction() + * return c.text('Completed within time limit') + * }) + * ``` + */ +export declare const timeout: (duration: number, exception?: HTTPExceptionFunction | HTTPException) => MiddlewareHandler; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/timing/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/timing/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a627bc6dbbd4ffcf9d27e3f3cef5453369a2f07f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/timing/index.d.ts @@ -0,0 +1,7 @@ +import type { TimingVariables } from './timing'; +export { TimingVariables }; +export { timing, setMetric, startTime, endTime, wrapTime } from './timing'; +declare module '../..' { + interface ContextVariableMap extends TimingVariables { + } +} diff --git a/tools/ui/node_modules/hono/dist/types/middleware/timing/timing.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/timing/timing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b4d2170358150aaab4bd32753835f648c0e46cfc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/timing/timing.d.ts @@ -0,0 +1,129 @@ +/** + * @module + * Server-Timing Middleware for Hono. + */ +import type { Context } from '../../context'; +import type { MiddlewareHandler } from '../../types'; +import '../../context'; +export type TimingVariables = { + metric?: { + headers: string[]; + timers: Map; + }; +}; +interface Timer { + description?: string; + start: number; +} +interface TimingOptions { + total?: boolean; + enabled?: boolean | ((c: Context) => boolean); + totalDescription?: string; + autoEnd?: boolean; + crossOrigin?: boolean | string | ((c: Context) => boolean | string); +} +/** + * Server-Timing Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/timing} + * + * @param {TimingOptions} [config] - The options for the timing middleware. + * @param {boolean} [config.total=true] - Show the total response time. + * @param {boolean | ((c: Context) => boolean)} [config.enabled=true] - Whether timings should be added to the headers or not. + * @param {string} [config.totalDescription=Total Response Time] - Description for the total response time. + * @param {boolean} [config.autoEnd=true] - If `startTime()` should end automatically at the end of the request. + * @param {boolean | string | ((c: Context) => boolean | string)} [config.crossOrigin=false] - The origin this timings header should be readable. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * // add the middleware to your router + * app.use(timing()); + * + * app.get('/', async (c) => { + * // add custom metrics + * setMetric(c, 'region', 'europe-west3') + * + * // add custom metrics with timing, must be in milliseconds + * setMetric(c, 'custom', 23.8, 'My custom Metric') + * + * // start a new timer + * startTime(c, 'db'); + * + * const data = await db.findMany(...); + * + * // end the timer + * endTime(c, 'db'); + * + * return c.json({ response: data }); + * }); + * ``` + */ +export declare const timing: (config?: TimingOptions) => MiddlewareHandler; +interface SetMetric { + (c: Context, name: string, value: number, description?: string, precision?: number): void; + (c: Context, name: string, description?: string): void; +} +/** + * Set a metric for the timing middleware. + * + * @param {Context} c - The context of the request. + * @param {string} name - The name of the metric. + * @param {number | string} [valueDescription] - The value or description of the metric. + * @param {string} [description] - The description of the metric. + * @param {number} [precision] - The precision of the metric value. + * + * @example + * ```ts + * setMetric(c, 'region', 'europe-west3') + * setMetric(c, 'custom', 23.8, 'My custom Metric') + * ``` + */ +export declare const setMetric: SetMetric; +/** + * Start a timer for the timing middleware. + * + * @param {Context} c - The context of the request. + * @param {string} name - The name of the timer. + * @param {string} [description] - The description of the timer. + * + * @example + * ```ts + * startTime(c, 'db') + * ``` + */ +export declare const startTime: (c: Context, name: string, description?: string) => void; +/** + * End a timer for the timing middleware. + * + * @param {Context} c - The context of the request. + * @param {string} name - The name of the timer. + * @param {number} [precision] - The precision of the timer value. + * + * @example + * ```ts + * endTime(c, 'db') + * ``` + */ +export declare const endTime: (c: Context, name: string, precision?: number) => void; +/** + * Wrap a Promise to capture its duration. + * @param {Context} c - The context of the request. + * @param {string} name - The name of the timer. + * @param {Promise} callable - The Promise to time. + * @param {string} [description] - The description of the timer. + * @param {number} [precision] - The precision of the timer value. + * + * @example + * ```ts + * // Instead of this: + * const data = await db.findMany(...); + * + * // do this: + * const data = await wrapTime(c, 'query', db.findMany(...)); + * ``` + * */ +export declare function wrapTime(c: Context, name: string, callable: Promise, description?: string, precision?: number): Promise; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts b/tools/ui/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f5e2c1f9dd0ea9c83784468805542d1241252c42 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts @@ -0,0 +1,94 @@ +/** + * @module + * Trailing Slash Middleware for Hono. + */ +import type { MiddlewareHandler } from '../../types'; +type TrimTrailingSlashOptions = { + /** + * If `true`, the middleware will always redirect requests with a trailing slash + * before executing handlers. + * This is useful for routes with wildcards (`*`). + * If `false` (default), it will only redirect when the route is not found (404). + * @default false + */ + alwaysRedirect?: boolean; +}; +/** + * Trailing Slash Middleware for Hono. + * + * @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash} + * + * @param {TrimTrailingSlashOptions} options - The options for the middleware. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use(trimTrailingSlash()) + * app.get('/about/me/', (c) => c.text('With Trailing Slash')) + * ``` + * + * @example + * ```ts + * // With alwaysRedirect option for wildcard routes + * const app = new Hono() + * + * app.use(trimTrailingSlash({ alwaysRedirect: true })) + * app.get('/my-path/*', (c) => c.text('Wildcard route')) + * ``` + */ +export declare const trimTrailingSlash: (options?: TrimTrailingSlashOptions) => MiddlewareHandler; +type AppendTrailingSlashOptions = { + /** + * If `true`, the middleware will always redirect requests without a trailing slash + * before executing handlers. + * This is useful for routes with wildcards (`*`). + * If `false` (default), it will only redirect when the route is not found (404). + * @default false + */ + alwaysRedirect?: boolean; + /** + * A function that determines whether to skip the redirect for a given path. + * If the function returns `true`, the redirect will be skipped. + * @param path - The request path + * @returns `true` to skip the redirect + * + * @example + * ```ts + * // Skip redirect for paths with file extensions + * app.use(appendTrailingSlash({ + * alwaysRedirect: true, + * skip: (path) => /\.\w+$/.test(path), + * })) + * ``` + */ + skip?: (path: string) => boolean; +}; +/** + * Append trailing slash middleware for Hono. + * Append a trailing slash to the URL if it doesn't have one. For example, `/path/to/page` will be redirected to `/path/to/page/`. + * + * @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash} + * + * @param {AppendTrailingSlashOptions} options - The options for the middleware. + * @returns {MiddlewareHandler} The middleware handler function. + * + * @example + * ```ts + * const app = new Hono() + * + * app.use(appendTrailingSlash()) + * ``` + * + * @example + * ```ts + * // With alwaysRedirect option for wildcard routes + * const app = new Hono() + * + * app.use(appendTrailingSlash({ alwaysRedirect: true })) + * app.get('/my-path/*', (c) => c.text('Wildcard route')) + * ``` + */ +export declare const appendTrailingSlash: (options?: AppendTrailingSlashOptions) => MiddlewareHandler; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/package.json b/tools/ui/node_modules/hono/dist/types/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/hono/dist/types/preset/quick.d.ts b/tools/ui/node_modules/hono/dist/types/preset/quick.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d53dea3a31b65ae372791338c73f5f8ed05306c5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/preset/quick.d.ts @@ -0,0 +1,10 @@ +/** + * @module + * The preset that uses `LinearRouter`. + */ +import { HonoBase } from '../hono-base'; +import type { HonoOptions } from '../hono-base'; +import type { BlankEnv, BlankSchema, Env, Schema } from '../types'; +export declare class Hono extends HonoBase { + constructor(options?: HonoOptions); +} diff --git a/tools/ui/node_modules/hono/dist/types/preset/tiny.d.ts b/tools/ui/node_modules/hono/dist/types/preset/tiny.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f75f72589d648c4e0c761125c4a1a96ea56b6a2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/preset/tiny.d.ts @@ -0,0 +1,10 @@ +/** + * @module + * The preset that uses `PatternRouter`. + */ +import { HonoBase } from '../hono-base'; +import type { HonoOptions } from '../hono-base'; +import type { BlankEnv, BlankSchema, Env, Schema } from '../types'; +export declare class Hono extends HonoBase { + constructor(options?: HonoOptions); +} diff --git a/tools/ui/node_modules/hono/dist/types/request.d.ts b/tools/ui/node_modules/hono/dist/types/request.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a127e4b76c89d1ff37a1b4a4d1eb5a06fcec3891 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/request.d.ts @@ -0,0 +1,324 @@ +import { GET_MATCH_RESULT } from './request/constants'; +import type { Result } from './router'; +import type { Input, InputToDataByTarget, ParamKeyToRecord, ParamKeys, RemoveQuestion, RouterRoute, ValidationTargets } from './types'; +import type { BodyData, ParseBodyOptions } from './utils/body'; +import type { CustomHeader, RequestHeader } from './utils/headers'; +import type { Simplify, UnionToIntersection } from './utils/types'; +type Body = { + json: any; + text: string; + arrayBuffer: ArrayBuffer; + blob: Blob; + formData: FormData; +}; +type BodyCache = Partial; +export declare class HonoRequest

{ + + /** + * `.raw` can get the raw Request object. + * + * @see {@link https://hono.dev/docs/api/request#raw} + * + * @example + * ```ts + * // For Cloudflare Workers + * app.post('/', async (c) => { + * const metadata = c.req.raw.cf?.hostMetadata? + * ... + * }) + * ``` + */ + raw: Request; + routeIndex: number; + /** + * `.path` can get the pathname of the request. + * + * @see {@link https://hono.dev/docs/api/request#path} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const pathname = c.req.path // `/about/me` + * }) + * ``` + */ + path: string; + bodyCache: BodyCache; + constructor(request: Request, path?: string, matchResult?: Result<[unknown, RouterRoute]>); + /** + * `.req.param()` gets the path parameters. + * + * @see {@link https://hono.dev/docs/api/routing#path-parameter} + * + * @example + * ```ts + * const name = c.req.param('name') + * // or all parameters at once + * const { id, comment_id } = c.req.param() + * ``` + */ + param = ParamKeys

>(key: string extends P ? never : P2 extends `${infer _}?` ? never : P2): string; + param> = RemoveQuestion>>(key: P2): string | undefined; + param(key: string): string | undefined; + param(): Simplify>>>; + /** + * `.query()` can get querystring parameters. + * + * @see {@link https://hono.dev/docs/api/request#query} + * + * @example + * ```ts + * // Query params + * app.get('/search', (c) => { + * const query = c.req.query('q') + * }) + * + * // Get all params at once + * app.get('/search', (c) => { + * const { q, limit, offset } = c.req.query() + * }) + * ``` + */ + query(key: string): string | undefined; + query(): Record; + /** + * `.queries()` can get multiple querystring parameter values, e.g. /search?tags=A&tags=B + * + * @see {@link https://hono.dev/docs/api/request#queries} + * + * @example + * ```ts + * app.get('/search', (c) => { + * // tags will be string[] + * const tags = c.req.queries('tags') + * }) + * ``` + */ + queries(key: string): string[] | undefined; + queries(): Record; + /** + * `.header()` can get the request header value. + * + * @see {@link https://hono.dev/docs/api/request#header} + * + * @example + * ```ts + * app.get('/', (c) => { + * const userAgent = c.req.header('User-Agent') + * }) + * ``` + */ + header(name: RequestHeader): string | undefined; + header(name: string): string | undefined; + header(): Record; + /** + * `.parseBody()` can parse Request body of type `multipart/form-data` or `application/x-www-form-urlencoded` + * + * @see {@link https://hono.dev/docs/api/request#parsebody} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.parseBody() + * }) + * ``` + */ + parseBody, T extends BodyData>(options?: Options): Promise; + parseBody(options?: Partial): Promise; + /** + * `.json()` can parse Request body of type `application/json` + * + * @see {@link https://hono.dev/docs/api/request#json} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.json() + * }) + * ``` + */ + json(): Promise; + /** + * `.text()` can parse Request body of type `text/plain` + * + * @see {@link https://hono.dev/docs/api/request#text} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.text() + * }) + * ``` + */ + text(): Promise; + /** + * `.arrayBuffer()` parse Request body as an `ArrayBuffer` + * + * @see {@link https://hono.dev/docs/api/request#arraybuffer} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.arrayBuffer() + * }) + * ``` + */ + arrayBuffer(): Promise; + /** + * `.bytes()` parses the request body as a `Uint8Array`. + * + * @see {@link https://hono.dev/docs/api/request#bytes} + * + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.bytes() + * }) + * ``` + */ + bytes(): Promise; + /** + * Parses the request body as a `Blob`. + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.blob(); + * }); + * ``` + * @see https://hono.dev/docs/api/request#blob + */ + blob(): Promise; + /** + * Parses the request body as `FormData`. + * @example + * ```ts + * app.post('/entry', async (c) => { + * const body = await c.req.formData(); + * }); + * ``` + * @see https://hono.dev/docs/api/request#formdata + */ + formData(): Promise; + /** + * Adds validated data to the request. + * + * @param target - The target of the validation. + * @param data - The validated data to add. + */ + addValidatedData(target: keyof ValidationTargets, data: {}): void; + /** + * Gets validated data from the request. + * + * @param target - The target of the validation. + * @returns The validated data. + * + * @see https://hono.dev/docs/api/request#valid + */ + valid(target: T): InputToDataByTarget; + /** + * `.url()` can get the request url strings. + * + * @see {@link https://hono.dev/docs/api/request#url} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const url = c.req.url // `http://localhost:8787/about/me` + * ... + * }) + * ``` + */ + get url(): string; + /** + * `.method()` can get the method name of the request. + * + * @see {@link https://hono.dev/docs/api/request#method} + * + * @example + * ```ts + * app.get('/about/me', (c) => { + * const method = c.req.method // `GET` + * }) + * ``` + */ + get method(): string; + get [GET_MATCH_RESULT](): Result<[unknown, RouterRoute]>; + /** + * `.matchedRoutes()` can return a matched route in the handler + * + * @deprecated + * + * Use matchedRoutes helper defined in "hono/route" instead. + * + * @see {@link https://hono.dev/docs/api/request#matchedroutes} + * + * @example + * ```ts + * app.use('*', async function logger(c, next) { + * await next() + * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { + * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') + * console.log( + * method, + * ' ', + * path, + * ' '.repeat(Math.max(10 - path.length, 0)), + * name, + * i === c.req.routeIndex ? '<- respond from here' : '' + * ) + * }) + * }) + * ``` + */ + get matchedRoutes(): RouterRoute[]; + /** + * `routePath()` can retrieve the path registered within the handler + * + * @deprecated + * + * Use routePath helper defined in "hono/route" instead. + * + * @see {@link https://hono.dev/docs/api/request#routepath} + * + * @example + * ```ts + * app.get('/posts/:id', (c) => { + * return c.json({ path: c.req.routePath }) + * }) + * ``` + */ + get routePath(): string; +} +/** + * Clones a HonoRequest's underlying raw Request object. + * + * This utility handles both consumed and unconsumed request bodies: + * - If the request body hasn't been consumed, it uses the native `clone()` method + * - If the request body has been consumed, it reconstructs a new Request using cached body data + * + * This is particularly useful when you need to: + * - Process the same request body multiple times + * - Pass requests to external services after validation + * + * @param req - The HonoRequest object to clone + * @returns A Promise that resolves to a new Request object with the same properties + * @throws {HTTPException} If the request body was consumed directly via `req.raw` + * without using HonoRequest methods (e.g., `req.json()`, `req.text()`), making it + * impossible to reconstruct the body from cache + * + * @example + * ```ts + * // Clone after consuming the body (e.g., after validation) + * app.post('/forward', + * validator('json', (data) => data), + * async (c) => { + * const validated = c.req.valid('json') + * // Body has been consumed, but cloneRawRequest still works + * const clonedReq = await cloneRawRequest(c.req) + * return fetch('http://backend-service.com', clonedReq) + * } + * ) + * ``` + */ +export declare const cloneRawRequest: (req: HonoRequest) => Promise; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/request/constants.d.ts b/tools/ui/node_modules/hono/dist/types/request/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1317d56e5282f4e4753f01ec706d6df31b0bfd0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/request/constants.d.ts @@ -0,0 +1 @@ +export declare const GET_MATCH_RESULT: unique symbol; diff --git a/tools/ui/node_modules/hono/dist/types/router.d.ts b/tools/ui/node_modules/hono/dist/types/router.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a92687bebe28af6a232e0722bc03fc0287a76905 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router.d.ts @@ -0,0 +1,97 @@ +/** + * @module + * This module provides types definitions and variables for the routers. + */ +/** + * Constant representing all HTTP methods in uppercase. + */ +export declare const METHOD_NAME_ALL: "ALL"; +/** + * Constant representing all HTTP methods in lowercase. + */ +export declare const METHOD_NAME_ALL_LOWERCASE: "all"; +/** + * Array of supported HTTP methods. + */ +export declare const METHODS: readonly ["get", "post", "put", "delete", "options", "patch", "query"]; +/** + * Error message indicating that a route cannot be added because the matcher is already built. + */ +export declare const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built."; +/** + * Interface representing a router. + * + * @template T - The type of the handler. + */ +export interface Router { + /** + * The name of the router. + */ + name: string; + /** + * Adds a route to the router. + * + * @param method - The HTTP method (e.g., 'get', 'post'). + * @param path - The path for the route. + * @param handler - The handler for the route. + */ + add(method: string, path: string, handler: T): void; + /** + * Matches a route based on the given method and path. + * + * @param method - The HTTP method (e.g., 'get', 'post'). + * @param path - The path to match. + * @returns The result of the match. + */ + match(method: string, path: string): Result; +} +/** + * Type representing a map of parameter indices. + */ +export type ParamIndexMap = Record; +/** + * Type representing a stash of parameters. + */ +export type ParamStash = string[]; +/** + * Type representing a map of parameters. + */ +export type Params = Record; +/** + * Type representing the result of a route match. + * + * The result can be in one of two formats: + * 1. An array of handlers with their corresponding parameter index maps, followed by a parameter stash. + * 2. An array of handlers with their corresponding parameter maps. + * + * Example: + * + * [[handler, paramIndexMap][], paramArray] + * ```typescript + * [ + * [ + * [middlewareA, {}], // '*' + * [funcA, {'id': 0}], // '/user/:id/*' + * [funcB, {'id': 0, 'action': 1}], // '/user/:id/:action' + * ], + * ['123', 'abc'] + * ] + * ``` + * + * [[handler, params][]] + * ```typescript + * [ + * [ + * [middlewareA, {}], // '*' + * [funcA, {'id': '123'}], // '/user/:id/*' + * [funcB, {'id': '123', 'action': 'abc'}], // '/user/:id/:action' + * ] + * ] + * ``` + */ +export type Result = [[T, ParamIndexMap][], ParamStash] | [[T, Params][]]; +/** + * Error class representing an unsupported path error. + */ +export declare class UnsupportedPathError extends Error { +} diff --git a/tools/ui/node_modules/hono/dist/types/router/linear-router/index.d.ts b/tools/ui/node_modules/hono/dist/types/router/linear-router/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..899f66e1136a81229b8456308473e91939b7199b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/linear-router/index.d.ts @@ -0,0 +1,5 @@ +/** + * @module + * LinearRouter for Hono. + */ +export { LinearRouter } from './router'; diff --git a/tools/ui/node_modules/hono/dist/types/router/linear-router/router.d.ts b/tools/ui/node_modules/hono/dist/types/router/linear-router/router.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..45d563a153e826671e3590c6ff7c4c3fae027ac6 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/linear-router/router.d.ts @@ -0,0 +1,7 @@ +import type { Result, Router } from '../../router'; +export declare class LinearRouter implements Router { + + name: string; + add(method: string, path: string, handler: T): void; + match(method: string, path: string): Result; +} diff --git a/tools/ui/node_modules/hono/dist/types/router/pattern-router/index.d.ts b/tools/ui/node_modules/hono/dist/types/router/pattern-router/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26f9f235ea69ff3646d3d1cfb55ff51c141fce17 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/pattern-router/index.d.ts @@ -0,0 +1,5 @@ +/** + * @module + * PatternRouter for Hono. + */ +export { PatternRouter } from './router'; diff --git a/tools/ui/node_modules/hono/dist/types/router/pattern-router/router.d.ts b/tools/ui/node_modules/hono/dist/types/router/pattern-router/router.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..299811dd5f66342a20432a581415b2e9ac9b65a7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/pattern-router/router.d.ts @@ -0,0 +1,7 @@ +import type { Result, Router } from '../../router'; +export declare class PatternRouter implements Router { + + name: string; + add(method: string, path: string, handler: T): void; + match(method: string, path: string): Result; +} diff --git a/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..25c2363ca318869eee6b877a8c7bf875cf0824f2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts @@ -0,0 +1,6 @@ +/** + * @module + * RegExpRouter for Hono. + */ +export { RegExpRouter } from './router'; +export { PreparedRegExpRouter, buildInitParams, serializeInitParams } from './prepared-router'; diff --git a/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..721ec4bd7f6d6b462ff9488d154d738bd2c07101 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts @@ -0,0 +1,7 @@ +import type { ParamIndexMap, Result, Router } from '../../router'; +export type HandlerData = [T, ParamIndexMap][]; +export type StaticMap = Record>; +export type Matcher = [RegExp, HandlerData[], StaticMap]; +export type MatcherMap = Record | null>; +export declare const emptyParam: string[]; +export declare function match, T>(this: R, method: string, path: string): Result; diff --git a/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f34d1780f82a2bde1e60773668412258149ec168 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts @@ -0,0 +1,10 @@ +export declare const PATH_ERROR: unique symbol; +export type ParamAssocArray = [string, number][]; +export interface Context { + varIndex: number; +} +export declare class Node { + + insert(tokens: readonly string[], index: number, paramMap: ParamAssocArray, context: Context, isStatic: boolean): void; + buildRegExpStr(): string; +} diff --git a/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de9f39e92f993429a1279241ea4569f2d733c671 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts @@ -0,0 +1,17 @@ +import type { ParamIndexMap, Router } from '../../router'; +import type { MatcherMap } from './matcher'; +import { match } from './matcher'; +type RelocateMap = Record; +export declare class PreparedRegExpRouter implements Router { + + name: string; + constructor(matchers: MatcherMap, relocateMap: RelocateMap); + add(method: string, path: string, handler: T): void; + protected buildAllMatchers(): MatcherMap; + match: typeof match, T>; +} +export declare const buildInitParams: (params: { + paths: string[]; +}) => ConstructorParameters; +export declare const serializeInitParams: (params: ConstructorParameters) => string; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fda1ebb2f62b3d835489074b94d0bc0c0bb54d04 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts @@ -0,0 +1,11 @@ +import type { Router } from '../../router'; +import type { MatcherMap } from './matcher'; +import { match } from './matcher'; +export declare class RegExpRouter implements Router { + + name: string; + constructor(); + add(method: string, path: string, handler: T): void; + match: typeof match, T>; + protected buildAllMatchers(): MatcherMap; +} diff --git a/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..04c0c5dceb823c057868aee78d2135edc8eba887 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts @@ -0,0 +1,8 @@ +import type { ParamAssocArray } from './node'; +export type ReplacementMap = number[]; +export declare class Trie { + + paths: Record; + insert(path: string, isStatic: boolean): void; + buildRegExp(): [RegExp, ReplacementMap, ReplacementMap]; +} diff --git a/tools/ui/node_modules/hono/dist/types/router/smart-router/index.d.ts b/tools/ui/node_modules/hono/dist/types/router/smart-router/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7801b8e4d049a11f3264445e3ab1befd14969b4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/smart-router/index.d.ts @@ -0,0 +1,5 @@ +/** + * @module + * SmartRouter for Hono. + */ +export { SmartRouter } from './router'; diff --git a/tools/ui/node_modules/hono/dist/types/router/smart-router/router.d.ts b/tools/ui/node_modules/hono/dist/types/router/smart-router/router.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94a4de31adbfd6dfd1dc137bd07d700ee315831d --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/smart-router/router.d.ts @@ -0,0 +1,11 @@ +import type { Result, Router } from '../../router'; +export declare class SmartRouter implements Router { + + name: string; + constructor(init: { + routers: Router[]; + }); + add(method: string, path: string, handler: T): void; + match(method: string, path: string): Result; + get activeRouter(): Router; +} diff --git a/tools/ui/node_modules/hono/dist/types/router/trie-router/index.d.ts b/tools/ui/node_modules/hono/dist/types/router/trie-router/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..44ace76e7e53ea526cd9e439f4fe6306f9e052ac --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/trie-router/index.d.ts @@ -0,0 +1,5 @@ +/** + * @module + * TrieRouter for Hono. + */ +export { TrieRouter } from './router'; diff --git a/tools/ui/node_modules/hono/dist/types/router/trie-router/node.d.ts b/tools/ui/node_modules/hono/dist/types/router/trie-router/node.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..81b9cc51e7caea8861f0c27d8e61fdd7f4561949 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/trie-router/node.d.ts @@ -0,0 +1,7 @@ +import type { Params } from '../../router'; +export declare class Node { + + constructor(method?: string, handler?: T, children?: Record>); + insert(method: string, path: string, handler: T): Node; + search(method: string, path: string): [[T, Params][]]; +} diff --git a/tools/ui/node_modules/hono/dist/types/router/trie-router/router.d.ts b/tools/ui/node_modules/hono/dist/types/router/trie-router/router.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..50990dbbe159b6ca2c14f3a08ab5485fd318f365 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/router/trie-router/router.d.ts @@ -0,0 +1,8 @@ +import type { Result, Router } from '../../router'; +export declare class TrieRouter implements Router { + + name: string; + constructor(); + add(method: string, path: string, handler: T): void; + match(method: string, path: string): Result; +} diff --git a/tools/ui/node_modules/hono/dist/types/types.d.ts b/tools/ui/node_modules/hono/dist/types/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe5e8073cbcda1229fec485aac53a011f0a23dd0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/types.d.ts @@ -0,0 +1,573 @@ +/** + * @module + * This module contains some type definitions for the Hono modules. + */ +import type { Context } from './context'; +import type { HonoBase } from './hono-base'; +import type { CustomHeader, RequestHeader } from './utils/headers'; +import type { StatusCode } from './utils/http-status'; +import type { IfAnyThenEmptyObject, IsAny, JSONValue, RemoveBlankRecord, Simplify, UnionToIntersection } from './utils/types'; +export type Bindings = object; +export type Variables = object; +export type BlankEnv = {}; +export type Env = { + Bindings?: Bindings; + Variables?: Variables; +}; +export type Next = () => Promise; +export type ExtractInput = I extends Input ? unknown extends I['in'] ? {} : I['in'] : I; +export type Input = { + in?: {}; + out?: {}; + outputFormat?: ResponseFormat; +}; +export type BlankSchema = {}; +export type BlankInput = {}; +export interface RouterRoute { + basePath: string; + path: string; + method: string; + handler: H; +} +export type HandlerResponse = Response | TypedResponse | Promise> | Promise; +export type Handler = any> = (c: Context, next: Next) => R; +export type MiddlewareHandler = Response> = (c: Context, next: Next) => Promise; +export type H = any> = Handler | MiddlewareHandler; +/** + * You can extend this interface to define a custom `c.notFound()` Response type. + * + * @example + * declare module 'hono' { + * interface NotFoundResponse extends Response, TypedResponse {} + * } + */ +export interface NotFoundResponse { +} +export type NotFoundHandler = (c: Context) => NotFoundResponse extends Response ? NotFoundResponse | Promise : Response | Promise; +export interface HTTPResponseError extends Error { + getResponse: () => Response; +} +export type ErrorHandler = (err: Error | HTTPResponseError, c: Context) => Response | Promise; +export interface HandlerInterface { +

= any, E2 extends Env = E>(handler: H): HonoBase, S & ToSchema>, BasePath, CurrentPath>; +

= any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(...handlers: [H & M1, H]): HonoBase, S & ToSchema | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(path: P, handler: H): HonoBase, S, M, P, I, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(...handlers: [H & M1, H & M2, H]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(path: P, ...handlers: [H & M1, H]): HonoBase | MergeMiddlewareResponse, S, M, P, I2, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(...handlers: [H & M1, H & M2, H & M3, H]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(path: P, ...handlers: [H & M1, H & M2, H]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I3, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H + ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H + ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I4, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H + ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H + ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I5, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H + ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H + ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I6, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H + ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H + ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I7, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H + ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H + ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I8, BasePath>, BasePath, MergePath>; +

= any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H & M9, + H + ]): HonoBase, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, CurrentPath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H + ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I9, BasePath>, BasePath, MergePath>; +

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H & M9, + H + ]): HonoBase | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse, S, M, P, I10, BasePath>, BasePath, MergePath>; +

= any>(...handlers: H[]): HonoBase>, BasePath, CurrentPath>; +

= any>(path: P, ...handlers: [H, I, R>, ...H, I, R>[]]): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; +

= any, I extends Input = BlankInput>(path: P): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; +} +export interface MiddlewareHandlerInterface { + (...handlers: MiddlewareHandler>[]): HonoBase, S, BasePath, MergePath>; + (handler: MiddlewareHandler>): HonoBase, S, BasePath, MergePath>; + , P extends string = MergePath>(...handlers: [MiddlewareHandler, MiddlewareHandler]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E>(path: P, handler: MiddlewareHandler): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(path: P, ...handlers: [MiddlewareHandler, MiddlewareHandler]): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(path: P, ...handlers: [MiddlewareHandler, MiddlewareHandler, MiddlewareHandler]): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(path: P, ...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(path: P, ...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(path: P, ...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(path: P, ...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(path: P, ...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, MergedPath>; + , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, P extends string = MergePath>(...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, P>; +

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(path: P, ...handlers: [ + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler, + MiddlewareHandler + ]): HonoBase, S, BasePath, MergedPath>; +

(path: P, ...handlers: MiddlewareHandler>[]): HonoBase>; +} +export interface OnHandlerInterface { + , R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(method: M, path: P, handler: H): HonoBase, S & ToSchema, I, MergeTypedResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(method: M, path: P, ...handlers: [H & M1, H]): HonoBase, S & ToSchema, I2, MergeTypedResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(method: M, path: P, ...handlers: [H & M1, H & M2, H]): HonoBase, S & ToSchema, I3, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(method: M, path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H + ]): HonoBase, S & ToSchema, I4, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(method: M, path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H + ]): HonoBase, S & ToSchema, I5, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(method: M, path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H + ]): HonoBase, S & ToSchema, I6, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(method: M, path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H + ]): HonoBase, S & ToSchema, I7, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(method: M, path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H + ]): HonoBase, S & ToSchema, I8, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(method: M, path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H + ]): HonoBase, S & ToSchema, I9, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(method: M, path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H & M9, + H + ]): HonoBase, S & ToSchema, I10, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + = any, I extends Input = BlankInput>(method: M, path: P, ...handlers: [H, I, R>, ...H, I, R>[]]): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(methods: M[], path: P, handler: H): HonoBase, S & ToSchema, I, MergeTypedResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(methods: M[], path: P, ...handlers: [H & M1, H]): HonoBase, S & ToSchema, I2, MergeTypedResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(methods: M[], path: P, ...handlers: [H & M1, H & M2, H]): HonoBase, S & ToSchema, I3, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(methods: M[], path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H + ]): HonoBase, S & ToSchema, I4, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(methods: M[], path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H + ]): HonoBase, S & ToSchema, I5, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(methods: M[], path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H + ]): HonoBase, S & ToSchema, I6, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(methods: M[], path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H + ]): HonoBase, S & ToSchema, I7, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(methods: M[], path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H + ]): HonoBase, S & ToSchema, I8, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(methods: M[], path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H + ]): HonoBase, S & ToSchema, I9, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(methods: M[], path: P, ...handlers: [ + H & M1, + H & M2, + H & M3, + H & M4, + H & M5, + H & M6, + H & M7, + H & M8, + H & M9, + H + ]): HonoBase, S & ToSchema, I10, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath, MergePath>; + = any, I extends Input = BlankInput>(methods: M[], path: P, ...handlers: [H, I, R>, ...H, I, R>[]]): HonoBase, I, MergeTypedResponse>, BasePath, MergePath>; + = any, E2 extends Env = E>(methods: M | M[], paths: Ps, ...handlers: H, I, R>[]): HonoBase, I, MergeTypedResponse>, BasePath, Ps extends [...string[], infer LastPath extends string] ? MergePath : never>; +} +type ToSchemaOutput = RorO extends TypedResponse ? { + output: unknown extends T ? {} : T; + outputFormat: I extends { + outputFormat: string; + } ? I['outputFormat'] : F; + status: U; +} : { + output: unknown extends RorO ? {} : RorO; + outputFormat: unknown extends RorO ? 'json' : I extends { + outputFormat: string; + } ? I['outputFormat'] : 'json'; + status: StatusCode; +}; +export type ToSchema = IsAny extends true ? { + [K in P]: { + [K2 in M as AddDollar]: { + input: AddParam, P>; + output: {}; + outputFormat: ResponseFormat; + status: StatusCode; + }; + }; +} : [RorO] extends [never] ? {} : [RorO] extends [Promise] ? {} : { + [K in P]: { + [K2 in M as AddDollar]: Simplify<{ + input: AddParam, P>; + } & ToSchemaOutput>; + }; +}; +export type Schema = { + [Path: string]: { + [Method: `$${Lowercase}`]: Endpoint; + }; +}; +type AddSchemaIfHasResponse = [Merged] extends [Promise] ? S : S & ToSchema, I, Merged>; +export type Endpoint = { + input: any; + output: any; + outputFormat: ResponseFormat; + status: StatusCode; +}; +type ExtractParams = string extends Path ? Record : Path extends `${infer _Start}:${infer Param}/${infer Rest}` ? { + [K in Param | keyof ExtractParams<`/${Rest}`>]: string; +} : Path extends `${infer _Start}:${infer Param}` ? { + [K in Param]: string; +} : never; +type FlattenIfIntersect = T extends infer O ? { + [K in keyof O]: O[K]; +} : never; +export type MergeSchemaPath = { + [P in keyof OrigSchema as MergePath]: [OrigSchema[P]] extends [ + Record + ] ? { + [M in keyof OrigSchema[P]]: MergeEndpointParamsWithPath; + } : never; +}; +type MergeEndpointParamsWithPath = T extends unknown ? { + input: T['input'] extends { + param: infer _; + } ? ExtractParams extends never ? T['input'] : FlattenIfIntersect as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string; + }; + }> : RemoveBlankRecord> extends never ? T['input'] : T['input'] & { + param: { + [K in keyof ExtractParams as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string; + }; + }; + output: T['output']; + outputFormat: T['outputFormat']; + status: T['status']; +} : never; +export type AddParam = ParamKeys

extends never ? I : I extends { + param: infer _; +} ? I : I & { + param: UnionToIntersection>>; +}; +type AddDollar = `$${Lowercase}`; +export type MergePath = B extends '' ? MergePath : A extends '' ? B : A extends '/' ? B : A extends `${infer P}/` ? B extends `/${infer Q}` ? `${P}/${Q}` : `${P}/${B}` : B extends `/${infer Q}` ? Q extends '' ? A : `${A}/${Q}` : `${A}/${B}`; +export type KnownResponseFormat = 'json' | 'text' | 'redirect'; +export type ResponseFormat = KnownResponseFormat | string; +export type TypedResponse = { + _data: T; + _status: U; + _format: F; +}; +type MergeTypedResponse = T extends Promise ? T : T extends Promise ? T2 extends TypedResponse ? T2 : TypedResponse : T extends TypedResponse ? T : TypedResponse; +type ExtractTypedResponseOnly = T extends TypedResponse ? T : never; +type MergeMiddlewareResponse = T extends (c: any, next: any) => Promise ? Exclude extends never ? never : Exclude extends Response | TypedResponse ? ExtractTypedResponseOnly> : never : T extends (c: any, next: any) => infer R ? R extends Response | TypedResponse ? ExtractTypedResponseOnly : never : never; +export type FormValue = string | Blob; +export type ParsedFormValue = string | File; +export type ValidationTargets = { + json: any; + form: Record; + query: Record; + param: Record; + header: Record; + cookie: Record; +}; +type ParamKey = Component extends `:${infer NameWithPattern}` ? NameWithPattern extends `${infer Name}{${infer Rest}` ? Rest extends `${infer _Pattern}?` ? `${Name}?` : Name : NameWithPattern : never; +export type ParamKeys = Path extends `${infer Component}/${infer Rest}` ? ParamKey | ParamKeys : ParamKey; +export type ParamKeyToRecord = T extends `${infer R}?` ? Record : { + [K in T]: string; +}; +export type InputToDataByTarget = T extends { + [K in Target]: infer R; +} ? R : never; +export type RemoveQuestion = T extends `${infer R}?` ? R : T; +export type ExtractSchema = UnionToIntersection ? S : never>; +export type ExtractSchemaForStatusCode = { + [Path in keyof ExtractSchema]: { + [Method in keyof ExtractSchema[Path]]: Extract[Path][Method], { + status: Status; + }>; + }; +}; +export type ExtractHandlerResponse = T extends (c: any, next: any) => Promise ? Exclude extends never ? never : Exclude extends Response | TypedResponse ? Exclude : never : T extends (c: any, next: any) => infer R ? R extends Response | TypedResponse ? R : never : never; +type ProcessHead = IfAnyThenEmptyObject; +export type IntersectNonAnyTypes = T extends [infer Head, ...infer Rest] ? ProcessHead & IntersectNonAnyTypes : {}; +export declare abstract class FetchEventLike { + abstract readonly request: Request; + abstract respondWith(promise: Response | Promise): void; + abstract passThroughOnException(): void; + abstract waitUntil(promise: Promise): void; +} +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/accept.d.ts b/tools/ui/node_modules/hono/dist/types/utils/accept.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..427817669f053821a0f2f64096345fa80e8628cd --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/accept.d.ts @@ -0,0 +1,6 @@ +export interface Accept { + type: string; + params: Record; + q: number; +} +export declare const parseAccept: (acceptHeader: string) => Accept[]; diff --git a/tools/ui/node_modules/hono/dist/types/utils/basic-auth.d.ts b/tools/ui/node_modules/hono/dist/types/utils/basic-auth.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4741a4eb16717f843ddf7205674152f43c362826 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/basic-auth.d.ts @@ -0,0 +1,5 @@ +export type Auth = (req: Request) => { + username: string; + password: string; +} | undefined; +export declare const auth: Auth; diff --git a/tools/ui/node_modules/hono/dist/types/utils/body.d.ts b/tools/ui/node_modules/hono/dist/types/utils/body.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e0ad8615e368985fb1f66d10a9823c7571ee2a9 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/body.d.ts @@ -0,0 +1,79 @@ +/** + * @module + * Body utility. + */ +import type { HonoRequest } from '../request'; +type BodyDataValueDot = { + [x: string]: string | File | BodyDataValueDot; +}; +type BodyDataValueDotAll = { + [x: string]: string | File | (string | File)[] | BodyDataValueDotAll; +}; +type SimplifyBodyData = { + [K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K] ? string | File | (string | File)[] | BodyDataValueDotAll : string | File | BodyDataValueDot extends T[K] ? string | File | BodyDataValueDot : string | File | (string | File)[] extends T[K] ? string | File | (string | File)[] : string | File; +} & {}; +type BodyDataValueComponent = string | File | (T extends { + all: false; +} ? never : T extends { + all: true; +} | { + all: boolean; +} ? (string | File)[] : never); +type BodyDataValueObject = { + [key: string]: BodyDataValueComponent | BodyDataValueObject; +}; +type BodyDataValue = BodyDataValueComponent | (T extends { + dot: false; +} ? never : T extends { + dot: true; +} | { + dot: boolean; +} ? BodyDataValueObject : never); +export type BodyData = {}> = SimplifyBodyData>>; +export type ParseBodyOptions = { + /** + * Determines whether all fields with multiple values should be parsed as arrays. + * @default false + * @example + * const data = new FormData() + * data.append('file', 'aaa') + * data.append('file', 'bbb') + * data.append('message', 'hello') + * + * If all is false: + * parseBody should return { file: 'bbb', message: 'hello' } + * + * If all is true: + * parseBody should return { file: ['aaa', 'bbb'], message: 'hello' } + */ + all: boolean; + /** + * Determines whether all fields with dot notation should be parsed as nested objects. + * @default false + * @example + * const data = new FormData() + * data.append('obj.key1', 'value1') + * data.append('obj.key2', 'value2') + * + * If dot is false: + * parseBody should return { 'obj.key1': 'value1', 'obj.key2': 'value2' } + * + * If dot is true: + * parseBody should return { obj: { key1: 'value1', key2: 'value2' } } + */ + dot: boolean; +}; +/** + * Parses the body of a request based on the provided options. + * + * @template T - The type of the parsed body data. + * @param {HonoRequest | Request} request - The request object to parse. + * @param {Partial} [options] - Options for parsing the body. + * @returns {Promise} The parsed body data. + */ +interface ParseBody { + , T extends BodyData>(request: HonoRequest | Request, options?: Options): Promise; + (request: HonoRequest | Request, options?: Partial): Promise; +} +export declare const parseBody: ParseBody; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/buffer.d.ts b/tools/ui/node_modules/hono/dist/types/utils/buffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f662d201dbf3d20cafb24254c88234e1e9ac8964 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/buffer.d.ts @@ -0,0 +1,17 @@ +/** + * @module + * Buffer utility. + */ +export declare const equal: (a: ArrayBuffer, b: ArrayBuffer) => boolean; +type StringHashFunction = (input: string) => string | null | Promise; +type TimingSafeEqual = { + (a: string, b: string, hashFunction?: StringHashFunction): Promise; + /** + * @deprecated object and boolean signatures that take boolean as first and second arguments, and functions with signatures that take non-string arguments have been deprecated + */ + (a: string | object | boolean, b: string | object | boolean, hashFunction?: Function): Promise; +}; +export declare const timingSafeEqual: TimingSafeEqual; +export declare const bufferToString: (buffer: ArrayBuffer) => string; +export declare const bufferToFormData: (arrayBuffer: ArrayBuffer, contentType: string) => Promise; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/color.d.ts b/tools/ui/node_modules/hono/dist/types/utils/color.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f57d73980aeba7d42fea82c5e5d039f80483e159 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/color.d.ts @@ -0,0 +1,21 @@ +/** + * @module + * Color utility. + */ +/** + * Get whether color change on terminal is enabled or disabled. + * If `NO_COLOR` environment variable is set, this function returns `false`. + * Unlike getColorEnabledAsync(), this cannot check Cloudflare environment variables. + * @see {@link https://no-color.org/} + * + * @returns {boolean} + */ +export declare function getColorEnabled(): boolean; +/** + * Get whether color change on terminal is enabled or disabled. + * If `NO_COLOR` environment variable is set, this function returns `false`. + * @see {@link https://no-color.org/} + * + * @returns {boolean} + */ +export declare function getColorEnabledAsync(): Promise; diff --git a/tools/ui/node_modules/hono/dist/types/utils/compress.d.ts b/tools/ui/node_modules/hono/dist/types/utils/compress.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..01666b8ac7447071f46f52ff0ae1ec9009eed639 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/compress.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * Constants for compression. + */ +/** + * Match for compressible content type. + */ +export declare const COMPRESSIBLE_CONTENT_TYPE_REGEX: RegExp; diff --git a/tools/ui/node_modules/hono/dist/types/utils/concurrent.d.ts b/tools/ui/node_modules/hono/dist/types/utils/concurrent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..24abe69e4408d2e4043a0a6a426ffd80418f9f18 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/concurrent.d.ts @@ -0,0 +1,11 @@ +/** + * @module + * Concurrent utility. + */ +export interface Pool { + run(fn: () => T): Promise; +} +export declare const createPool: ({ concurrency, interval, }?: { + concurrency?: number; + interval?: number; +}) => Pool; diff --git a/tools/ui/node_modules/hono/dist/types/utils/constants.d.ts b/tools/ui/node_modules/hono/dist/types/utils/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..733c0efe8f0f1ad886b53de999e4741981fda084 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/constants.d.ts @@ -0,0 +1,4 @@ +/** + * Constant used to mark a composed handler. + */ +export declare const COMPOSED_HANDLER = "__COMPOSED_HANDLER"; diff --git a/tools/ui/node_modules/hono/dist/types/utils/cookie.d.ts b/tools/ui/node_modules/hono/dist/types/utils/cookie.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6f75f9646b042d3f14f898926cfc2dff787afbc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/cookie.d.ts @@ -0,0 +1,40 @@ +/** + * @module + * Cookie utility. + */ +export type Cookie = Record; +export type SignedCookie = Record; +type PartitionedCookieConstraint = { + partitioned: true; + secure: true; +} | { + partitioned?: boolean; + secure?: boolean; +}; +type SecureCookieConstraint = { + secure: true; +}; +type HostCookieConstraint = { + secure: true; + path: '/'; + domain?: undefined; +}; +export type CookieOptions = { + domain?: string; + expires?: Date; + httpOnly?: boolean; + maxAge?: number; + path?: string; + secure?: boolean; + sameSite?: 'Strict' | 'Lax' | 'None' | 'strict' | 'lax' | 'none'; + partitioned?: boolean; + priority?: 'Low' | 'Medium' | 'High' | 'low' | 'medium' | 'high'; + prefix?: CookiePrefixOptions; +} & PartitionedCookieConstraint; +export type CookiePrefixOptions = 'host' | 'secure'; +export type CookieConstraint = Name extends `__Secure-${string}` ? CookieOptions & SecureCookieConstraint : Name extends `__Host-${string}` ? CookieOptions & HostCookieConstraint : CookieOptions; +export declare const parse: (cookie: string, name?: string) => Cookie; +export declare const parseSigned: (cookie: string, secret: string | BufferSource, name?: string) => Promise; +export declare const serialize: (name: Name, value: string, opt?: CookieConstraint) => string; +export declare const serializeSigned: (name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/crypto.d.ts b/tools/ui/node_modules/hono/dist/types/utils/crypto.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5974286022420f3ddd8abe9612fb5674bfb6ffcb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/crypto.d.ts @@ -0,0 +1,15 @@ +/** + * @module + * Crypto utility. + */ +import type { JSONValue } from './types'; +type Algorithm = { + name: string; + alias: string; +}; +type Data = string | boolean | number | JSONValue | ArrayBufferView | ArrayBuffer; +export declare const sha256: (data: Data) => Promise; +export declare const sha1: (data: Data) => Promise; +export declare const md5: (data: Data) => Promise; +export declare const createHash: (data: Data, algorithm: Algorithm) => Promise; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/encode.d.ts b/tools/ui/node_modules/hono/dist/types/utils/encode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c60d6e79eda2eb05cb4ab465387497e19224ceeb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/encode.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * Encode utility. + */ +export declare const decodeBase64Url: (str: string) => Uint8Array; +export declare const encodeBase64Url: (buf: ArrayBufferLike) => string; +export declare const encodeBase64: (buf: ArrayBufferLike) => string; +export declare const decodeBase64: (str: string) => Uint8Array; diff --git a/tools/ui/node_modules/hono/dist/types/utils/filepath.d.ts b/tools/ui/node_modules/hono/dist/types/utils/filepath.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b2669254013c5990dc1f6390d13e1648dd8e6b86 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/filepath.d.ts @@ -0,0 +1,12 @@ +/** + * @module + * FilePath utility. + */ +type FilePathOptions = { + filename: string; + root?: string; + defaultDocument?: string; +}; +export declare const getFilePath: (options: FilePathOptions) => string | undefined; +export declare const getFilePathWithoutDefaultDocument: (options: Omit) => string | undefined; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/handler.d.ts b/tools/ui/node_modules/hono/dist/types/utils/handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b593c5a67ed613d469bb885f53b1c67264c384a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/handler.d.ts @@ -0,0 +1,6 @@ +/** + * @module + * Handler utility. + */ +export declare const isMiddleware: (handler: Function) => boolean; +export declare const findTargetHandler: (handler: Function) => Function; diff --git a/tools/ui/node_modules/hono/dist/types/utils/headers.d.ts b/tools/ui/node_modules/hono/dist/types/utils/headers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e69534a1f62324beb21b5967c7058da6f46608e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/headers.d.ts @@ -0,0 +1,8 @@ +/** + * @module + * HTTP Headers utility. + */ +export type RequestHeader = 'A-IM' | 'Accept' | 'Accept-Additions' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Datetime' | 'Accept-Encoding' | 'Accept-Features' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Query' | 'Accept-Ranges' | 'Accept-Signature' | 'Access-Control' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Activate-Storage-Access' | 'Age' | 'Allow' | 'ALPN' | 'Alt-Svc' | 'Alt-Used' | 'Alternates' | 'AMP-Cache-Transform' | 'Apply-To-Redirect-Ref' | 'Authentication-Control' | 'Authentication-Info' | 'Authorization' | 'Available-Dictionary' | 'C-Ext' | 'C-Man' | 'C-Opt' | 'C-PEP' | 'C-PEP-Info' | 'Cache-Control' | 'Cache-Group-Invalidation' | 'Cache-Groups' | 'Cache-Status' | 'Cal-Managed-ID' | 'CalDAV-Timezones' | 'Capsule-Protocol' | 'CDN-Cache-Control' | 'CDN-Loop' | 'Cert-Not-After' | 'Cert-Not-Before' | 'Clear-Site-Data' | 'Client-Cert' | 'Client-Cert-Chain' | 'Close' | 'CMCD-Object' | 'CMCD-Request' | 'CMCD-Session' | 'CMCD-Status' | 'CMSD-Dynamic' | 'CMSD-Static' | 'Concealed-Auth-Export' | 'Configuration-Context' | 'Connection' | 'Content-Base' | 'Content-Digest' | 'Content-Disposition' | 'Content-Encoding' | 'Content-ID' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-MD5' | 'Content-Range' | 'Content-Script-Type' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Style-Type' | 'Content-Type' | 'Content-Version' | 'Cookie' | 'Cookie2' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Embedder-Policy-Report-Only' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Opener-Policy-Report-Only' | 'Cross-Origin-Resource-Policy' | 'CTA-Common-Access-Token' | 'DASL' | 'Date' | 'DAV' | 'Default-Style' | 'Delta-Base' | 'Deprecation' | 'Depth' | 'Derived-From' | 'Destination' | 'Detached-JWS' | 'Differential-ID' | 'Dictionary-ID' | 'Digest' | 'DPoP' | 'DPoP-Nonce' | 'Early-Data' | 'EDIINT-Features' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Ext' | 'Forwarded' | 'From' | 'GetProfile' | 'Hobareg' | 'Host' | 'HTTP2-Settings' | 'If' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Schedule-Tag-Match' | 'If-Unmodified-Since' | 'IM' | 'Include-Referred-Token-Binding-ID' | 'Incremental' | 'Isolation' | 'Keep-Alive' | 'Label' | 'Last-Event-ID' | 'Last-Modified' | 'Link' | 'Link-Template' | 'Location' | 'Lock-Token' | 'Man' | 'Max-Forwards' | 'Memento-Datetime' | 'Meter' | 'Method-Check' | 'Method-Check-Expires' | 'MIME-Version' | 'Negotiate' | 'NEL' | 'OData-EntityId' | 'OData-Isolation' | 'OData-MaxVersion' | 'OData-Version' | 'Opt' | 'Optional-WWW-Authenticate' | 'Ordering-Type' | 'Origin' | 'Origin-Agent-Cluster' | 'OSCORE' | 'OSLC-Core-Version' | 'Overwrite' | 'P3P' | 'PEP' | 'PEP-Info' | 'Permissions-Policy' | 'PICS-Label' | 'Ping-From' | 'Ping-To' | 'Position' | 'Pragma' | 'Prefer' | 'Preference-Applied' | 'Priority' | 'ProfileObject' | 'Protocol' | 'Protocol-Info' | 'Protocol-Query' | 'Protocol-Request' | 'Proxy-Authenticate' | 'Proxy-Authentication-Info' | 'Proxy-Authorization' | 'Proxy-Features' | 'Proxy-Instruction' | 'Proxy-Status' | 'Public' | 'Public-Key-Pins' | 'Public-Key-Pins-Report-Only' | 'Range' | 'Redirect-Ref' | 'Referer' | 'Referer-Root' | 'Referrer-Policy' | 'Refresh' | 'Repeatability-Client-ID' | 'Repeatability-First-Sent' | 'Repeatability-Request-ID' | 'Repeatability-Result' | 'Replay-Nonce' | 'Reporting-Endpoints' | 'Repr-Digest' | 'Retry-After' | 'Safe' | 'Schedule-Reply' | 'Schedule-Tag' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-Storage-Access' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Sec-Purpose' | 'Sec-Token-Binding' | 'Sec-WebSocket-Accept' | 'Sec-WebSocket-Extensions' | 'Sec-WebSocket-Key' | 'Sec-WebSocket-Protocol' | 'Sec-WebSocket-Version' | 'Security-Scheme' | 'Server' | 'Server-Timing' | 'Set-Cookie' | 'Set-Cookie2' | 'Set-Txn' | 'SetProfile' | 'Signature' | 'Signature-Input' | 'SLUG' | 'SoapAction' | 'Status-URI' | 'Strict-Transport-Security' | 'Sunset' | 'Surrogate-Capability' | 'Surrogate-Control' | 'TCN' | 'TE' | 'Timeout' | 'Timing-Allow-Origin' | 'Topic' | 'Traceparent' | 'Tracestate' | 'Trailer' | 'Transfer-Encoding' | 'TTL' | 'Unencoded-Digest' | 'Upgrade' | 'Urgency' | 'URI' | 'Use-As-Dictionary' | 'User-Agent' | 'Variant-Vary' | 'Vary' | 'Via' | 'Want-Content-Digest' | 'Want-Digest' | 'Want-Repr-Digest' | 'Want-Unencoded-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options'; +export type ResponseHeader = 'Accept-Query' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Activate-Storage-Access' | 'Age' | 'Allow' | 'Cache-Control' | 'Cache-Group-Invalidation' | 'Cache-Groups' | 'Clear-Site-Data' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'ETag' | 'Expires' | 'Incremental' | 'Last-Modified' | 'Location' | 'Permissions-Policy' | 'Pragma' | 'Retry-After' | 'Save-Data' | 'Sec-CH-Prefers-Color-Scheme' | 'Sec-CH-Prefers-Reduced-Motion' | 'Sec-CH-UA' | 'Sec-CH-UA-Arch' | 'Sec-CH-UA-Bitness' | 'Sec-CH-UA-Form-Factor' | 'Sec-CH-UA-Full-Version' | 'Sec-CH-UA-Full-Version-List' | 'Sec-CH-UA-Mobile' | 'Sec-CH-UA-Model' | 'Sec-CH-UA-Platform' | 'Sec-CH-UA-Platform-Version' | 'Sec-CH-UA-WoW64' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'Set-Txn' | 'Strict-Transport-Security' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Unencoded-Digest' | 'Upgrade' | 'Vary' | 'Want-Unencoded-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-DNS-Prefetch-Control' | 'X-Frame-Options' | 'X-Permitted-Cross-Domain-Policies' | 'X-Powered-By' | 'X-Robots-Tag' | 'X-XSS-Protection'; +export type AcceptHeader = 'Accept' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges'; +export type CustomHeader = string & {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/html.d.ts b/tools/ui/node_modules/hono/dist/types/utils/html.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..35475cb60c8e82369d9631f1d38931d9d1f34c35 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/html.d.ts @@ -0,0 +1,44 @@ +/** + * @module + * HTML utility. + */ +export declare const HtmlEscapedCallbackPhase: { + readonly Stringify: 1; + readonly BeforeStream: 2; + readonly Stream: 3; +}; +type HtmlEscapedCallbackOpts = { + buffer?: [string]; + phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase]; + context: Readonly; +}; +export type HtmlEscapedCallback = (opts: HtmlEscapedCallbackOpts) => Promise | undefined; +export type HtmlEscaped = { + isEscaped: true; + callbacks?: HtmlEscapedCallback[]; +}; +export type HtmlEscapedString = string & HtmlEscaped; +/** + * StringBuffer contains string and Promise alternately + * The length of the array will be odd, the odd numbered element will be a string, + * and the even numbered element will be a Promise. + * When concatenating into a single string, it must be processed from the tail. + * @example + * [ + * 'framework.', + * Promise.resolve('ultra fast'), + * 'a ', + * Promise.resolve('is '), + * 'Hono', + * ] + */ +export type StringBuffer = (string | Promise)[]; +export type StringBufferWithCallbacks = StringBuffer & { + callbacks: HtmlEscapedCallback[]; +}; +export declare const raw: (value: unknown, callbacks?: HtmlEscapedCallback[]) => HtmlEscapedString; +export declare const stringBufferToString: (buffer: StringBuffer, callbacks: HtmlEscapedCallback[] | undefined) => Promise; +export declare const escapeToBuffer: (str: string, buffer: StringBuffer) => void; +export declare const resolveCallbackSync: (str: string | HtmlEscapedString) => string; +export declare const resolveCallback: (str: string | HtmlEscapedString | Promise, phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase], preserveCallbacks: boolean, context: object, buffer?: [string]) => Promise; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/http-status.d.ts b/tools/ui/node_modules/hono/dist/types/utils/http-status.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0cb67cc1b455a8ceb9ed45580c0df0fe7bedfcd --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/http-status.d.ts @@ -0,0 +1,32 @@ +/** + * @module + * HTTP Status utility. + */ +export type InfoStatusCode = 100 | 101 | 102 | 103; +export type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226; +export type DeprecatedStatusCode = 305 | 306; +export type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308; +export type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451; +export type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511; +/** + * `UnofficialStatusCode` can be used to specify an unofficial status code. + * @example + * + * ```ts + * app.get('/unknown', (c) => { + * return c.text("Unknown Error", 520 as UnofficialStatusCode) + * }) + * ``` + */ +export type UnofficialStatusCode = -1; +/** + * @deprecated + * Use `UnofficialStatusCode` instead. + */ +export type UnOfficalStatusCode = UnofficialStatusCode; +/** + * If you want to use an unofficial status, use `UnofficialStatusCode`. + */ +export type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode; +export type ContentlessStatusCode = 101 | 204 | 205 | 304; +export type ContentfulStatusCode = Exclude; diff --git a/tools/ui/node_modules/hono/dist/types/utils/ipaddr.d.ts b/tools/ui/node_modules/hono/dist/types/utils/ipaddr.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc414086ff5188172b5eaa7bdaef10081bde7a47 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/ipaddr.d.ts @@ -0,0 +1,56 @@ +/** + * Utils for IP Addresses + * @module + */ +import type { AddressType } from '../helper/conninfo'; +/** + * Expand IPv6 Address + * @param ipV6 Shorten IPv6 Address + * @return expanded IPv6 Address + */ +export declare const expandIPv6: (ipV6: string) => string; +export declare const INVALID_IP_ADDRESS_ERROR_CODE = "ERR_INVALID_IP_ADDRESS"; +export type InvalidIPAddressError = TypeError & { + code: typeof INVALID_IP_ADDRESS_ERROR_CODE; +}; +/** + * Distinct Remote Addr + * @param remoteAddr Remote Addr + */ +export declare const distinctRemoteAddr: (remoteAddr: string) => AddressType; +/** + * Convert IPv4 to Uint8Array + * @param ipv4 IPv4 Address + * @returns BigInt + */ +export declare const convertIPv4ToBinary: (ipv4: string) => bigint; +/** + * Convert IPv6 to Uint8Array + * @param ipv6 IPv6 Address + * @returns BigInt + */ +export declare const convertIPv6ToBinary: (ipv6: string) => bigint; +/** + * Convert a binary representation of an IPv4 address to a string. + * @param ipV4 binary IPv4 Address + * @return IPv4 Address in string + */ +export declare const convertIPv4BinaryToString: (ipV4: bigint) => string; +/** + * Check if a binary IPv6 address is an IPv4-mapped IPv6 address (::ffff:x.x.x.x) + * @param ipv6binary binary IPv6 Address + * @return true if the address is an IPv4-mapped IPv6 address + */ +export declare const isIPv4MappedIPv6: (ipv6binary: bigint) => boolean; +/** + * Extract the IPv4 portion from an IPv4-mapped IPv6 address + * @param ipv6binary binary IPv4-mapped IPv6 Address + * @return binary IPv4 Address + */ +export declare const convertIPv4MappedIPv6ToIPv4: (ipv6binary: bigint) => bigint; +/** + * Convert a binary representation of an IPv6 address to a string. + * @param ipV6 binary IPv6 Address + * @return normalized IPv6 Address in string + */ +export declare const convertIPv6BinaryToString: (ipV6: bigint) => string; diff --git a/tools/ui/node_modules/hono/dist/types/utils/jwt/index.d.ts b/tools/ui/node_modules/hono/dist/types/utils/jwt/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d8931048964092c61d1f0c025a5ad2f1d848add --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/jwt/index.d.ts @@ -0,0 +1,18 @@ +/** + * @module + * JWT utility. + */ +export declare const Jwt: { + sign: (payload: import("./types").JWTPayload, privateKey: import("./jws").SignatureKey, alg?: import("./jwa").SignatureAlgorithm) => Promise; + verify: (token: string, publicKey: import("./jws").SignatureKey, algOrOptions: import("./jwa").SignatureAlgorithm | import("./jwt").VerifyOptionsWithAlg) => Promise; + decode: (token: string) => { + header: import("./jwt").TokenHeader; + payload: import("./types").JWTPayload; + }; + verifyWithJwks: (token: string, options: { + keys?: import("./jws").HonoJsonWebKey[]; + jwks_uri?: string; + verification?: import("./jwt").VerifyOptions; + allowedAlgorithms: readonly import("./jwa").AsymmetricAlgorithm[]; + }, init?: RequestInit) => Promise; +}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/jwt/jwa.d.ts b/tools/ui/node_modules/hono/dist/types/utils/jwt/jwa.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72b51f4bd30976fd939f066ef682d63c64e1c1d2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/jwt/jwa.d.ts @@ -0,0 +1,23 @@ +/** + * @module + * JSON Web Algorithms (JWA) + * https://datatracker.ietf.org/doc/html/rfc7518 + */ +export declare enum AlgorithmTypes { + HS256 = "HS256", + HS384 = "HS384", + HS512 = "HS512", + RS256 = "RS256", + RS384 = "RS384", + RS512 = "RS512", + PS256 = "PS256", + PS384 = "PS384", + PS512 = "PS512", + ES256 = "ES256", + ES384 = "ES384", + ES512 = "ES512", + EdDSA = "EdDSA" +} +export type SignatureAlgorithm = keyof typeof AlgorithmTypes; +export type SymmetricAlgorithm = 'HS256' | 'HS384' | 'HS512'; +export type AsymmetricAlgorithm = 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512' | 'ES256' | 'ES384' | 'ES512' | 'EdDSA'; diff --git a/tools/ui/node_modules/hono/dist/types/utils/jwt/jws.d.ts b/tools/ui/node_modules/hono/dist/types/utils/jwt/jws.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..63605f67bb12e8f6989bb43da95e4d5244d26ae8 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/jwt/jws.d.ts @@ -0,0 +1,12 @@ +/** + * @module + * JSON Web Signature (JWS) + * https://datatracker.ietf.org/doc/html/rfc7515 + */ +import type { SignatureAlgorithm } from './jwa'; +export interface HonoJsonWebKey extends JsonWebKey { + kid?: string; +} +export type SignatureKey = string | HonoJsonWebKey | CryptoKey; +export declare function signing(privateKey: SignatureKey, alg: SignatureAlgorithm, data: BufferSource): Promise; +export declare function verifying(publicKey: SignatureKey, alg: SignatureAlgorithm, signature: BufferSource, data: BufferSource): Promise; diff --git a/tools/ui/node_modules/hono/dist/types/utils/jwt/jwt.d.ts b/tools/ui/node_modules/hono/dist/types/utils/jwt/jwt.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8fed89b2a772bc7528059e4c2f21d1aa2015745 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/jwt/jwt.d.ts @@ -0,0 +1,43 @@ +/** + * @module + * JSON Web Token (JWT) + * https://datatracker.ietf.org/doc/html/rfc7519 + */ +import type { AsymmetricAlgorithm, SignatureAlgorithm } from './jwa'; +import type { HonoJsonWebKey, SignatureKey } from './jws'; +import type { JWTPayload } from './types'; +export interface TokenHeader { + alg: SignatureAlgorithm; + typ?: 'JWT'; + kid?: string; +} +export declare function isTokenHeader(obj: unknown): obj is TokenHeader; +export declare const sign: (payload: JWTPayload, privateKey: SignatureKey, alg?: SignatureAlgorithm) => Promise; +export type VerifyOptions = { + /** The expected issuer used for verifying the token */ + iss?: string | RegExp; + /** Verify the `nbf` claim (default: `true`) */ + nbf?: boolean; + /** Verify the `exp` claim (default: `true`) */ + exp?: boolean; + /** Verify the `iat` claim (default: `true`) */ + iat?: boolean; + /** Acceptable audience(s) for the token */ + aud?: string | string[] | RegExp; +}; +export type VerifyOptionsWithAlg = { + /** The algorithm used for decoding the token */ + alg: SignatureAlgorithm; +} & VerifyOptions; +export declare const verify: (token: string, publicKey: SignatureKey, algOrOptions: SignatureAlgorithm | VerifyOptionsWithAlg) => Promise; +export declare const verifyWithJwks: (token: string, options: { + keys?: HonoJsonWebKey[]; + jwks_uri?: string; + verification?: VerifyOptions; + allowedAlgorithms: readonly AsymmetricAlgorithm[]; +}, init?: RequestInit) => Promise; +export declare const decode: (token: string) => { + header: TokenHeader; + payload: JWTPayload; +}; +export declare const decodeHeader: (token: string) => TokenHeader; diff --git a/tools/ui/node_modules/hono/dist/types/utils/jwt/types.d.ts b/tools/ui/node_modules/hono/dist/types/utils/jwt/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d5ccf8573e8f72bc4adbb5029d2b6567dc3f3f7b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/jwt/types.d.ts @@ -0,0 +1,86 @@ +/** + * @module + * Type definitions for JWT utilities. + */ +export declare class JwtAlgorithmNotImplemented extends Error { + constructor(alg: string); +} +export declare class JwtAlgorithmRequired extends Error { + constructor(); +} +export declare class JwtAlgorithmMismatch extends Error { + constructor(expected: string, actual: string); +} +export declare class JwtTokenInvalid extends Error { + constructor(token: string); +} +export declare class JwtTokenNotBefore extends Error { + constructor(token: string); +} +export declare class JwtTokenExpired extends Error { + constructor(token: string); +} +export declare class JwtTokenIssuedAt extends Error { + constructor(currentTimestamp: number, iat: number); +} +export declare class JwtTokenIssuer extends Error { + constructor(expected: string | RegExp, iss: string | null); +} +export declare class JwtHeaderInvalid extends Error { + constructor(header: object); +} +export declare class JwtHeaderRequiresKid extends Error { + constructor(header: object); +} +export declare class JwtSymmetricAlgorithmNotAllowed extends Error { + constructor(alg: string); +} +export declare class JwtAlgorithmNotAllowed extends Error { + constructor(alg: string, allowedAlgorithms: readonly string[]); +} +export declare class JwtTokenSignatureMismatched extends Error { + constructor(token: string); +} +export declare class JwtPayloadRequiresAud extends Error { + constructor(payload: object); +} +export declare class JwtTokenAudience extends Error { + constructor(expected: string | string[] | RegExp, aud: string | string[]); +} +export declare enum CryptoKeyUsage { + Encrypt = "encrypt", + Decrypt = "decrypt", + Sign = "sign", + Verify = "verify", + DeriveKey = "deriveKey", + DeriveBits = "deriveBits", + WrapKey = "wrapKey", + UnwrapKey = "unwrapKey" +} +/** + * JWT Payload + */ +export type JWTPayload = { + [key: string]: unknown; + /** + * The token is checked to ensure it has not expired. + */ + exp?: number; + /** + * The token is checked to ensure it is not being used before a specified time. + */ + nbf?: number; + /** + * The token is checked to ensure it is not issued in the future. + */ + iat?: number; + /** + * The token is checked to ensure it has been issued by a trusted issuer. + */ + iss?: string; + /** + * The token is checked to ensure it is intended for a specific audience. + */ + aud?: string | string[]; +}; +export type { HonoJsonWebKey } from './jws'; diff --git a/tools/ui/node_modules/hono/dist/types/utils/jwt/utf8.d.ts b/tools/ui/node_modules/hono/dist/types/utils/jwt/utf8.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ff9fc1ce974f506f9b70b2550ef5bb8b8882e5e5 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/jwt/utf8.d.ts @@ -0,0 +1,6 @@ +/** + * @module + * Functions for encoding/decoding UTF8. + */ +export declare const utf8Encoder: TextEncoder; +export declare const utf8Decoder: TextDecoder; diff --git a/tools/ui/node_modules/hono/dist/types/utils/mime.d.ts b/tools/ui/node_modules/hono/dist/types/utils/mime.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9352a0582a47da971df2c170d71b942c8d26c890 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/mime.d.ts @@ -0,0 +1,70 @@ +/** + * @module + * MIME utility. + */ +export declare const getMimeType: (filename: string, mimes?: Record) => string | undefined; +export declare const getExtension: (mimeType: string) => string | undefined; +export { baseMimes as mimes }; +/** + * Union types for BaseMime + */ +export type BaseMime = (typeof _baseMimes)[keyof typeof _baseMimes]; +declare const _baseMimes: { + readonly aac: "audio/aac"; + readonly avi: "video/x-msvideo"; + readonly avif: "image/avif"; + readonly av1: "video/av1"; + readonly bin: "application/octet-stream"; + readonly bmp: "image/bmp"; + readonly css: "text/css; charset=utf-8"; + readonly csv: "text/csv; charset=utf-8"; + readonly eot: "application/vnd.ms-fontobject"; + readonly epub: "application/epub+zip"; + readonly gif: "image/gif"; + readonly gz: "application/gzip"; + readonly htm: "text/html; charset=utf-8"; + readonly html: "text/html; charset=utf-8"; + readonly ico: "image/x-icon"; + readonly ics: "text/calendar; charset=utf-8"; + readonly jpeg: "image/jpeg"; + readonly jpg: "image/jpeg"; + readonly js: "text/javascript; charset=utf-8"; + readonly json: "application/json"; + readonly jsonld: "application/ld+json"; + readonly map: "application/json"; + readonly mid: "audio/x-midi"; + readonly midi: "audio/x-midi"; + readonly mjs: "text/javascript; charset=utf-8"; + readonly mp3: "audio/mpeg"; + readonly mp4: "video/mp4"; + readonly mpeg: "video/mpeg"; + readonly oga: "audio/ogg"; + readonly ogv: "video/ogg"; + readonly ogx: "application/ogg"; + readonly opus: "audio/opus"; + readonly otf: "font/otf"; + readonly pdf: "application/pdf"; + readonly png: "image/png"; + readonly rtf: "application/rtf"; + readonly svg: "image/svg+xml; charset=utf-8"; + readonly tif: "image/tiff"; + readonly tiff: "image/tiff"; + readonly ts: "video/mp2t"; + readonly ttf: "font/ttf"; + readonly txt: "text/plain; charset=utf-8"; + readonly wasm: "application/wasm"; + readonly webm: "video/webm"; + readonly weba: "audio/webm"; + readonly webmanifest: "application/manifest+json"; + readonly webp: "image/webp"; + readonly woff: "font/woff"; + readonly woff2: "font/woff2"; + readonly xhtml: "application/xhtml+xml; charset=utf-8"; + readonly xml: "application/xml; charset=utf-8"; + readonly zip: "application/zip"; + readonly '3gp': "video/3gpp"; + readonly '3g2': "video/3gpp2"; + readonly gltf: "model/gltf+json"; + readonly glb: "model/gltf-binary"; +}; +declare const baseMimes: Record; diff --git a/tools/ui/node_modules/hono/dist/types/utils/stream.d.ts b/tools/ui/node_modules/hono/dist/types/utils/stream.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..51c46e6e3bec1e7687a256d7e8d50cbc5534f6e1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/stream.d.ts @@ -0,0 +1,31 @@ +/** + * @module + * Stream utility. + */ +export declare class StreamingApi { + private writer; + private encoder; + private writable; + private abortSubscribers; + responseReadable: ReadableStream; + /** + * Whether the stream has been aborted. + */ + aborted: boolean; + /** + * Whether the stream has been closed normally. + */ + closed: boolean; + constructor(writable: WritableStream, _readable: ReadableStream); + write(input: Uint8Array | string): Promise; + writeln(input: string): Promise; + sleep(ms: number): Promise; + close(): Promise; + pipe(body: ReadableStream): Promise; + onAbort(listener: () => void | Promise): void; + /** + * Abort the stream. + * You can call this method when stream is aborted by external event. + */ + abort(): void; +} diff --git a/tools/ui/node_modules/hono/dist/types/utils/types.d.ts b/tools/ui/node_modules/hono/dist/types/utils/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0aac27d7ade3bfc963d97b5dfa566d2ee3d48032 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/types.d.ts @@ -0,0 +1,74 @@ +/** + * @module + * Types utility. + */ +export type Expect = T; +export type Equal = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? true : false; +export type NotEqual = true extends Equal ? false : true; +export type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +export type RemoveBlankRecord = T extends Record ? (K extends string ? T : never) : never; +export type IfAnyThenEmptyObject = 0 extends 1 & T ? {} : T; +export type JSONPrimitive = string | boolean | number | null; +export type JSONArray = (JSONPrimitive | JSONObject | JSONArray)[]; +export type JSONObject = { + [key: string]: JSONPrimitive | JSONArray | JSONObject | object | InvalidJSONValue; +}; +export type InvalidJSONValue = undefined | symbol | ((...args: unknown[]) => unknown); +type InvalidToNull = T extends InvalidJSONValue ? null : T; +type IsInvalid = T extends InvalidJSONValue ? true : false; +/** + * symbol keys are omitted through `JSON.stringify` + */ +type OmitSymbolKeys = { + [K in keyof T as K extends symbol ? never : K]: T[K]; +}; +export type JSONValue = JSONObject | JSONArray | JSONPrimitive; +/** + * Convert a type to a JSON-compatible type. + * + * Non-JSON values such as `Date` implement `.toJSON()`, + * so they can be transformed to a value assignable to `JSONObject` + * + * `JSON.stringify()` throws a `TypeError` when it encounters a `bigint` value, + * unless a custom `replacer` function or `.toJSON()` method is provided. + * + * This behaviour can be controlled by the `TError` generic type parameter, + * which defaults to `bigint | ReadonlyArray`. + * You can set it to `never` to disable this check. + */ +export type JSONParsed> = T extends { + toJSON(): infer J; +} ? (() => J) extends () => JSONPrimitive ? J : (() => J) extends () => { + toJSON(): unknown; +} ? {} : JSONParsed : T extends JSONPrimitive ? T : T extends InvalidJSONValue ? never : T extends ReadonlyArray ? { + [K in keyof T]: JSONParsed, TError>; +} extends infer A ? A extends ReadonlyArray ? A : JSONParsed, TError>[] : never : T extends Set | Map | Record ? {} : T extends object ? T[keyof T] extends TError ? never : { + [K in keyof OmitSymbolKeys as IsInvalid extends true ? never : K]: boolean extends IsInvalid ? JSONParsed | undefined : JSONParsed; +} : T extends unknown ? T extends TError ? never : JSONValue : never; +/** + * Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. + * @copyright from sindresorhus/type-fest + */ +export type Simplify = { + [KeyType in keyof T]: T[KeyType]; +} & {}; +/** + * A simple extension of Simplify that will deeply traverse array elements. + */ +export type SimplifyDeepArray = T extends any[] ? { + [E in keyof T]: SimplifyDeepArray; +} : Simplify; +export type InterfaceToType = T extends Function ? T : { + [K in keyof T]: InterfaceToType; +}; +export type RequiredKeysOf = Exclude<{ + [Key in keyof BaseType]: BaseType extends Record ? Key : never; +}[keyof BaseType], undefined>; +export type HasRequiredKeys = RequiredKeysOf extends never ? false : true; +export type IsAny = boolean extends (T extends never ? true : false) ? true : false; +/** + * String literal types with auto-completion + * @see https://github.com/Microsoft/TypeScript/issues/29729 + */ +export type StringLiteralUnion = T | (string & Record); +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/utils/url.d.ts b/tools/ui/node_modules/hono/dist/types/utils/url.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..37df8d2e5598772aa406da892607c2c52b1a551a --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/utils/url.d.ts @@ -0,0 +1,40 @@ +/** + * @module + * URL utility. + */ +export type Pattern = readonly [string, string, RegExp | true] | '*'; +export declare const splitPath: (path: string) => string[]; +export declare const splitRoutingPath: (routePath: string) => string[]; +export declare const getPattern: (label: string, next?: string) => Pattern | null; +type Decoder = (str: string) => string; +export declare const tryDecode: (str: string, decoder: Decoder) => string; +/** + * Try to apply decodeURI() to given string. + * If it fails, skip invalid percent encoding or invalid UTF-8 sequences, and apply decodeURI() to the rest as much as possible. + * @param str The string to decode. + * @returns The decoded string that sometimes contains undecodable percent encoding. + * @example + * tryDecodeURI('Hello%20World') // 'Hello World' + * tryDecodeURI('Hello%20World/%A4%A2') // 'Hello World/%A4%A2' + */ +export declare const tryDecodeURI: (str: string) => string; +export declare const getPath: (request: Request) => string; +export declare const getQueryStrings: (url: string) => string; +export declare const getPathNoStrict: (request: Request) => string; +/** + * Merge paths. + * @param {string[]} ...paths - The paths to merge. + * @returns {string} The merged path. + * @example + * mergePath('/api', '/users') // '/api/users' + * mergePath('/api/', '/users') // '/api/users' + * mergePath('/api', '/') // '/api' + * mergePath('/api/', '/') // '/api/' + */ +export declare const mergePath: (...paths: string[]) => string; +export declare const checkOptionalParameter: (path: string) => string[] | null; +export declare const tryDecodeURIComponent: (str: string) => string; +export declare const getQueryParam: (url: string, key?: string) => string | undefined | Record; +export declare const getQueryParams: (url: string, key?: string) => string[] | undefined | Record; +export declare const decodeURIComponent_: typeof decodeURIComponent; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/validator/index.d.ts b/tools/ui/node_modules/hono/dist/types/validator/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..149b255571d1eae3997f404ef3c112dbf9e8ef4c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/validator/index.d.ts @@ -0,0 +1,7 @@ +/** + * @module + * Validator for Hono. + */ +export { validator } from './validator'; +export type { ValidationFunction } from './validator'; +export type { InferInput } from './utils'; diff --git a/tools/ui/node_modules/hono/dist/types/validator/utils.d.ts b/tools/ui/node_modules/hono/dist/types/validator/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fef73dde42a96e7d50641ed9dc6998d4f5c9e59 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/validator/utils.d.ts @@ -0,0 +1,29 @@ +import type { FormValue, ParsedFormValue, ValidationTargets } from '../types'; +import type { UnionToIntersection } from '../utils/types'; +/** + * Checks if T is a literal union type (e.g., 'asc' | 'desc') + * that should be preserved in input types. + * Returns true for union literals, false for single literals or wide types. + */ +export type IsLiteralUnion = [Exclude] extends [Base] ? [Exclude] extends [UnionToIntersection>] ? false : true : false; +type IsOptionalUnion = [unknown] extends [T] ? false : undefined extends T ? true : false; +type SimplifyDeep = { + [K in keyof T]: T[K]; +} & {}; +type InferInputInner = SimplifyDeep<{ + [K in keyof Output]: IsLiteralUnion extends true ? Output[K] : IsOptionalUnion extends true ? Output[K] : Target extends 'form' ? T | T[] : Target extends 'query' ? string | string[] : Target extends 'param' ? string : Target extends 'header' ? string : Target extends 'cookie' ? string : unknown; +}>; +/** + * Utility type to infer input types for validation targets. + * Preserves literal union types (e.g., 'asc' | 'desc') while using + * the default ValidationTargets type for other values. + * + * @example + * ```ts + * // In @hono/zod-validator or similar: + * type Input = InferInput, 'query'> + * // { orderBy: 'asc' | 'desc', page: string | string[] } + * ``` + */ +export type InferInput = [Exclude] extends [never] ? {} : [Exclude] extends [object] ? undefined extends Output ? SimplifyDeep, Target, T>> | undefined : SimplifyDeep> : {}; +export {}; diff --git a/tools/ui/node_modules/hono/dist/types/validator/validator.d.ts b/tools/ui/node_modules/hono/dist/types/validator/validator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a94947bfca9692318715075f61597d784b8dd3b --- /dev/null +++ b/tools/ui/node_modules/hono/dist/types/validator/validator.d.ts @@ -0,0 +1,16 @@ +import type { Context } from '../context'; +import type { Env, MiddlewareHandler, TypedResponse, ValidationTargets, FormValue } from '../types'; +import type { InferInput } from './utils'; +type ValidationTargetKeysWithBody = 'form' | 'json'; +type ValidationTargetByMethod = M extends 'get' | 'head' ? Exclude : keyof ValidationTargets; +export type ValidationFunction = (value: InputType, c: Context) => OutputType | TypedResponse | Promise | Promise; +export type ExtractValidationResponse = VF extends (value: any, c: any) => infer R ? R extends Promise ? PR extends TypedResponse ? TypedResponse : PR extends Response ? PR : PR extends undefined ? never : never : R extends TypedResponse ? TypedResponse : R extends Response ? R : R extends undefined ? never : never : never; +export declare const validator: , P2 extends string = P, VF extends (value: unknown extends InputType ? ValidationTargets[U] : InputType, c: Context) => any = (value: unknown extends InputType ? ValidationTargets[U] : InputType, c: Context) => any, V extends { + in: { [K in U]: K extends "json" ? unknown extends InputType ? ExtractValidatorOutput : InputType : InferInput, K, FormValue>; }; + out: { [K in U]: ExtractValidatorOutput; }; +} = { + in: { [K in U]: K extends "json" ? unknown extends InputType ? ExtractValidatorOutput : InputType : InferInput, K, FormValue>; }; + out: { [K in U]: ExtractValidatorOutput; }; +}, E extends Env = any>(target: U, validationFunc: VF) => MiddlewareHandler>; +export type ExtractValidatorOutput = VF extends (value: any, c: any) => infer R ? R extends Promise ? PR extends Response | TypedResponse ? never : PR : R extends Response | TypedResponse ? never : R : never; +export {}; diff --git a/tools/ui/node_modules/hono/dist/utils/accept.js b/tools/ui/node_modules/hono/dist/utils/accept.js new file mode 100644 index 0000000000000000000000000000000000000000..6e24cde5b0413c3587bd2adef22ff0e3b54dbdd0 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/accept.js @@ -0,0 +1,223 @@ +// src/utils/accept.ts +var isWhitespace = (char) => char === 32 || char === 9 || char === 10 || char === 13; +var consumeWhitespace = (acceptHeader, startIndex) => { + while (startIndex < acceptHeader.length) { + if (!isWhitespace(acceptHeader.charCodeAt(startIndex))) { + break; + } + startIndex++; + } + return startIndex; +}; +var ignoreTrailingWhitespace = (acceptHeader, startIndex) => { + while (startIndex > 0) { + if (!isWhitespace(acceptHeader.charCodeAt(startIndex - 1))) { + break; + } + startIndex--; + } + return startIndex; +}; +var skipInvalidParam = (acceptHeader, startIndex) => { + while (startIndex < acceptHeader.length) { + const char = acceptHeader.charCodeAt(startIndex); + if (char === 59) { + return [startIndex + 1, true]; + } + if (char === 44) { + return [startIndex + 1, false]; + } + startIndex++; + } + return [startIndex, false]; +}; +var skipInvalidAcceptValue = (acceptHeader, startIndex) => { + let i = startIndex; + let inQuotes = false; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (inQuotes && char === 92) { + i++; + } else if (char === 34) { + inQuotes = !inQuotes; + } else if (!inQuotes && char === 44) { + return i + 1; + } + i++; + } + return i; +}; +var getNextParam = (acceptHeader, startIndex) => { + startIndex = consumeWhitespace(acceptHeader, startIndex); + let i = startIndex; + let key; + let value; + let hasNext = false; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (char === 61) { + key = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i)); + i++; + break; + } + if (char === 59) { + return [i + 1, void 0, void 0, true]; + } + if (char === 44) { + return [i + 1, void 0, void 0, false]; + } + i++; + } + if (key === void 0) { + return [i, void 0, void 0, false]; + } + i = consumeWhitespace(acceptHeader, i); + if (acceptHeader.charCodeAt(i) === 61) { + const skipResult = skipInvalidParam(acceptHeader, i + 1); + return [skipResult[0], key, void 0, skipResult[1]]; + } + let inQuotes = false; + const paramStartIndex = i; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (inQuotes && char === 92) { + i++; + } else if (char === 34) { + if (inQuotes) { + let nextIndex = consumeWhitespace(acceptHeader, i + 1); + const nextChar = acceptHeader.charCodeAt(nextIndex); + if (nextIndex < acceptHeader.length && !(nextChar === 59 || nextChar === 44)) { + const skipResult = skipInvalidParam(acceptHeader, nextIndex); + return [skipResult[0], key, void 0, skipResult[1]]; + } + value = acceptHeader.slice(paramStartIndex + 1, i); + if (value.includes("\\")) { + value = value.replace(/\\(.)/g, "$1"); + } + if (nextChar === 44) { + return [nextIndex + 1, key, value, false]; + } + if (nextChar === 59) { + hasNext = true; + nextIndex++; + } + i = nextIndex; + break; + } + inQuotes = true; + } else if (!inQuotes && (char === 59 || char === 44)) { + value = acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i)); + if (char === 59) { + hasNext = true; + } + i++; + break; + } + i++; + } + return [ + i, + key, + value ?? acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i)), + hasNext + ]; +}; +var getNextAcceptValue = (acceptHeader, startIndex) => { + const accept = { + type: "", + params: /* @__PURE__ */ Object.create(null), + q: 1 + }; + startIndex = consumeWhitespace(acceptHeader, startIndex); + let i = startIndex; + while (i < acceptHeader.length) { + const char = acceptHeader.charCodeAt(i); + if (char === 59 || char === 44) { + accept.type = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i)); + i++; + if (char === 44) { + return [i, accept.type ? accept : void 0]; + } + if (!accept.type) { + return [skipInvalidAcceptValue(acceptHeader, i), void 0]; + } + break; + } + i++; + } + if (!accept.type) { + accept.type = acceptHeader.slice( + startIndex, + ignoreTrailingWhitespace(acceptHeader, acceptHeader.length) + ); + return [acceptHeader.length, accept.type ? accept : void 0]; + } + let param; + let value; + let hasNext; + while (i < acceptHeader.length) { + ; + [i, param, value, hasNext] = getNextParam(acceptHeader, i); + if (param && value) { + accept.params[param] = value; + } + if (!hasNext) { + break; + } + } + return [i, accept]; +}; +var parseAccept = (acceptHeader) => { + if (!acceptHeader) { + return []; + } + const values = []; + let i = 0; + let accept; + let requiresSort = false; + let lastAccept; + while (i < acceptHeader.length) { + ; + [i, accept] = getNextAcceptValue(acceptHeader, i); + if (accept) { + accept.q = parseQuality(accept.params.q); + values.push(accept); + if (lastAccept && lastAccept.q < accept.q) { + requiresSort = true; + } + lastAccept = accept; + } + } + if (requiresSort) { + values.sort((a, b) => b.q - a.q); + } + return values; +}; +var parseQuality = (qVal) => { + if (qVal === void 0) { + return 1; + } + if (qVal === "") { + return 1; + } + if (qVal === "NaN") { + return 0; + } + const num = Number(qVal); + if (num === Infinity) { + return 1; + } + if (num === -Infinity) { + return 0; + } + if (Number.isNaN(num)) { + return 1; + } + if (num < 0 || num > 1) { + return 1; + } + return num; +}; +export { + parseAccept +}; diff --git a/tools/ui/node_modules/hono/dist/utils/basic-auth.js b/tools/ui/node_modules/hono/dist/utils/basic-auth.js new file mode 100644 index 0000000000000000000000000000000000000000..579a665cb4dd61958cb7160ae9cfa07148f5a0dc --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/basic-auth.js @@ -0,0 +1,23 @@ +// src/utils/basic-auth.ts +import { decodeBase64 } from "./encode.js"; +var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/; +var USER_PASS_REGEXP = /^([^:]*):(.*)$/; +var utf8Decoder = new TextDecoder(); +var auth = (req) => { + const match = CREDENTIALS_REGEXP.exec(req.headers.get("Authorization") || ""); + if (!match) { + return void 0; + } + let userPass = void 0; + try { + userPass = USER_PASS_REGEXP.exec(utf8Decoder.decode(decodeBase64(match[1]))); + } catch { + } + if (!userPass) { + return void 0; + } + return { username: userPass[1], password: userPass[2] }; +}; +export { + auth +}; diff --git a/tools/ui/node_modules/hono/dist/utils/body.js b/tools/ui/node_modules/hono/dist/utils/body.js new file mode 100644 index 0000000000000000000000000000000000000000..f10b6677481f5f1b18b3ef7162bf5d1959b1d8ff --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/body.js @@ -0,0 +1,89 @@ +// src/utils/body.ts +import { bufferToFormData } from "./buffer.js"; +var isRawRequest = (request) => "headers" in request; +var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => { + const { all = false, dot = false } = options; + const headers = isRawRequest(request) ? request.headers : request.raw.headers; + const contentType = headers.get("Content-Type"); + const mediaType = contentType?.split(";")[0].trim().toLowerCase(); + if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") { + return parseFormData(request, { all, dot }); + } + return {}; +}; +async function parseFormData(request, options) { + if (!isRawRequest(request) && request.bodyCache.formData) { + return convertFormDataToBodyData( + await request.bodyCache.formData, + options + ); + } + const headers = isRawRequest(request) ? request.headers : request.raw.headers; + const arrayBuffer = await request.arrayBuffer(); + const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || ""); + if (!isRawRequest(request)) { + request.bodyCache.formData = formDataPromise; + } + const formData = await formDataPromise; + if (formData) { + return convertFormDataToBodyData(formData, options); + } + return {}; +} +function convertFormDataToBodyData(formData, options) { + const form = /* @__PURE__ */ Object.create(null); + formData.forEach((value, key) => { + const shouldParseAllValues = options.all || key.endsWith("[]"); + if (!shouldParseAllValues) { + form[key] = value; + } else { + handleParsingAllValues(form, key, value); + } + }); + if (options.dot) { + Object.entries(form).forEach(([key, value]) => { + const shouldParseDotValues = key.includes("."); + if (shouldParseDotValues) { + handleParsingNestedValues(form, key, value); + delete form[key]; + } + }); + } + return form; +} +var handleParsingAllValues = (form, key, value) => { + if (form[key] !== void 0) { + if (Array.isArray(form[key])) { + ; + form[key].push(value); + } else { + form[key] = [form[key], value]; + } + } else { + if (!key.endsWith("[]")) { + form[key] = value; + } else { + form[key] = [value]; + } + } +}; +var handleParsingNestedValues = (form, key, value) => { + if (/(?:^|\.)__proto__\./.test(key)) { + return; + } + let nestedForm = form; + const keys = key.split("."); + keys.forEach((key2, index) => { + if (index === keys.length - 1) { + nestedForm[key2] = value; + } else { + if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) { + nestedForm[key2] = /* @__PURE__ */ Object.create(null); + } + nestedForm = nestedForm[key2]; + } + }); +}; +export { + parseBody +}; diff --git a/tools/ui/node_modules/hono/dist/utils/buffer.js b/tools/ui/node_modules/hono/dist/utils/buffer.js new file mode 100644 index 0000000000000000000000000000000000000000..248149ebba0ebca1ad1d94b1277ce7e04e4117fd --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/buffer.js @@ -0,0 +1,78 @@ +// src/utils/buffer.ts +import { sha256 } from "./crypto.js"; +var equal = (a, b) => { + if (a === b) { + return true; + } + if (a.byteLength !== b.byteLength) { + return false; + } + const va = new DataView(a); + const vb = new DataView(b); + let i = va.byteLength; + while (i--) { + if (va.getUint8(i) !== vb.getUint8(i)) { + return false; + } + } + return true; +}; +var constantTimeEqualString = (a, b) => { + const aLen = a.length; + const bLen = b.length; + const maxLen = Math.max(aLen, bLen); + let out = aLen ^ bLen; + for (let i = 0; i < maxLen; i++) { + const aChar = i < aLen ? a.charCodeAt(i) : 0; + const bChar = i < bLen ? b.charCodeAt(i) : 0; + out |= aChar ^ bChar; + } + return out === 0; +}; +var timingSafeEqualString = async (a, b, hashFunction) => { + if (!hashFunction) { + hashFunction = sha256; + } + const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]); + if (sa == null || sb == null || typeof sa !== "string" || typeof sb !== "string") { + return false; + } + const hashEqual = constantTimeEqualString(sa, sb); + const originalEqual = constantTimeEqualString(a, b); + return hashEqual && originalEqual; +}; +var timingSafeEqual = async (a, b, hashFunction) => { + if (typeof a === "string" && typeof b === "string") { + return timingSafeEqualString(a, b, hashFunction); + } + if (!hashFunction) { + hashFunction = sha256; + } + const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]); + if (!sa || !sb || typeof sa !== "string" || typeof sb !== "string") { + return false; + } + return timingSafeEqualString(sa, sb); +}; +var bufferToString = (buffer) => { + if (buffer instanceof ArrayBuffer) { + const enc = new TextDecoder("utf-8"); + return enc.decode(buffer); + } + return buffer; +}; +var bufferToFormData = (arrayBuffer, contentType) => { + const response = new Response(arrayBuffer, { + headers: { + // Normalize the media type (case-insensitive) while keeping parameters like the boundary + "Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase()) + } + }); + return response.formData(); +}; +export { + bufferToFormData, + bufferToString, + equal, + timingSafeEqual +}; diff --git a/tools/ui/node_modules/hono/dist/utils/color.js b/tools/ui/node_modules/hono/dist/utils/color.js new file mode 100644 index 0000000000000000000000000000000000000000..e8671957baea1e289fb569fa88dc0d80097d690f --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/color.js @@ -0,0 +1,25 @@ +// src/utils/color.ts +function getColorEnabled() { + const { process, Deno } = globalThis; + const isNoColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : process !== void 0 ? ( + // eslint-disable-next-line no-unsafe-optional-chaining + "NO_COLOR" in process?.env + ) : false; + return !isNoColor; +} +async function getColorEnabledAsync() { + const { navigator } = globalThis; + const cfWorkers = "cloudflare:workers"; + const isNoColor = navigator !== void 0 && navigator.userAgent === "Cloudflare-Workers" ? await (async () => { + try { + return "NO_COLOR" in ((await import(cfWorkers)).env ?? {}); + } catch { + return false; + } + })() : !getColorEnabled(); + return !isNoColor; +} +export { + getColorEnabled, + getColorEnabledAsync +}; diff --git a/tools/ui/node_modules/hono/dist/utils/compress.js b/tools/ui/node_modules/hono/dist/utils/compress.js new file mode 100644 index 0000000000000000000000000000000000000000..761c39e1254ed00a7d0bdd1dec70734b0f7474ee --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/compress.js @@ -0,0 +1,5 @@ +// src/utils/compress.ts +var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|msgpack|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|vnd\.msgpack|wasm|x-httpd-php|x-javascript|x-msgpack|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml|msgpack))(?:[;\s]|$)/i; +export { + COMPRESSIBLE_CONTENT_TYPE_REGEX +}; diff --git a/tools/ui/node_modules/hono/dist/utils/concurrent.js b/tools/ui/node_modules/hono/dist/utils/concurrent.js new file mode 100644 index 0000000000000000000000000000000000000000..a9d4b6cc1ee522a84ef95ac05f17dc20f231b9a2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/concurrent.js @@ -0,0 +1,39 @@ +// src/utils/concurrent.ts +var DEFAULT_CONCURRENCY = 1024; +var createPool = ({ + concurrency, + interval +} = {}) => { + concurrency ||= DEFAULT_CONCURRENCY; + if (concurrency === Infinity) { + return { + run: async (fn) => fn() + }; + } + const pool = /* @__PURE__ */ new Set(); + const run = async (fn, promise, resolve) => { + if (pool.size >= concurrency) { + promise ||= new Promise((r) => resolve = r); + setTimeout(() => run(fn, promise, resolve)); + return promise; + } + const marker = {}; + pool.add(marker); + const result = await fn(); + if (interval) { + setTimeout(() => pool.delete(marker), interval); + } else { + pool.delete(marker); + } + if (resolve) { + resolve(result); + return promise; + } else { + return result; + } + }; + return { run }; +}; +export { + createPool +}; diff --git a/tools/ui/node_modules/hono/dist/utils/constants.js b/tools/ui/node_modules/hono/dist/utils/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..1c631659324784ccca1b5ac77ab2ee43b3b0e7b7 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/constants.js @@ -0,0 +1,5 @@ +// src/utils/constants.ts +var COMPOSED_HANDLER = "__COMPOSED_HANDLER"; +export { + COMPOSED_HANDLER +}; diff --git a/tools/ui/node_modules/hono/dist/utils/cookie.js b/tools/ui/node_modules/hono/dist/utils/cookie.js new file mode 100644 index 0000000000000000000000000000000000000000..c6cba58504bcc83a26671be71ae6b4e7c06f60cb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/cookie.js @@ -0,0 +1,174 @@ +// src/utils/cookie.ts +import { tryDecodeURIComponent } from "./url.js"; +var algorithm = { name: "HMAC", hash: "SHA-256" }; +var getCryptoKey = async (secret) => { + const secretBuf = typeof secret === "string" ? new TextEncoder().encode(secret) : secret; + return await crypto.subtle.importKey("raw", secretBuf, algorithm, false, ["sign", "verify"]); +}; +var makeSignature = async (value, secret) => { + const key = await getCryptoKey(secret); + const signature = await crypto.subtle.sign(algorithm.name, key, new TextEncoder().encode(value)); + return btoa(String.fromCharCode(...new Uint8Array(signature))); +}; +var verifySignature = async (base64Signature, value, secret) => { + try { + const signatureBinStr = atob(base64Signature); + const signature = new Uint8Array(signatureBinStr.length); + for (let i = 0, len = signatureBinStr.length; i < len; i++) { + signature[i] = signatureBinStr.charCodeAt(i); + } + return await crypto.subtle.verify(algorithm, secret, signature, new TextEncoder().encode(value)); + } catch { + return false; + } +}; +var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/; +var relaxedCookieNameRegEx = /^[!#-:<>-[\]-~]+$/; +var validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/; +var trimCookieWhitespace = (value) => { + let start = 0; + let end = value.length; + while (start < end) { + const charCode = value.charCodeAt(start); + if (charCode !== 32 && charCode !== 9) { + break; + } + start++; + } + while (end > start) { + const charCode = value.charCodeAt(end - 1); + if (charCode !== 32 && charCode !== 9) { + break; + } + end--; + } + return start === 0 && end === value.length ? value : value.slice(start, end); +}; +var parse = (cookie, name) => { + if (name && cookie.indexOf(name) === -1) { + return {}; + } + const pairs = cookie.split(";"); + const parsedCookie = /* @__PURE__ */ Object.create(null); + for (const pairStr of pairs) { + const valueStartPos = pairStr.indexOf("="); + if (valueStartPos === -1) { + continue; + } + const cookieName = trimCookieWhitespace(pairStr.substring(0, valueStartPos)); + if (name && name !== cookieName || !relaxedCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) { + continue; + } + let cookieValue = trimCookieWhitespace(pairStr.substring(valueStartPos + 1)); + if (cookieValue.startsWith('"') && cookieValue.endsWith('"')) { + cookieValue = cookieValue.slice(1, -1); + } + if (validCookieValueRegEx.test(cookieValue)) { + parsedCookie[cookieName] = tryDecodeURIComponent(cookieValue); + if (name) { + break; + } + } + } + return parsedCookie; +}; +var parseSigned = async (cookie, secret, name) => { + const parsedCookie = /* @__PURE__ */ Object.create(null); + const secretKey = await getCryptoKey(secret); + for (const [key, value] of Object.entries(parse(cookie, name))) { + const signatureStartPos = value.lastIndexOf("."); + if (signatureStartPos < 1) { + continue; + } + const signedValue = value.substring(0, signatureStartPos); + const signature = value.substring(signatureStartPos + 1); + if (signature.length !== 44 || !signature.endsWith("=")) { + continue; + } + const isVerified = await verifySignature(signature, signedValue, secretKey); + parsedCookie[key] = isVerified ? signedValue : false; + } + return parsedCookie; +}; +var _serialize = (name, value, opt = {}) => { + if (!validCookieNameRegEx.test(name)) { + throw new Error("Invalid cookie name"); + } + let cookie = `${name}=${value}`; + if (name.startsWith("__Secure-") && !opt.secure) { + throw new Error("__Secure- Cookie must have Secure attributes"); + } + if (name.startsWith("__Host-")) { + if (!opt.secure) { + throw new Error("__Host- Cookie must have Secure attributes"); + } + if (opt.path !== "/") { + throw new Error('__Host- Cookie must have Path attributes with "/"'); + } + if (opt.domain) { + throw new Error("__Host- Cookie must not have Domain attributes"); + } + } + for (const key of ["domain", "path", "sameSite", "priority"]) { + if (opt[key] && /[;\r\n]/.test(opt[key])) { + throw new Error(`${key} must not contain ";", "\\r", or "\\n"`); + } + } + if (opt && typeof opt.maxAge === "number" && opt.maxAge >= 0) { + if (opt.maxAge > 3456e4) { + throw new Error( + "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration." + ); + } + cookie += `; Max-Age=${opt.maxAge | 0}`; + } + if (opt.domain && opt.prefix !== "host") { + cookie += `; Domain=${opt.domain}`; + } + if (opt.path) { + cookie += `; Path=${opt.path}`; + } + if (opt.expires) { + if (opt.expires.getTime() - Date.now() > 3456e7) { + throw new Error( + "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future." + ); + } + cookie += `; Expires=${opt.expires.toUTCString()}`; + } + if (opt.httpOnly) { + cookie += "; HttpOnly"; + } + if (opt.secure) { + cookie += "; Secure"; + } + if (opt.sameSite) { + cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`; + } + if (opt.priority) { + cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`; + } + if (opt.partitioned) { + if (!opt.secure) { + throw new Error("Partitioned Cookie must have Secure attributes"); + } + cookie += "; Partitioned"; + } + return cookie; +}; +var serialize = (name, value, opt) => { + value = encodeURIComponent(value); + return _serialize(name, value, opt); +}; +var serializeSigned = async (name, value, secret, opt = {}) => { + const signature = await makeSignature(value, secret); + value = `${value}.${signature}`; + value = encodeURIComponent(value); + return _serialize(name, value, opt); +}; +export { + parse, + parseSigned, + serialize, + serializeSigned +}; diff --git a/tools/ui/node_modules/hono/dist/utils/crypto.js b/tools/ui/node_modules/hono/dist/utils/crypto.js new file mode 100644 index 0000000000000000000000000000000000000000..36772c4166bcd9a43dc90cd962d682f887063190 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/crypto.js @@ -0,0 +1,44 @@ +// src/utils/crypto.ts +var sha256 = async (data) => { + const algorithm = { name: "SHA-256", alias: "sha256" }; + const hash = await createHash(data, algorithm); + return hash; +}; +var sha1 = async (data) => { + const algorithm = { name: "SHA-1", alias: "sha1" }; + const hash = await createHash(data, algorithm); + return hash; +}; +var md5 = async (data) => { + const algorithm = { name: "MD5", alias: "md5" }; + const hash = await createHash(data, algorithm); + return hash; +}; +var createHash = async (data, algorithm) => { + let sourceBuffer; + if (ArrayBuffer.isView(data) || data instanceof ArrayBuffer) { + sourceBuffer = data; + } else { + if (typeof data === "object") { + data = JSON.stringify(data); + } + sourceBuffer = new TextEncoder().encode(String(data)); + } + if (crypto && crypto.subtle) { + const buffer = await crypto.subtle.digest( + { + name: algorithm.name + }, + sourceBuffer + ); + const hash = Array.prototype.map.call(new Uint8Array(buffer), (x) => ("00" + x.toString(16)).slice(-2)).join(""); + return hash; + } + return null; +}; +export { + createHash, + md5, + sha1, + sha256 +}; diff --git a/tools/ui/node_modules/hono/dist/utils/encode.js b/tools/ui/node_modules/hono/dist/utils/encode.js new file mode 100644 index 0000000000000000000000000000000000000000..d4ce6a7153cf107a55a67694aa10a754a69250be --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/encode.js @@ -0,0 +1,29 @@ +// src/utils/encode.ts +var decodeBase64Url = (str) => { + return decodeBase64(str.replace(/_|-/g, (m) => ({ _: "/", "-": "+" })[m] ?? m)); +}; +var encodeBase64Url = (buf) => encodeBase64(buf).replace(/\/|\+/g, (m) => ({ "/": "_", "+": "-" })[m] ?? m); +var encodeBase64 = (buf) => { + let binary = ""; + const bytes = new Uint8Array(buf); + for (let i = 0, len = bytes.length; i < len; i++) { + binary += String.fromCharCode(bytes[i]); + } + return btoa(binary); +}; +var decodeBase64 = (str) => { + const binary = atob(str); + const bytes = new Uint8Array(new ArrayBuffer(binary.length)); + const half = binary.length / 2; + for (let i = 0, j = binary.length - 1; i <= half; i++, j--) { + bytes[i] = binary.charCodeAt(i); + bytes[j] = binary.charCodeAt(j); + } + return bytes; +}; +export { + decodeBase64, + decodeBase64Url, + encodeBase64, + encodeBase64Url +}; diff --git a/tools/ui/node_modules/hono/dist/utils/filepath.js b/tools/ui/node_modules/hono/dist/utils/filepath.js new file mode 100644 index 0000000000000000000000000000000000000000..98ecb70e53db66c526eedae9227187a8a795471c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/filepath.js @@ -0,0 +1,35 @@ +// src/utils/filepath.ts +var getFilePath = (options) => { + let filename = options.filename; + const defaultDocument = options.defaultDocument || "index.html"; + if (filename.endsWith("/")) { + filename = filename.concat(defaultDocument); + } else if (!filename.match(/\.[a-zA-Z0-9_-]+$/)) { + filename = filename.concat("/" + defaultDocument); + } + const path = getFilePathWithoutDefaultDocument({ + root: options.root, + filename + }); + return path; +}; +var getFilePathWithoutDefaultDocument = (options) => { + let root = options.root || ""; + let filename = options.filename; + if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { + return; + } + filename = filename.replace(/^\.?[\/\\]/, ""); + filename = filename.replace(/\\/g, "/"); + root = root.replace(/\/$/, ""); + let path = root ? root + "/" + filename : filename; + path = path.replace(/^\.?\//, ""); + if (root[0] !== "/" && path[0] === "/") { + return; + } + return path; +}; +export { + getFilePath, + getFilePathWithoutDefaultDocument +}; diff --git a/tools/ui/node_modules/hono/dist/utils/handler.js b/tools/ui/node_modules/hono/dist/utils/handler.js new file mode 100644 index 0000000000000000000000000000000000000000..317ae658753f7fdfe5dd81ce9dba0c7104d47ef2 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/handler.js @@ -0,0 +1,13 @@ +// src/utils/handler.ts +import { COMPOSED_HANDLER } from "./constants.js"; +var isMiddleware = (handler) => handler.length > 1; +var findTargetHandler = (handler) => { + return handler[COMPOSED_HANDLER] ? ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + findTargetHandler(handler[COMPOSED_HANDLER]) + ) : handler; +}; +export { + findTargetHandler, + isMiddleware +}; diff --git a/tools/ui/node_modules/hono/dist/utils/headers.js b/tools/ui/node_modules/hono/dist/utils/headers.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/utils/html.js b/tools/ui/node_modules/hono/dist/utils/html.js new file mode 100644 index 0000000000000000000000000000000000000000..79f77723d1a048557a3935b532738cb9e6704ac1 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/html.js @@ -0,0 +1,123 @@ +// src/utils/html.ts +var HtmlEscapedCallbackPhase = { + Stringify: 1, + BeforeStream: 2, + Stream: 3 +}; +var raw = (value, callbacks) => { + const escapedString = new String(value); + escapedString.isEscaped = true; + escapedString.callbacks = callbacks; + return escapedString; +}; +var escapeRe = /[&<>'"]/; +var stringBufferToString = async (buffer, callbacks) => { + let str = ""; + callbacks ||= []; + const resolvedBuffer = await Promise.all(buffer); + for (let i = resolvedBuffer.length - 1; ; i--) { + str += resolvedBuffer[i]; + i--; + if (i < 0) { + break; + } + let r = resolvedBuffer[i]; + if (typeof r === "object") { + callbacks.push(...r.callbacks || []); + } + const isEscaped = r.isEscaped; + r = await (typeof r === "object" ? r.toString() : r); + if (typeof r === "object") { + callbacks.push(...r.callbacks || []); + } + if (r.isEscaped ?? isEscaped) { + str += r; + } else { + const buf = [str]; + escapeToBuffer(r, buf); + str = buf[0]; + } + } + return raw(str, callbacks); +}; +var escapeToBuffer = (str, buffer) => { + const match = str.search(escapeRe); + if (match === -1) { + buffer[0] += str; + return; + } + let escape; + let index; + let lastIndex = 0; + for (index = match; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escape = """; + break; + case 39: + escape = "'"; + break; + case 38: + escape = "&"; + break; + case 60: + escape = "<"; + break; + case 62: + escape = ">"; + break; + default: + continue; + } + buffer[0] += str.substring(lastIndex, index) + escape; + lastIndex = index + 1; + } + buffer[0] += str.substring(lastIndex, index); +}; +var resolveCallbackSync = (str) => { + const callbacks = str.callbacks; + if (!callbacks?.length) { + return str; + } + const buffer = [str]; + const context = {}; + callbacks.forEach((c) => c({ phase: HtmlEscapedCallbackPhase.Stringify, buffer, context })); + return buffer[0]; +}; +var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => { + if (typeof str === "object" && !(str instanceof String)) { + if (!(str instanceof Promise)) { + str = str.toString(); + } + if (str instanceof Promise) { + str = await str; + } + } + const callbacks = str.callbacks; + if (!callbacks?.length) { + return Promise.resolve(str); + } + if (buffer) { + buffer[0] += str; + } else { + buffer = [str]; + } + const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then( + (res) => Promise.all( + res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer)) + ).then(() => buffer[0]) + ); + if (preserveCallbacks) { + return raw(await resStr, callbacks); + } else { + return resStr; + } +}; +export { + HtmlEscapedCallbackPhase, + escapeToBuffer, + raw, + resolveCallback, + resolveCallbackSync, + stringBufferToString +}; diff --git a/tools/ui/node_modules/hono/dist/utils/http-status.js b/tools/ui/node_modules/hono/dist/utils/http-status.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/utils/ipaddr.js b/tools/ui/node_modules/hono/dist/utils/ipaddr.js new file mode 100644 index 0000000000000000000000000000000000000000..81639d38e89b2f3b2cd96a6fcc976dbade72ecda --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/ipaddr.js @@ -0,0 +1,288 @@ +// src/utils/ipaddr.ts +var expandIPv6 = (ipV6) => { + const sections = ipV6.split(":"); + if (IPV4_REGEX.test(sections.at(-1))) { + sections.splice( + -1, + 1, + ...convertIPv6BinaryToString(convertIPv4ToBinary(sections.at(-1))).substring(2).split(":") + // => ['7f00', '0001'] + ); + } + for (let i = 0; i < sections.length; i++) { + const node = sections[i]; + if (node !== "") { + sections[i] = node.padStart(4, "0"); + } else { + while (sections[i + 1] === "") { + sections.splice(i + 1, 1); + } + sections[i] = new Array(8 - sections.length + 1).fill("0000").join(":"); + } + } + return sections.join(":"); +}; +var IPV4_OCTET_PART = "(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])"; +var IPV4_REGEX = new RegExp(`^(?:${IPV4_OCTET_PART}\\.){3}${IPV4_OCTET_PART}$`); +var INVALID_IP_ADDRESS_ERROR_CODE = "ERR_INVALID_IP_ADDRESS"; +var CHAR_CODE_0 = 48; +var CHAR_CODE_9 = 57; +var CHAR_CODE_A = 65; +var CHAR_CODE_F = 70; +var CHAR_CODE_a = 97; +var CHAR_CODE_f = 102; +var CHAR_CODE_DOT = 46; +var CHAR_CODE_COLON = 58; +var CHAR_CODE_PERCENT = 37; +var distinctRemoteAddr = (remoteAddr) => { + if (IPV4_REGEX.test(remoteAddr)) { + return "IPv4"; + } + if (remoteAddr.includes(":")) { + return "IPv6"; + } +}; +var createInvalidIPAddressError = (message) => { + const error = new TypeError(message); + error.code = INVALID_IP_ADDRESS_ERROR_CODE; + return error; +}; +var throwInvalidIPv4Address = (ipv4) => { + throw createInvalidIPAddressError(`Invalid IPv4 address: ${ipv4}`); +}; +var throwInvalidIPv6Address = (ipv6) => { + throw createInvalidIPAddressError(`Invalid IPv6 address: ${ipv6}`); +}; +var parseIPv4ToBinary = (ipv4, start, end, onInvalid) => { + let result = 0n; + let octets = 0; + let octet = 0; + let digits = 0; + let firstDigit = 0; + for (let i = start; i <= end; i++) { + const code = i < end ? ipv4.charCodeAt(i) : CHAR_CODE_DOT; + if (code >= CHAR_CODE_0 && code <= CHAR_CODE_9) { + if (digits === 0) { + firstDigit = code; + } else if (firstDigit === CHAR_CODE_0) { + onInvalid(); + } + octet = octet * 10 + code - CHAR_CODE_0; + if (octet > 255) { + onInvalid(); + } + digits++; + continue; + } + if (code !== CHAR_CODE_DOT || digits === 0 || octets === 4) { + onInvalid(); + } + result = (result << 8n) + BigInt(octet); + octets++; + octet = 0; + digits = 0; + } + if (octets !== 4) { + onInvalid(); + } + return result; +}; +var parseIPv6HexCode = (code) => { + if (code >= CHAR_CODE_0 && code <= CHAR_CODE_9) { + return code - CHAR_CODE_0; + } + if (code >= CHAR_CODE_A && code <= CHAR_CODE_F) { + return code - CHAR_CODE_A + 10; + } + if (code >= CHAR_CODE_a && code <= CHAR_CODE_f) { + return code - CHAR_CODE_a + 10; + } + return -1; +}; +var isIPv6LinkLocal = (ipv6binary) => ipv6binary >> 118n === 0x3fan; +var convertIPv4ToBinary = (ipv4) => { + return parseIPv4ToBinary(ipv4, 0, ipv4.length, () => throwInvalidIPv4Address(ipv4)); +}; +var convertIPv6ToBinary = (ipv6) => { + const length = ipv6.length; + const sections = []; + let hasZoneId = false; + let compressAt = -1; + let index = 0; + if (length === 0) { + throwInvalidIPv6Address(ipv6); + } + while (index < length) { + if (sections.length > 8) { + throwInvalidIPv6Address(ipv6); + } + let code = ipv6.charCodeAt(index); + if (code === CHAR_CODE_PERCENT) { + if (index + 1 === length) { + throwInvalidIPv6Address(ipv6); + } + hasZoneId = true; + break; + } + if (code === CHAR_CODE_COLON) { + if (index + 1 < length && ipv6.charCodeAt(index + 1) === CHAR_CODE_COLON) { + if (compressAt !== -1) { + throwInvalidIPv6Address(ipv6); + } + compressAt = sections.length; + index += 2; + continue; + } + throwInvalidIPv6Address(ipv6); + } + let value = 0; + let digits = 0; + const sectionStart = index; + while (index < length) { + code = ipv6.charCodeAt(index); + const hex = parseIPv6HexCode(code); + if (hex === -1) { + break; + } + if (digits === 4) { + throwInvalidIPv6Address(ipv6); + } + value = value << 4 | hex; + digits++; + index++; + } + if (index < length && ipv6.charCodeAt(index) === CHAR_CODE_DOT) { + let ipv4End = length; + for (let i = index; i < length; i++) { + if (ipv6.charCodeAt(i) === CHAR_CODE_PERCENT) { + if (i + 1 === length) { + throwInvalidIPv6Address(ipv6); + } + hasZoneId = true; + ipv4End = i; + break; + } + } + const ipv4 = parseIPv4ToBinary( + ipv6, + sectionStart, + ipv4End, + () => throwInvalidIPv6Address(ipv6) + ); + sections.push(Number(ipv4 >> 16n & 0xffffn), Number(ipv4 & 0xffffn)); + index = length; + break; + } + if (digits === 0) { + throwInvalidIPv6Address(ipv6); + } + sections.push(value); + if (index === length) { + break; + } + code = ipv6.charCodeAt(index); + if (code === CHAR_CODE_PERCENT) { + if (index + 1 === length) { + throwInvalidIPv6Address(ipv6); + } + hasZoneId = true; + break; + } + if (code !== CHAR_CODE_COLON) { + throwInvalidIPv6Address(ipv6); + } + if (index + 1 < length && ipv6.charCodeAt(index + 1) === CHAR_CODE_COLON) { + if (compressAt !== -1) { + throwInvalidIPv6Address(ipv6); + } + compressAt = sections.length; + index += 2; + continue; + } + index++; + if (index === length) { + throwInvalidIPv6Address(ipv6); + } + } + if (compressAt === -1 ? sections.length !== 8 : sections.length >= 8) { + throwInvalidIPv6Address(ipv6); + } + let result = 0n; + const zeros = compressAt === -1 ? 0 : 8 - sections.length; + const firstSectionEnd = compressAt === -1 ? sections.length : compressAt; + for (let i = 0; i < firstSectionEnd; i++) { + result <<= 16n; + result += BigInt(sections[i]); + } + for (let i = 0; i < zeros; i++) { + result <<= 16n; + } + for (let i = firstSectionEnd; i < sections.length; i++) { + result <<= 16n; + result += BigInt(sections[i]); + } + if (hasZoneId && !isIPv6LinkLocal(result)) { + throwInvalidIPv6Address(ipv6); + } + return result; +}; +var convertIPv4BinaryToString = (ipV4) => { + const sections = []; + for (let i = 0; i < 4; i++) { + sections.push(ipV4 >> BigInt(8 * (3 - i)) & 0xffn); + } + return sections.join("."); +}; +var isIPv4MappedIPv6 = (ipv6binary) => ipv6binary >> 32n === 0xffffn; +var convertIPv4MappedIPv6ToIPv4 = (ipv6binary) => ipv6binary & 0xffffffffn; +var convertIPv6BinaryToString = (ipV6) => { + if (ipV6 === 0n) { + return "::"; + } + if (isIPv4MappedIPv6(ipV6)) { + return `::ffff:${convertIPv4BinaryToString(convertIPv4MappedIPv6ToIPv4(ipV6))}`; + } + const sections = []; + for (let i = 0; i < 8; i++) { + sections.push((ipV6 >> BigInt(16 * (7 - i)) & 0xffffn).toString(16)); + } + let currentZeroStart = -1; + let maxZeroStart = -1; + let maxZeroEnd = -1; + for (let i = 0; i < 8; i++) { + if (sections[i] === "0") { + if (currentZeroStart === -1) { + currentZeroStart = i; + } + } else { + if (currentZeroStart > -1) { + if (i - currentZeroStart > maxZeroEnd - maxZeroStart) { + maxZeroStart = currentZeroStart; + maxZeroEnd = i; + } + currentZeroStart = -1; + } + } + } + if (currentZeroStart > -1) { + if (8 - currentZeroStart > maxZeroEnd - maxZeroStart) { + maxZeroStart = currentZeroStart; + maxZeroEnd = 8; + } + } + if (maxZeroStart !== -1 && maxZeroEnd - maxZeroStart > 1) { + sections.splice(maxZeroStart, maxZeroEnd - maxZeroStart, ":"); + } + return sections.join(":").replace(/:{2,}/g, "::"); +}; +export { + INVALID_IP_ADDRESS_ERROR_CODE, + convertIPv4BinaryToString, + convertIPv4MappedIPv6ToIPv4, + convertIPv4ToBinary, + convertIPv6BinaryToString, + convertIPv6ToBinary, + distinctRemoteAddr, + expandIPv6, + isIPv4MappedIPv6 +}; diff --git a/tools/ui/node_modules/hono/dist/utils/jwt/index.js b/tools/ui/node_modules/hono/dist/utils/jwt/index.js new file mode 100644 index 0000000000000000000000000000000000000000..25467d1daeaf98827b4289c8d9bbcb6a3c7e5751 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/jwt/index.js @@ -0,0 +1,6 @@ +// src/utils/jwt/index.ts +import { decode, sign, verify, verifyWithJwks } from "./jwt.js"; +var Jwt = { sign, verify, decode, verifyWithJwks }; +export { + Jwt +}; diff --git a/tools/ui/node_modules/hono/dist/utils/jwt/jwa.js b/tools/ui/node_modules/hono/dist/utils/jwt/jwa.js new file mode 100644 index 0000000000000000000000000000000000000000..6331192990cb6e0df4545d9c748fff8a8711cc40 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/jwt/jwa.js @@ -0,0 +1,20 @@ +// src/utils/jwt/jwa.ts +var AlgorithmTypes = /* @__PURE__ */ ((AlgorithmTypes2) => { + AlgorithmTypes2["HS256"] = "HS256"; + AlgorithmTypes2["HS384"] = "HS384"; + AlgorithmTypes2["HS512"] = "HS512"; + AlgorithmTypes2["RS256"] = "RS256"; + AlgorithmTypes2["RS384"] = "RS384"; + AlgorithmTypes2["RS512"] = "RS512"; + AlgorithmTypes2["PS256"] = "PS256"; + AlgorithmTypes2["PS384"] = "PS384"; + AlgorithmTypes2["PS512"] = "PS512"; + AlgorithmTypes2["ES256"] = "ES256"; + AlgorithmTypes2["ES384"] = "ES384"; + AlgorithmTypes2["ES512"] = "ES512"; + AlgorithmTypes2["EdDSA"] = "EdDSA"; + return AlgorithmTypes2; +})(AlgorithmTypes || {}); +export { + AlgorithmTypes +}; diff --git a/tools/ui/node_modules/hono/dist/utils/jwt/jws.js b/tools/ui/node_modules/hono/dist/utils/jwt/jws.js new file mode 100644 index 0000000000000000000000000000000000000000..c3915eead008daaadc6470fe5bfd0a11406e0c4e --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/jwt/jws.js @@ -0,0 +1,192 @@ +// src/utils/jwt/jws.ts +import { getRuntimeKey } from "../../helper/adapter/index.js"; +import { decodeBase64 } from "../encode.js"; +import { CryptoKeyUsage, JwtAlgorithmNotImplemented } from "./types.js"; +import { utf8Encoder } from "./utf8.js"; +async function signing(privateKey, alg, data) { + const algorithm = getKeyAlgorithm(alg); + const cryptoKey = await importPrivateKey(privateKey, algorithm); + return await crypto.subtle.sign(algorithm, cryptoKey, data); +} +async function verifying(publicKey, alg, signature, data) { + const algorithm = getKeyAlgorithm(alg); + const cryptoKey = await importPublicKey(publicKey, algorithm); + return await crypto.subtle.verify(algorithm, cryptoKey, signature, data); +} +function pemToBinary(pem) { + return decodeBase64(pem.replace(/-+(BEGIN|END).*?-+/g, "").replace(/\s/g, "")); +} +async function importPrivateKey(key, alg) { + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); + } + if (isCryptoKey(key)) { + if (key.type !== "private" && key.type !== "secret") { + throw new Error( + `unexpected key type: CryptoKey.type is ${key.type}, expected private or secret` + ); + } + return key; + } + const usages = [CryptoKeyUsage.Sign]; + if (typeof key === "object") { + return await crypto.subtle.importKey("jwk", key, alg, false, usages); + } + if (key.includes("PRIVATE")) { + return await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, false, usages); + } + return await crypto.subtle.importKey("raw", utf8Encoder.encode(key), alg, false, usages); +} +async function importPublicKey(key, alg) { + if (!crypto.subtle || !crypto.subtle.importKey) { + throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it."); + } + if (isCryptoKey(key)) { + if (key.type === "public" || key.type === "secret") { + return key; + } + key = await exportPublicJwkFrom(key); + } + if (typeof key === "string" && key.includes("PRIVATE")) { + const privateKey = await crypto.subtle.importKey("pkcs8", pemToBinary(key), alg, true, [ + CryptoKeyUsage.Sign + ]); + key = await exportPublicJwkFrom(privateKey); + } + const usages = [CryptoKeyUsage.Verify]; + if (typeof key === "object") { + return await crypto.subtle.importKey("jwk", key, alg, false, usages); + } + if (key.includes("PUBLIC")) { + return await crypto.subtle.importKey("spki", pemToBinary(key), alg, false, usages); + } + return await crypto.subtle.importKey("raw", utf8Encoder.encode(key), alg, false, usages); +} +async function exportPublicJwkFrom(privateKey) { + if (privateKey.type !== "private") { + throw new Error(`unexpected key type: ${privateKey.type}`); + } + if (!privateKey.extractable) { + throw new Error("unexpected private key is unextractable"); + } + const jwk = await crypto.subtle.exportKey("jwk", privateKey); + const { kty } = jwk; + const { alg, e, n } = jwk; + const { crv, x, y } = jwk; + return { kty, alg, e, n, crv, x, y, key_ops: [CryptoKeyUsage.Verify] }; +} +function getKeyAlgorithm(name) { + switch (name) { + case "HS256": + return { + name: "HMAC", + hash: { + name: "SHA-256" + } + }; + case "HS384": + return { + name: "HMAC", + hash: { + name: "SHA-384" + } + }; + case "HS512": + return { + name: "HMAC", + hash: { + name: "SHA-512" + } + }; + case "RS256": + return { + name: "RSASSA-PKCS1-v1_5", + hash: { + name: "SHA-256" + } + }; + case "RS384": + return { + name: "RSASSA-PKCS1-v1_5", + hash: { + name: "SHA-384" + } + }; + case "RS512": + return { + name: "RSASSA-PKCS1-v1_5", + hash: { + name: "SHA-512" + } + }; + case "PS256": + return { + name: "RSA-PSS", + hash: { + name: "SHA-256" + }, + saltLength: 32 + // 256 >> 3 + }; + case "PS384": + return { + name: "RSA-PSS", + hash: { + name: "SHA-384" + }, + saltLength: 48 + // 384 >> 3 + }; + case "PS512": + return { + name: "RSA-PSS", + hash: { + name: "SHA-512" + }, + saltLength: 64 + // 512 >> 3, + }; + case "ES256": + return { + name: "ECDSA", + hash: { + name: "SHA-256" + }, + namedCurve: "P-256" + }; + case "ES384": + return { + name: "ECDSA", + hash: { + name: "SHA-384" + }, + namedCurve: "P-384" + }; + case "ES512": + return { + name: "ECDSA", + hash: { + name: "SHA-512" + }, + namedCurve: "P-521" + }; + case "EdDSA": + return { + name: "Ed25519", + namedCurve: "Ed25519" + }; + default: + throw new JwtAlgorithmNotImplemented(name); + } +} +function isCryptoKey(key) { + const runtime = getRuntimeKey(); + if (runtime === "node" && !!crypto.webcrypto) { + return key instanceof crypto.webcrypto.CryptoKey; + } + return key instanceof CryptoKey; +} +export { + signing, + verifying +}; diff --git a/tools/ui/node_modules/hono/dist/utils/jwt/jwt.js b/tools/ui/node_modules/hono/dist/utils/jwt/jwt.js new file mode 100644 index 0000000000000000000000000000000000000000..f369b9f9622c30118aa08493c82e46014fb4f5a4 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/jwt/jwt.js @@ -0,0 +1,207 @@ +// src/utils/jwt/jwt.ts +import { decodeBase64Url, encodeBase64Url } from "../../utils/encode.js"; +import { AlgorithmTypes } from "./jwa.js"; +import { signing, verifying } from "./jws.js"; +import { + JwtAlgorithmMismatch, + JwtAlgorithmNotAllowed, + JwtAlgorithmRequired, + JwtHeaderInvalid, + JwtHeaderRequiresKid, + JwtPayloadRequiresAud, + JwtSymmetricAlgorithmNotAllowed, + JwtTokenAudience, + JwtTokenExpired, + JwtTokenInvalid, + JwtTokenIssuedAt, + JwtTokenIssuer, + JwtTokenNotBefore, + JwtTokenSignatureMismatched +} from "./types.js"; +import { utf8Decoder, utf8Encoder } from "./utf8.js"; +var encodeJwtPart = (part) => encodeBase64Url(utf8Encoder.encode(JSON.stringify(part)).buffer).replace(/=/g, ""); +var encodeSignaturePart = (buf) => encodeBase64Url(buf).replace(/=/g, ""); +var decodeJwtPart = (part) => JSON.parse(utf8Decoder.decode(decodeBase64Url(part))); +function isTokenHeader(obj) { + if (typeof obj === "object" && obj !== null) { + const objWithAlg = obj; + return "alg" in objWithAlg && Object.values(AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT"); + } + return false; +} +var sign = async (payload, privateKey, alg = "HS256") => { + const encodedPayload = encodeJwtPart(payload); + let encodedHeader; + if (typeof privateKey === "object" && "alg" in privateKey) { + alg = privateKey.alg; + encodedHeader = encodeJwtPart({ alg, typ: "JWT", kid: privateKey.kid }); + } else { + encodedHeader = encodeJwtPart({ alg, typ: "JWT" }); + } + const partialToken = `${encodedHeader}.${encodedPayload}`; + const signaturePart = await signing(privateKey, alg, utf8Encoder.encode(partialToken)); + const signature = encodeSignaturePart(signaturePart); + return `${partialToken}.${signature}`; +}; +var verify = async (token, publicKey, algOrOptions) => { + if (!algOrOptions) { + throw new JwtAlgorithmRequired(); + } + const { + alg, + iss, + nbf = true, + exp = true, + iat = true, + aud + } = typeof algOrOptions === "string" ? { alg: algOrOptions } : algOrOptions; + if (!alg) { + throw new JwtAlgorithmRequired(); + } + const tokenParts = token.split("."); + if (tokenParts.length !== 3) { + throw new JwtTokenInvalid(token); + } + const { header, payload } = decode(token); + if (!isTokenHeader(header)) { + throw new JwtHeaderInvalid(header); + } + if (header.alg !== alg) { + throw new JwtAlgorithmMismatch(alg, header.alg); + } + const now = Math.floor(Date.now() / 1e3); + if (nbf && payload.nbf !== void 0) { + if (typeof payload.nbf !== "number" || !Number.isFinite(payload.nbf) || payload.nbf > now) { + throw new JwtTokenNotBefore(token); + } + } + if (exp && payload.exp !== void 0) { + if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp) || payload.exp <= now) { + throw new JwtTokenExpired(token); + } + } + if (iat && payload.iat !== void 0) { + if (typeof payload.iat !== "number" || !Number.isFinite(payload.iat) || now < payload.iat) { + throw new JwtTokenIssuedAt(now, payload.iat); + } + } + if (iss) { + if (!payload.iss) { + throw new JwtTokenIssuer(iss, null); + } + if (typeof iss === "string" && payload.iss !== iss) { + throw new JwtTokenIssuer(iss, payload.iss); + } + if (iss instanceof RegExp && !iss.test(payload.iss)) { + throw new JwtTokenIssuer(iss, payload.iss); + } + } + if (aud) { + if (!payload.aud) { + throw new JwtPayloadRequiresAud(payload); + } + const audiences = Array.isArray(payload.aud) ? payload.aud : [payload.aud]; + const matched = audiences.some( + (payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud) + ); + if (!matched) { + throw new JwtTokenAudience(aud, payload.aud); + } + } + const headerPayload = token.substring(0, token.lastIndexOf(".")); + const verified = await verifying( + publicKey, + alg, + decodeBase64Url(tokenParts[2]), + utf8Encoder.encode(headerPayload) + ); + if (!verified) { + throw new JwtTokenSignatureMismatched(token); + } + return payload; +}; +var symmetricAlgorithms = [ + AlgorithmTypes.HS256, + AlgorithmTypes.HS384, + AlgorithmTypes.HS512 +]; +var verifyWithJwks = async (token, options, init) => { + const verifyOpts = options.verification || {}; + const header = decodeHeader(token); + if (!isTokenHeader(header)) { + throw new JwtHeaderInvalid(header); + } + if (!header.kid) { + throw new JwtHeaderRequiresKid(header); + } + if (symmetricAlgorithms.includes(header.alg)) { + throw new JwtSymmetricAlgorithmNotAllowed(header.alg); + } + if (!options.allowedAlgorithms.includes(header.alg)) { + throw new JwtAlgorithmNotAllowed(header.alg, options.allowedAlgorithms); + } + let verifyKeys = options.keys ? [...options.keys] : void 0; + if (options.jwks_uri) { + const response = await fetch(options.jwks_uri, init); + if (!response.ok) { + throw new Error(`failed to fetch JWKS from ${options.jwks_uri}`); + } + const data = await response.json(); + if (!data.keys) { + throw new Error('invalid JWKS response. "keys" field is missing'); + } + if (!Array.isArray(data.keys)) { + throw new Error('invalid JWKS response. "keys" field is not an array'); + } + verifyKeys ??= []; + verifyKeys.push(...data.keys); + } else if (!verifyKeys) { + throw new Error('verifyWithJwks requires options for either "keys" or "jwks_uri" or both'); + } + const matchingKey = verifyKeys.find((key) => key.kid === header.kid); + if (!matchingKey) { + throw new JwtTokenInvalid(token); + } + if (matchingKey.alg && matchingKey.alg !== header.alg) { + throw new JwtAlgorithmMismatch(matchingKey.alg, header.alg); + } + return await verify(token, matchingKey, { + alg: header.alg, + ...verifyOpts + }); +}; +var decode = (token) => { + const parts = token.split("."); + if (parts.length !== 3) { + throw new JwtTokenInvalid(token); + } + try { + const header = decodeJwtPart(parts[0]); + const payload = decodeJwtPart(parts[1]); + return { + header, + payload + }; + } catch { + throw new JwtTokenInvalid(token); + } +}; +var decodeHeader = (token) => { + const parts = token.split("."); + if (parts.length !== 3) { + throw new JwtTokenInvalid(token); + } + try { + return decodeJwtPart(parts[0]); + } catch { + throw new JwtTokenInvalid(token); + } +}; +export { + decode, + decodeHeader, + isTokenHeader, + sign, + verify, + verifyWithJwks +}; diff --git a/tools/ui/node_modules/hono/dist/utils/jwt/types.js b/tools/ui/node_modules/hono/dist/utils/jwt/types.js new file mode 100644 index 0000000000000000000000000000000000000000..253427c78c7ce608aa5d1e30ee642a2104d3f899 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/jwt/types.js @@ -0,0 +1,124 @@ +// src/utils/jwt/types.ts +var JwtAlgorithmNotImplemented = class extends Error { + constructor(alg) { + super(`${alg} is not an implemented algorithm`); + this.name = "JwtAlgorithmNotImplemented"; + } +}; +var JwtAlgorithmRequired = class extends Error { + constructor() { + super('JWT verification requires "alg" option to be specified'); + this.name = "JwtAlgorithmRequired"; + } +}; +var JwtAlgorithmMismatch = class extends Error { + constructor(expected, actual) { + super(`JWT algorithm mismatch: expected "${expected}", got "${actual}"`); + this.name = "JwtAlgorithmMismatch"; + } +}; +var JwtTokenInvalid = class extends Error { + constructor(token) { + super(`invalid JWT token: ${token}`); + this.name = "JwtTokenInvalid"; + } +}; +var JwtTokenNotBefore = class extends Error { + constructor(token) { + super(`token (${token}) is being used before it's valid`); + this.name = "JwtTokenNotBefore"; + } +}; +var JwtTokenExpired = class extends Error { + constructor(token) { + super(`token (${token}) expired`); + this.name = "JwtTokenExpired"; + } +}; +var JwtTokenIssuedAt = class extends Error { + constructor(currentTimestamp, iat) { + super( + `Invalid "iat" claim, must be a valid number lower than "${currentTimestamp}" (iat: "${iat}")` + ); + this.name = "JwtTokenIssuedAt"; + } +}; +var JwtTokenIssuer = class extends Error { + constructor(expected, iss) { + super(`expected issuer "${expected}", got ${iss ? `"${iss}"` : "none"} `); + this.name = "JwtTokenIssuer"; + } +}; +var JwtHeaderInvalid = class extends Error { + constructor(header) { + super(`jwt header is invalid: ${JSON.stringify(header)}`); + this.name = "JwtHeaderInvalid"; + } +}; +var JwtHeaderRequiresKid = class extends Error { + constructor(header) { + super(`required "kid" in jwt header: ${JSON.stringify(header)}`); + this.name = "JwtHeaderRequiresKid"; + } +}; +var JwtSymmetricAlgorithmNotAllowed = class extends Error { + constructor(alg) { + super(`symmetric algorithm "${alg}" is not allowed for JWK verification`); + this.name = "JwtSymmetricAlgorithmNotAllowed"; + } +}; +var JwtAlgorithmNotAllowed = class extends Error { + constructor(alg, allowedAlgorithms) { + super(`algorithm "${alg}" is not in the allowed list: [${allowedAlgorithms.join(", ")}]`); + this.name = "JwtAlgorithmNotAllowed"; + } +}; +var JwtTokenSignatureMismatched = class extends Error { + constructor(token) { + super(`token(${token}) signature mismatched`); + this.name = "JwtTokenSignatureMismatched"; + } +}; +var JwtPayloadRequiresAud = class extends Error { + constructor(payload) { + super(`required "aud" in jwt payload: ${JSON.stringify(payload)}`); + this.name = "JwtPayloadRequiresAud"; + } +}; +var JwtTokenAudience = class extends Error { + constructor(expected, aud) { + super( + `expected audience "${Array.isArray(expected) ? expected.join(", ") : expected}", got "${aud}"` + ); + this.name = "JwtTokenAudience"; + } +}; +var CryptoKeyUsage = /* @__PURE__ */ ((CryptoKeyUsage2) => { + CryptoKeyUsage2["Encrypt"] = "encrypt"; + CryptoKeyUsage2["Decrypt"] = "decrypt"; + CryptoKeyUsage2["Sign"] = "sign"; + CryptoKeyUsage2["Verify"] = "verify"; + CryptoKeyUsage2["DeriveKey"] = "deriveKey"; + CryptoKeyUsage2["DeriveBits"] = "deriveBits"; + CryptoKeyUsage2["WrapKey"] = "wrapKey"; + CryptoKeyUsage2["UnwrapKey"] = "unwrapKey"; + return CryptoKeyUsage2; +})(CryptoKeyUsage || {}); +export { + CryptoKeyUsage, + JwtAlgorithmMismatch, + JwtAlgorithmNotAllowed, + JwtAlgorithmNotImplemented, + JwtAlgorithmRequired, + JwtHeaderInvalid, + JwtHeaderRequiresKid, + JwtPayloadRequiresAud, + JwtSymmetricAlgorithmNotAllowed, + JwtTokenAudience, + JwtTokenExpired, + JwtTokenInvalid, + JwtTokenIssuedAt, + JwtTokenIssuer, + JwtTokenNotBefore, + JwtTokenSignatureMismatched +}; diff --git a/tools/ui/node_modules/hono/dist/utils/jwt/utf8.js b/tools/ui/node_modules/hono/dist/utils/jwt/utf8.js new file mode 100644 index 0000000000000000000000000000000000000000..3cd9f0eac489b722f050789c0de29963fa116948 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/jwt/utf8.js @@ -0,0 +1,7 @@ +// src/utils/jwt/utf8.ts +var utf8Encoder = new TextEncoder(); +var utf8Decoder = new TextDecoder(); +export { + utf8Decoder, + utf8Encoder +}; diff --git a/tools/ui/node_modules/hono/dist/utils/mime.js b/tools/ui/node_modules/hono/dist/utils/mime.js new file mode 100644 index 0000000000000000000000000000000000000000..7643edd35dcbf84de7a78580256308877594cffb --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/mime.js @@ -0,0 +1,82 @@ +// src/utils/mime.ts +var getMimeType = (filename, mimes = baseMimes) => { + const regexp = /\.([a-zA-Z0-9]+?)$/; + const match = filename.match(regexp); + if (!match) { + return; + } + return mimes[match[1].toLowerCase()]; +}; +var getExtension = (mimeType) => { + const baseType = mimeType.split(";", 1)[0].trim(); + for (const ext in baseMimes) { + const stored = baseMimes[ext]; + if (stored === mimeType || stored.split(";", 1)[0].trim() === baseType) { + return ext; + } + } +}; +var _baseMimes = { + aac: "audio/aac", + avi: "video/x-msvideo", + avif: "image/avif", + av1: "video/av1", + bin: "application/octet-stream", + bmp: "image/bmp", + css: "text/css; charset=utf-8", + csv: "text/csv; charset=utf-8", + eot: "application/vnd.ms-fontobject", + epub: "application/epub+zip", + gif: "image/gif", + gz: "application/gzip", + htm: "text/html; charset=utf-8", + html: "text/html; charset=utf-8", + ico: "image/x-icon", + ics: "text/calendar; charset=utf-8", + jpeg: "image/jpeg", + jpg: "image/jpeg", + js: "text/javascript; charset=utf-8", + json: "application/json", + jsonld: "application/ld+json", + map: "application/json", + mid: "audio/x-midi", + midi: "audio/x-midi", + mjs: "text/javascript; charset=utf-8", + mp3: "audio/mpeg", + mp4: "video/mp4", + mpeg: "video/mpeg", + oga: "audio/ogg", + ogv: "video/ogg", + ogx: "application/ogg", + opus: "audio/opus", + otf: "font/otf", + pdf: "application/pdf", + png: "image/png", + rtf: "application/rtf", + svg: "image/svg+xml; charset=utf-8", + tif: "image/tiff", + tiff: "image/tiff", + ts: "video/mp2t", + ttf: "font/ttf", + txt: "text/plain; charset=utf-8", + wasm: "application/wasm", + webm: "video/webm", + weba: "audio/webm", + webmanifest: "application/manifest+json", + webp: "image/webp", + woff: "font/woff", + woff2: "font/woff2", + xhtml: "application/xhtml+xml; charset=utf-8", + xml: "application/xml; charset=utf-8", + zip: "application/zip", + "3gp": "video/3gpp", + "3g2": "video/3gpp2", + gltf: "model/gltf+json", + glb: "model/gltf-binary" +}; +var baseMimes = _baseMimes; +export { + getExtension, + getMimeType, + baseMimes as mimes +}; diff --git a/tools/ui/node_modules/hono/dist/utils/stream.js b/tools/ui/node_modules/hono/dist/utils/stream.js new file mode 100644 index 0000000000000000000000000000000000000000..f4e8f1a55e3011318416a6f14b1297881e4bf7ab --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/stream.js @@ -0,0 +1,81 @@ +// src/utils/stream.ts +var StreamingApi = class { + writer; + encoder; + writable; + abortSubscribers = []; + responseReadable; + /** + * Whether the stream has been aborted. + */ + aborted = false; + /** + * Whether the stream has been closed normally. + */ + closed = false; + constructor(writable, _readable) { + this.writable = writable; + this.writer = writable.getWriter(); + this.encoder = new TextEncoder(); + const reader = _readable.getReader(); + this.abortSubscribers.push(async () => { + await reader.cancel(); + }); + this.responseReadable = new ReadableStream({ + async pull(controller) { + const { done, value } = await reader.read(); + done ? controller.close() : controller.enqueue(value); + }, + cancel: () => { + if (!this.closed) { + this.abort(); + } + } + }); + } + async write(input) { + try { + if (typeof input === "string") { + input = this.encoder.encode(input); + } + await this.writer.write(input); + } catch { + } + return this; + } + async writeln(input) { + await this.write(input + "\n"); + return this; + } + sleep(ms) { + return new Promise((res) => setTimeout(res, ms)); + } + async close() { + this.closed = true; + try { + await this.writer.close(); + } catch { + } + } + async pipe(body) { + this.writer.releaseLock(); + await body.pipeTo(this.writable, { preventClose: true }); + this.writer = this.writable.getWriter(); + } + onAbort(listener) { + this.abortSubscribers.push(listener); + } + /** + * Abort the stream. + * You can call this method when stream is aborted by external event. + */ + abort() { + if (!this.aborted) { + this.aborted = true; + this.abortSubscribers.forEach((subscriber) => subscriber()); + } + } +}; +export { + StreamingApi +}; diff --git a/tools/ui/node_modules/hono/dist/utils/types.js b/tools/ui/node_modules/hono/dist/utils/types.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/utils/url.js b/tools/ui/node_modules/hono/dist/utils/url.js new file mode 100644 index 0000000000000000000000000000000000000000..ffcacd85b4ae2fab12e7a25686735c31b4a70add --- /dev/null +++ b/tools/ui/node_modules/hono/dist/utils/url.js @@ -0,0 +1,221 @@ +// src/utils/url.ts +var splitPath = (path) => { + const paths = path.split("/"); + if (paths[0] === "") { + paths.shift(); + } + return paths; +}; +var splitRoutingPath = (routePath) => { + const { groups, path } = extractGroupsFromPath(routePath); + const paths = splitPath(path); + return replaceGroupMarks(paths, groups); +}; +var extractGroupsFromPath = (path) => { + const groups = []; + path = path.replace(/\{[^}]+\}/g, (match, index) => { + const mark = `@${index}`; + groups.push([mark, match]); + return mark; + }); + return { groups, path }; +}; +var replaceGroupMarks = (paths, groups) => { + for (let i = groups.length - 1; i >= 0; i--) { + const [mark] = groups[i]; + for (let j = paths.length - 1; j >= 0; j--) { + if (paths[j].includes(mark)) { + paths[j] = paths[j].replace(mark, groups[i][1]); + break; + } + } + } + return paths; +}; +var patternCache = {}; +var getPattern = (label, next) => { + if (label === "*") { + return "*"; + } + const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/); + if (match) { + const cacheKey = `${label}#${next}`; + if (!patternCache[cacheKey]) { + if (match[2]) { + patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match[1], new RegExp(`^${match[2]}(?=/${next})`)] : [label, match[1], new RegExp(`^${match[2]}$`)]; + } else { + patternCache[cacheKey] = [label, match[1], true]; + } + } + return patternCache[cacheKey]; + } + return null; +}; +var tryDecode = (str, decoder) => { + try { + return decoder(str); + } catch { + return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => { + try { + return decoder(match); + } catch { + return match; + } + }); + } +}; +var tryDecodeURI = (str) => tryDecode(str, decodeURI); +var getPath = (request) => { + const url = request.url; + const start = url.indexOf("/", url.indexOf(":") + 4); + let i = start; + for (; i < url.length; i++) { + const charCode = url.charCodeAt(i); + if (charCode === 37) { + const queryIndex = url.indexOf("?", i); + const hashIndex = url.indexOf("#", i); + const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex); + const path = url.slice(start, end); + return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path); + } else if (charCode === 63 || charCode === 35) { + break; + } + } + return url.slice(start, i); +}; +var getQueryStrings = (url) => { + const queryIndex = url.indexOf("?", 8); + return queryIndex === -1 ? "" : "?" + url.slice(queryIndex + 1); +}; +var getPathNoStrict = (request) => { + const result = getPath(request); + return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result; +}; +var mergePath = (base, sub, ...rest) => { + if (rest.length) { + sub = mergePath(sub, ...rest); + } + return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`; +}; +var checkOptionalParameter = (path) => { + if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) { + return null; + } + const segments = path.split("/"); + const results = []; + let basePath = ""; + segments.forEach((segment) => { + if (segment !== "" && !/\:/.test(segment)) { + basePath += "/" + segment; + } else if (/\:/.test(segment)) { + if (/\?/.test(segment)) { + if (results.length === 0 && basePath === "") { + results.push("/"); + } else { + results.push(basePath); + } + const optionalSegment = segment.replace("?", ""); + basePath += "/" + optionalSegment; + results.push(basePath); + } else { + basePath += "/" + segment; + } + } + }); + return results.filter((v, i, a) => a.indexOf(v) === i); +}; +var tryDecodeURIComponent = (str) => str.indexOf("%") !== -1 ? tryDecode(str, decodeURIComponent_) : str; +var _decodeURI = (value) => { + if (value.indexOf("+") !== -1) { + value = value.replace(/\+/g, " "); + } + return tryDecodeURIComponent(value); +}; +var _getQueryParam = (url, key, multiple) => { + let encoded; + if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) { + let keyIndex2 = url.indexOf("?", 8); + if (keyIndex2 === -1) { + return void 0; + } + if (!url.startsWith(key, keyIndex2 + 1)) { + keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); + } + while (keyIndex2 !== -1) { + const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1); + if (trailingKeyCode === 61) { + const valueIndex = keyIndex2 + key.length + 2; + const endIndex = url.indexOf("&", valueIndex); + return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex)); + } else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) { + return ""; + } + keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1); + } + encoded = /[%+]/.test(url); + if (!encoded) { + return void 0; + } + } + const results = /* @__PURE__ */ Object.create(null); + encoded ??= /[%+]/.test(url); + let keyIndex = url.indexOf("?", 8); + while (keyIndex !== -1) { + const nextKeyIndex = url.indexOf("&", keyIndex + 1); + let valueIndex = url.indexOf("=", keyIndex); + if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) { + valueIndex = -1; + } + let name = url.slice( + keyIndex + 1, + valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex + ); + if (encoded) { + name = _decodeURI(name); + } + keyIndex = nextKeyIndex; + if (name === "") { + continue; + } + let value; + if (valueIndex === -1) { + value = ""; + } else { + value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex); + if (encoded) { + value = _decodeURI(value); + } + } + if (multiple) { + if (!(results[name] && Array.isArray(results[name]))) { + results[name] = []; + } + ; + results[name].push(value); + } else { + results[name] ??= value; + } + } + return key ? results[key] : results; +}; +var getQueryParam = _getQueryParam; +var getQueryParams = (url, key) => { + return _getQueryParam(url, key, true); +}; +var decodeURIComponent_ = decodeURIComponent; +export { + checkOptionalParameter, + decodeURIComponent_, + getPath, + getPathNoStrict, + getPattern, + getQueryParam, + getQueryParams, + getQueryStrings, + mergePath, + splitPath, + splitRoutingPath, + tryDecode, + tryDecodeURI, + tryDecodeURIComponent +}; diff --git a/tools/ui/node_modules/hono/dist/validator/index.js b/tools/ui/node_modules/hono/dist/validator/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a8f176b4608b4e842cd3e364ed4ece49f7f8e250 --- /dev/null +++ b/tools/ui/node_modules/hono/dist/validator/index.js @@ -0,0 +1,5 @@ +// src/validator/index.ts +import { validator } from "./validator.js"; +export { + validator +}; diff --git a/tools/ui/node_modules/hono/dist/validator/utils.js b/tools/ui/node_modules/hono/dist/validator/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/hono/dist/validator/validator.js b/tools/ui/node_modules/hono/dist/validator/validator.js new file mode 100644 index 0000000000000000000000000000000000000000..65d60d212ebb62c0950c117498f5a2b05f09128c --- /dev/null +++ b/tools/ui/node_modules/hono/dist/validator/validator.js @@ -0,0 +1,86 @@ +// src/validator/validator.ts +import { getCookie } from "../helper/cookie/index.js"; +import { HTTPException } from "../http-exception.js"; +import { bufferToFormData } from "../utils/buffer.js"; +var jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i; +var multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i; +var urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i; +var validator = (target, validationFunc) => { + return async (c, next) => { + let value = {}; + const contentType = c.req.header("Content-Type"); + switch (target) { + case "json": + if (!contentType || !jsonRegex.test(contentType)) { + break; + } + try { + value = await c.req.json(); + } catch { + const message = "Malformed JSON in request body"; + throw new HTTPException(400, { message }); + } + break; + case "form": { + if (!contentType || !(multipartRegex.test(contentType) || urlencodedRegex.test(contentType))) { + break; + } + let formData; + if (c.req.bodyCache.formData) { + formData = await c.req.bodyCache.formData; + } else { + try { + const arrayBuffer = await c.req.arrayBuffer(); + formData = await bufferToFormData(arrayBuffer, contentType); + c.req.bodyCache.formData = formData; + } catch (e) { + let message = "Malformed FormData request."; + message += e instanceof Error ? ` ${e.message}` : ` ${String(e)}`; + throw new HTTPException(400, { message }); + } + } + const form = /* @__PURE__ */ Object.create(null); + formData.forEach((value2, key) => { + if (key.endsWith("[]")) { + ; + (form[key] ??= []).push(value2); + } else if (Array.isArray(form[key])) { + ; + form[key].push(value2); + } else if (Object.hasOwn(form, key)) { + form[key] = [form[key], value2]; + } else { + form[key] = value2; + } + }); + value = form; + break; + } + case "query": + value = Object.fromEntries( + Object.entries(c.req.queries()).map(([k, v]) => { + return v.length === 1 ? [k, v[0]] : [k, v]; + }) + ); + break; + case "param": + value = c.req.param(); + break; + case "header": + value = c.req.header(); + break; + case "cookie": + value = getCookie(c); + break; + } + const res = await validationFunc(value, c); + if (res instanceof Response) { + return res; + } + c.req.addValidatedData(target, res); + return await next(); + }; +}; +export { + validator +}; diff --git a/tools/ui/node_modules/hono/package.json b/tools/ui/node_modules/hono/package.json new file mode 100644 index 0000000000000000000000000000000000000000..53410d3e9b57e0f3f7930c6e53d9a675e6bfe173 --- /dev/null +++ b/tools/ui/node_modules/hono/package.json @@ -0,0 +1,706 @@ +{ + "name": "hono", + "version": "4.13.0", + "description": "Web framework built on Web Standards", + "main": "dist/cjs/index.js", + "type": "module", + "module": "dist/index.js", + "types": "dist/types/index.d.ts", + "files": [ + "dist", + "!dist/**/*.tsbuildinfo" + ], + "scripts": { + "test": "tsc -p tsconfig.spec.json && vitest --run", + "test:watch": "vitest --watch", + "test:deno": "deno test --allow-read --allow-env --allow-write --allow-net -c runtime-tests/deno/deno.json runtime-tests/deno && deno test --no-lock -c runtime-tests/deno-jsx/deno.precompile.json runtime-tests/deno-jsx && deno test --no-lock -c runtime-tests/deno-jsx/deno.react-jsx.json runtime-tests/deno-jsx", + "test:bun": "bun test --jsx-import-source ../../src/jsx runtime-tests/bun/*", + "test:fastly": "vitest --run --project fastly", + "test:node": "vitest --run --project node", + "test:workerd": "vitest --run --project workerd", + "test:lambda": "vitest --run --project lambda", + "test:lambda-edge": "vitest --run --project lambda-edge", + "test:all": "bun run test && bun test:deno && bun test:bun", + "lint": "eslint src runtime-tests build perf-measures benchmarks", + "lint:fix": "eslint src runtime-tests build perf-measures benchmarks --fix", + "format": "prettier --check --cache \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"", + "format:fix": "prettier --write --cache --cache-strategy metadata \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"", + "editorconfig-checker": "editorconfig-checker", + "copy:package.cjs.json": "cp ./package.cjs.json ./dist/cjs/package.json && cp ./package.cjs.json ./dist/types/package.json", + "build": "bun run --shell bun remove-dist && bun ./build/build.ts && bun run copy:package.cjs.json", + "postbuild": "publint", + "watch": "bun run --shell bun remove-dist && bun ./build/build.ts --watch && bun run copy:package.cjs.json", + "coverage": "vitest --run --coverage", + "prerelease": "bun test:deno && bun run build", + "release": "np --no-publish", + "remove-dist": "rm -rf dist" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/cjs/index.js" + }, + "./request": { + "types": "./dist/types/request.d.ts", + "import": "./dist/request.js", + "require": "./dist/cjs/request.js" + }, + "./types": { + "types": "./dist/types/types.d.ts", + "import": "./dist/types.js", + "require": "./dist/cjs/types.js" + }, + "./hono-base": { + "types": "./dist/types/hono-base.d.ts", + "import": "./dist/hono-base.js", + "require": "./dist/cjs/hono-base.js" + }, + "./tiny": { + "types": "./dist/types/preset/tiny.d.ts", + "import": "./dist/preset/tiny.js", + "require": "./dist/cjs/preset/tiny.js" + }, + "./quick": { + "types": "./dist/types/preset/quick.d.ts", + "import": "./dist/preset/quick.js", + "require": "./dist/cjs/preset/quick.js" + }, + "./http-exception": { + "types": "./dist/types/http-exception.d.ts", + "import": "./dist/http-exception.js", + "require": "./dist/cjs/http-exception.js" + }, + "./basic-auth": { + "types": "./dist/types/middleware/basic-auth/index.d.ts", + "import": "./dist/middleware/basic-auth/index.js", + "require": "./dist/cjs/middleware/basic-auth/index.js" + }, + "./bearer-auth": { + "types": "./dist/types/middleware/bearer-auth/index.d.ts", + "import": "./dist/middleware/bearer-auth/index.js", + "require": "./dist/cjs/middleware/bearer-auth/index.js" + }, + "./body-limit": { + "types": "./dist/types/middleware/body-limit/index.d.ts", + "import": "./dist/middleware/body-limit/index.js", + "require": "./dist/cjs/middleware/body-limit/index.js" + }, + "./ip-restriction": { + "types": "./dist/types/middleware/ip-restriction/index.d.ts", + "import": "./dist/middleware/ip-restriction/index.js", + "require": "./dist/cjs/middleware/ip-restriction/index.js" + }, + "./cache": { + "types": "./dist/types/middleware/cache/index.d.ts", + "import": "./dist/middleware/cache/index.js", + "require": "./dist/cjs/middleware/cache/index.js" + }, + "./route": { + "types": "./dist/types/helper/route/index.d.ts", + "import": "./dist/helper/route/index.js", + "require": "./dist/cjs/helper/route/index.js" + }, + "./cookie": { + "types": "./dist/types/helper/cookie/index.d.ts", + "import": "./dist/helper/cookie/index.js", + "require": "./dist/cjs/helper/cookie/index.js" + }, + "./accepts": { + "types": "./dist/types/helper/accepts/index.d.ts", + "import": "./dist/helper/accepts/index.js", + "require": "./dist/cjs/helper/accepts/index.js" + }, + "./compress": { + "types": "./dist/types/middleware/compress/index.d.ts", + "import": "./dist/middleware/compress/index.js", + "require": "./dist/cjs/middleware/compress/index.js" + }, + "./context-storage": { + "types": "./dist/types/middleware/context-storage/index.d.ts", + "import": "./dist/middleware/context-storage/index.js", + "require": "./dist/cjs/middleware/context-storage/index.js" + }, + "./cors": { + "types": "./dist/types/middleware/cors/index.d.ts", + "import": "./dist/middleware/cors/index.js", + "require": "./dist/cjs/middleware/cors/index.js" + }, + "./csrf": { + "types": "./dist/types/middleware/csrf/index.d.ts", + "import": "./dist/middleware/csrf/index.js", + "require": "./dist/cjs/middleware/csrf/index.js" + }, + "./etag": { + "types": "./dist/types/middleware/etag/index.d.ts", + "import": "./dist/middleware/etag/index.js", + "require": "./dist/cjs/middleware/etag/index.js" + }, + "./trailing-slash": { + "types": "./dist/types/middleware/trailing-slash/index.d.ts", + "import": "./dist/middleware/trailing-slash/index.js", + "require": "./dist/cjs/middleware/trailing-slash/index.js" + }, + "./html": { + "types": "./dist/types/helper/html/index.d.ts", + "import": "./dist/helper/html/index.js", + "require": "./dist/cjs/helper/html/index.js" + }, + "./css": { + "types": "./dist/types/helper/css/index.d.ts", + "import": "./dist/helper/css/index.js", + "require": "./dist/cjs/helper/css/index.js" + }, + "./jsx": { + "types": "./dist/types/jsx/index.d.ts", + "import": "./dist/jsx/index.js", + "require": "./dist/cjs/jsx/index.js" + }, + "./jsx/jsx-dev-runtime": { + "types": "./dist/types/jsx/jsx-dev-runtime.d.ts", + "import": "./dist/jsx/jsx-dev-runtime.js", + "require": "./dist/cjs/jsx/jsx-dev-runtime.js" + }, + "./jsx/jsx-runtime": { + "types": "./dist/types/jsx/jsx-runtime.d.ts", + "import": "./dist/jsx/jsx-runtime.js", + "require": "./dist/cjs/jsx/jsx-runtime.js" + }, + "./jsx/streaming": { + "types": "./dist/types/jsx/streaming.d.ts", + "import": "./dist/jsx/streaming.js", + "require": "./dist/cjs/jsx/streaming.js" + }, + "./jsx-renderer": { + "types": "./dist/types/middleware/jsx-renderer/index.d.ts", + "import": "./dist/middleware/jsx-renderer/index.js", + "require": "./dist/cjs/middleware/jsx-renderer/index.js" + }, + "./jsx/dom": { + "types": "./dist/types/jsx/dom/index.d.ts", + "import": "./dist/jsx/dom/index.js", + "require": "./dist/cjs/jsx/dom/index.js" + }, + "./jsx/dom/jsx-dev-runtime": { + "types": "./dist/types/jsx/dom/jsx-dev-runtime.d.ts", + "import": "./dist/jsx/dom/jsx-dev-runtime.js", + "require": "./dist/cjs/jsx/dom/jsx-dev-runtime.js" + }, + "./jsx/dom/jsx-runtime": { + "types": "./dist/types/jsx/dom/jsx-runtime.d.ts", + "import": "./dist/jsx/dom/jsx-runtime.js", + "require": "./dist/cjs/jsx/dom/jsx-runtime.js" + }, + "./jsx/dom/client": { + "types": "./dist/types/jsx/dom/client.d.ts", + "import": "./dist/jsx/dom/client.js", + "require": "./dist/cjs/jsx/dom/client.js" + }, + "./jsx/dom/css": { + "types": "./dist/types/jsx/dom/css.d.ts", + "import": "./dist/jsx/dom/css.js", + "require": "./dist/cjs/jsx/dom/css.js" + }, + "./jsx/dom/server": { + "types": "./dist/types/jsx/dom/server.d.ts", + "import": "./dist/jsx/dom/server.js", + "require": "./dist/cjs/jsx/dom/server.js" + }, + "./jwt": { + "types": "./dist/types/middleware/jwt/index.d.ts", + "import": "./dist/middleware/jwt/index.js", + "require": "./dist/cjs/middleware/jwt/index.js" + }, + "./jwk": { + "types": "./dist/types/middleware/jwk/index.d.ts", + "import": "./dist/middleware/jwk/index.js", + "require": "./dist/cjs/middleware/jwk/index.js" + }, + "./timeout": { + "types": "./dist/types/middleware/timeout/index.d.ts", + "import": "./dist/middleware/timeout/index.js", + "require": "./dist/cjs/middleware/timeout/index.js" + }, + "./timing": { + "types": "./dist/types/middleware/timing/index.d.ts", + "import": "./dist/middleware/timing/index.js", + "require": "./dist/cjs/middleware/timing/index.js" + }, + "./logger": { + "types": "./dist/types/middleware/logger/index.d.ts", + "import": "./dist/middleware/logger/index.js", + "require": "./dist/cjs/middleware/logger/index.js" + }, + "./method-not-allowed": { + "types": "./dist/types/middleware/method-not-allowed/index.d.ts", + "import": "./dist/middleware/method-not-allowed/index.js", + "require": "./dist/cjs/middleware/method-not-allowed/index.js" + }, + "./method-override": { + "types": "./dist/types/middleware/method-override/index.d.ts", + "import": "./dist/middleware/method-override/index.js", + "require": "./dist/cjs/middleware/method-override/index.js" + }, + "./powered-by": { + "types": "./dist/types/middleware/powered-by/index.d.ts", + "import": "./dist/middleware/powered-by/index.js", + "require": "./dist/cjs/middleware/powered-by/index.js" + }, + "./pretty-json": { + "types": "./dist/types/middleware/pretty-json/index.d.ts", + "import": "./dist/middleware/pretty-json/index.js", + "require": "./dist/cjs/middleware/pretty-json/index.js" + }, + "./request-id": { + "types": "./dist/types/middleware/request-id/index.d.ts", + "import": "./dist/middleware/request-id/index.js", + "require": "./dist/cjs/middleware/request-id/index.js" + }, + "./language": { + "types": "./dist/types/middleware/language/index.d.ts", + "import": "./dist/middleware/language/index.js", + "require": "./dist/cjs/middleware/language/index.js" + }, + "./secure-headers": { + "types": "./dist/types/middleware/secure-headers/index.d.ts", + "import": "./dist/middleware/secure-headers/index.js", + "require": "./dist/cjs/middleware/secure-headers/index.js" + }, + "./combine": { + "types": "./dist/types/middleware/combine/index.d.ts", + "import": "./dist/middleware/combine/index.js", + "require": "./dist/cjs/middleware/combine/index.js" + }, + "./ssg": { + "types": "./dist/types/helper/ssg/index.d.ts", + "import": "./dist/helper/ssg/index.js", + "require": "./dist/cjs/helper/ssg/index.js" + }, + "./streaming": { + "types": "./dist/types/helper/streaming/index.d.ts", + "import": "./dist/helper/streaming/index.js", + "require": "./dist/cjs/helper/streaming/index.js" + }, + "./validator": { + "types": "./dist/types/validator/index.d.ts", + "import": "./dist/validator/index.js", + "require": "./dist/cjs/validator/index.js" + }, + "./router": { + "types": "./dist/types/router.d.ts", + "import": "./dist/router.js", + "require": "./dist/cjs/router.js" + }, + "./router/reg-exp-router": { + "types": "./dist/types/router/reg-exp-router/index.d.ts", + "import": "./dist/router/reg-exp-router/index.js", + "require": "./dist/cjs/router/reg-exp-router/index.js" + }, + "./router/smart-router": { + "types": "./dist/types/router/smart-router/index.d.ts", + "import": "./dist/router/smart-router/index.js", + "require": "./dist/cjs/router/smart-router/index.js" + }, + "./router/trie-router": { + "types": "./dist/types/router/trie-router/index.d.ts", + "import": "./dist/router/trie-router/index.js", + "require": "./dist/cjs/router/trie-router/index.js" + }, + "./router/pattern-router": { + "types": "./dist/types/router/pattern-router/index.d.ts", + "import": "./dist/router/pattern-router/index.js", + "require": "./dist/cjs/router/pattern-router/index.js" + }, + "./router/linear-router": { + "types": "./dist/types/router/linear-router/index.d.ts", + "import": "./dist/router/linear-router/index.js", + "require": "./dist/cjs/router/linear-router/index.js" + }, + "./utils/jwt": { + "types": "./dist/types/utils/jwt/index.d.ts", + "import": "./dist/utils/jwt/index.js", + "require": "./dist/cjs/utils/jwt/index.js" + }, + "./utils/*": { + "types": "./dist/types/utils/*.d.ts", + "import": "./dist/utils/*.js", + "require": "./dist/cjs/utils/*.js" + }, + "./client": { + "types": "./dist/types/client/index.d.ts", + "import": "./dist/client/index.js", + "require": "./dist/cjs/client/index.js" + }, + "./adapter": { + "types": "./dist/types/helper/adapter/index.d.ts", + "import": "./dist/helper/adapter/index.js", + "require": "./dist/cjs/helper/adapter/index.js" + }, + "./factory": { + "types": "./dist/types/helper/factory/index.d.ts", + "import": "./dist/helper/factory/index.js", + "require": "./dist/cjs/helper/factory/index.js" + }, + "./serve-static": { + "types": "./dist/types/middleware/serve-static/index.d.ts", + "import": "./dist/middleware/serve-static/index.js", + "require": "./dist/cjs/middleware/serve-static/index.js" + }, + "./cloudflare-workers": { + "types": "./dist/types/adapter/cloudflare-workers/index.d.ts", + "import": "./dist/adapter/cloudflare-workers/index.js", + "require": "./dist/cjs/adapter/cloudflare-workers/index.js" + }, + "./cloudflare-pages": { + "types": "./dist/types/adapter/cloudflare-pages/index.d.ts", + "import": "./dist/adapter/cloudflare-pages/index.js", + "require": "./dist/cjs/adapter/cloudflare-pages/index.js" + }, + "./deno": { + "types": "./dist/types/adapter/deno/index.d.ts", + "import": "./dist/adapter/deno/index.js", + "require": "./dist/cjs/adapter/deno/index.js" + }, + "./bun": { + "types": "./dist/types/adapter/bun/index.d.ts", + "import": "./dist/adapter/bun/index.js", + "require": "./dist/cjs/adapter/bun/index.js" + }, + "./aws-lambda": { + "types": "./dist/types/adapter/aws-lambda/index.d.ts", + "import": "./dist/adapter/aws-lambda/index.js", + "require": "./dist/cjs/adapter/aws-lambda/index.js" + }, + "./vercel": { + "types": "./dist/types/adapter/vercel/index.d.ts", + "import": "./dist/adapter/vercel/index.js", + "require": "./dist/cjs/adapter/vercel/index.js" + }, + "./netlify": { + "types": "./dist/types/adapter/netlify/index.d.ts", + "import": "./dist/adapter/netlify/index.js", + "require": "./dist/cjs/adapter/netlify/index.js" + }, + "./lambda-edge": { + "types": "./dist/types/adapter/lambda-edge/index.d.ts", + "import": "./dist/adapter/lambda-edge/index.js", + "require": "./dist/cjs/adapter/lambda-edge/index.js" + }, + "./service-worker": { + "types": "./dist/types/adapter/service-worker/index.d.ts", + "import": "./dist/adapter/service-worker/index.js", + "require": "./dist/cjs/adapter/service-worker/index.js" + }, + "./testing": { + "types": "./dist/types/helper/testing/index.d.ts", + "import": "./dist/helper/testing/index.js", + "require": "./dist/cjs/helper/testing/index.js" + }, + "./dev": { + "types": "./dist/types/helper/dev/index.d.ts", + "import": "./dist/helper/dev/index.js", + "require": "./dist/cjs/helper/dev/index.js" + }, + "./ws": { + "types": "./dist/types/helper/websocket/index.d.ts", + "import": "./dist/helper/websocket/index.js", + "require": "./dist/cjs/helper/websocket/index.js" + }, + "./conninfo": { + "types": "./dist/types/helper/conninfo/index.d.ts", + "import": "./dist/helper/conninfo/index.js", + "require": "./dist/cjs/helper/conninfo/index.js" + }, + "./proxy": { + "types": "./dist/types/helper/proxy/index.d.ts", + "import": "./dist/helper/proxy/index.js", + "require": "./dist/cjs/helper/proxy/index.js" + } + }, + "typesVersions": { + "*": { + "request": [ + "./dist/types/request" + ], + "types": [ + "./dist/types/types" + ], + "hono-base": [ + "./dist/types/hono-base" + ], + "tiny": [ + "./dist/types/preset/tiny" + ], + "quick": [ + "./dist/types/preset/quick" + ], + "http-exception": [ + "./dist/types/http-exception" + ], + "basic-auth": [ + "./dist/types/middleware/basic-auth" + ], + "bearer-auth": [ + "./dist/types/middleware/bearer-auth" + ], + "body-limit": [ + "./dist/types/middleware/body-limit" + ], + "ip-restriction": [ + "./dist/types/middleware/ip-restriction" + ], + "cache": [ + "./dist/types/middleware/cache" + ], + "route": [ + "./dist/types/helper/route" + ], + "cookie": [ + "./dist/types/helper/cookie" + ], + "accepts": [ + "./dist/types/helper/accepts" + ], + "compress": [ + "./dist/types/middleware/compress" + ], + "context-storage": [ + "./dist/types/middleware/context-storage" + ], + "cors": [ + "./dist/types/middleware/cors" + ], + "csrf": [ + "./dist/types/middleware/csrf" + ], + "etag": [ + "./dist/types/middleware/etag" + ], + "trailing-slash": [ + "./dist/types/middleware/trailing-slash" + ], + "html": [ + "./dist/types/helper/html" + ], + "css": [ + "./dist/types/helper/css" + ], + "jsx": [ + "./dist/types/jsx" + ], + "jsx/jsx-runtime": [ + "./dist/types/jsx/jsx-runtime.d.ts" + ], + "jsx/jsx-dev-runtime": [ + "./dist/types/jsx/jsx-dev-runtime.d.ts" + ], + "jsx/streaming": [ + "./dist/types/jsx/streaming.d.ts" + ], + "jsx-renderer": [ + "./dist/types/middleware/jsx-renderer" + ], + "jsx/dom": [ + "./dist/types/jsx/dom" + ], + "jsx/dom/client": [ + "./dist/types/jsx/dom/client.d.ts" + ], + "jsx/dom/css": [ + "./dist/types/jsx/dom/css.d.ts" + ], + "jsx/dom/server": [ + "./dist/types/jsx/dom/server.d.ts" + ], + "jsx/dom/jsx-dev-runtime": [ + "./dist/types/jsx/dom/jsx-dev-runtime.d.ts" + ], + "jsx/dom/jsx-runtime": [ + "./dist/types/jsx/dom/jsx-runtime.d.ts" + ], + "jwt": [ + "./dist/types/middleware/jwt" + ], + "jwk": [ + "./dist/types/middleware/jwk" + ], + "timeout": [ + "./dist/types/middleware/timeout" + ], + "timing": [ + "./dist/types/middleware/timing" + ], + "logger": [ + "./dist/types/middleware/logger" + ], + "method-not-allowed": [ + "./dist/types/middleware/method-not-allowed" + ], + "method-override": [ + "./dist/types/middleware/method-override" + ], + "powered-by": [ + "./dist/types/middleware/powered-by" + ], + "pretty-json": [ + "./dist/types/middleware/pretty-json" + ], + "request-id": [ + "./dist/types/middleware/request-id" + ], + "language": [ + "./dist/types/middleware/language" + ], + "streaming": [ + "./dist/types/helper/streaming" + ], + "ssg": [ + "./dist/types/helper/ssg" + ], + "secure-headers": [ + "./dist/types/middleware/secure-headers" + ], + "combine": [ + "./dist/types/middleware/combine" + ], + "validator": [ + "./dist/types/validator/index.d.ts" + ], + "router": [ + "./dist/types/router.d.ts" + ], + "router/reg-exp-router": [ + "./dist/types/router/reg-exp-router" + ], + "router/smart-router": [ + "./dist/types/router/smart-router" + ], + "router/trie-router": [ + "./dist/types/router/trie-router" + ], + "router/pattern-router": [ + "./dist/types/router/pattern-router" + ], + "router/linear-router": [ + "./dist/types/router/linear-router" + ], + "utils/jwt": [ + "./dist/types/utils/jwt/index.d.ts" + ], + "utils/*": [ + "./dist/types/utils/*" + ], + "client": [ + "./dist/types/client/index.d.ts" + ], + "adapter": [ + "./dist/types/helper/adapter/index.d.ts" + ], + "factory": [ + "./dist/types/helper/factory/index.d.ts" + ], + "serve-static": [ + "./dist/types/middleware/serve-static" + ], + "cloudflare-workers": [ + "./dist/types/adapter/cloudflare-workers" + ], + "cloudflare-pages": [ + "./dist/types/adapter/cloudflare-pages" + ], + "deno": [ + "./dist/types/adapter/deno" + ], + "bun": [ + "./dist/types/adapter/bun" + ], + "aws-lambda": [ + "./dist/types/adapter/aws-lambda" + ], + "vercel": [ + "./dist/types/adapter/vercel" + ], + "netlify": [ + "./dist/types/adapter/netlify" + ], + "lambda-edge": [ + "./dist/types/adapter/lambda-edge" + ], + "service-worker": [ + "./dist/types/adapter/service-worker" + ], + "testing": [ + "./dist/types/helper/testing" + ], + "dev": [ + "./dist/types/helper/dev" + ], + "ws": [ + "./dist/types/helper/websocket" + ], + "conninfo": [ + "./dist/types/helper/conninfo" + ], + "proxy": [ + "./dist/types/helper/proxy" + ] + } + }, + "author": "Yusuke Wada (https://github.com/yusukebe)", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/honojs/hono.git" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "homepage": "https://hono.dev", + "keywords": [ + "hono", + "web", + "app", + "http", + "application", + "framework", + "router", + "cloudflare", + "workers", + "fastly", + "compute", + "deno", + "bun", + "lambda", + "nodejs" + ], + "devDependencies": { + "@hono/eslint-config": "^2.1.1", + "@hono/node-server": "^2.0.12", + "@types/jsdom": "^21.1.7", + "@types/node": "^24.3.0", + "@types/ws": "^8.18.1", + "@typescript/native-preview": "7.0.0-dev.20260210.1", + "@vitest/coverage-v8": "^4.1.7", + "bun-types": "^1.2.20", + "editorconfig-checker": "6.1.1", + "esbuild": "^0.27.1", + "eslint": "^9.39.3", + "jsdom": "22.1.0", + "msw": "^2.6.0", + "np": "11.2.1", + "oxc-parser": "^0.96.0", + "pkg-pr-new": "^0.0.53", + "prettier": "3.7.4", + "publint": "0.3.15", + "typescript": "^6.0.3", + "vite-plugin-fastly-js-compute": "^0.4.2", + "vitest": "^4.1.9", + "wrangler": "4.107.0", + "ws": "^8.21.0", + "zod": "^3.23.8" + }, + "packageManager": "bun@1.2.20", + "engines": { + "node": ">=16.9.0" + } +} diff --git a/tools/ui/node_modules/html-encoding-sniffer/LICENSE.txt b/tools/ui/node_modules/html-encoding-sniffer/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..4220dead347e8c5273b9280d608626100a7fa5a8 --- /dev/null +++ b/tools/ui/node_modules/html-encoding-sniffer/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright © Domenic Denicola + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/html-encoding-sniffer/README.md b/tools/ui/node_modules/html-encoding-sniffer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..73338eadb7db63c2e513024c7be963f227b5639d --- /dev/null +++ b/tools/ui/node_modules/html-encoding-sniffer/README.md @@ -0,0 +1,40 @@ +# Determine the Encoding of a HTML Byte Stream + +This package implements the HTML Standard's [encoding sniffing algorithm](https://html.spec.whatwg.org/multipage/syntax.html#encoding-sniffing-algorithm) in all its glory. The most interesting part of this is how it pre-scans the first 1024 bytes in order to search for certain ``-related patterns. + +```js +const htmlEncodingSniffer = require("html-encoding-sniffer"); +const fs = require("fs"); + +const htmlBytes = fs.readFileSync("./html-page.html"); +const sniffedEncoding = htmlEncodingSniffer(htmlBytes); +``` + +The passed bytes are given as a `Uint8Array`; the Node.js `Buffer` subclass of `Uint8Array` will also work, as shown above. + +The returned value will be a canonical [encoding name](https://encoding.spec.whatwg.org/#names-and-labels) (not a label). You might then combine this with the [whatwg-encoding](https://github.com/jsdom/whatwg-encoding) package to decode the result: + +```js +const whatwgEncoding = require("whatwg-encoding"); +const htmlString = whatwgEncoding.decode(htmlBytes, sniffedEncoding); +``` + +## Options + +You can pass two potential options to `htmlEncodingSniffer`: + +```js +const sniffedEncoding = htmlEncodingSniffer(htmlBytes, { + transportLayerEncodingLabel, + defaultEncoding +}); +``` + +These represent two possible inputs into the [encoding sniffing algorithm](https://html.spec.whatwg.org/multipage/syntax.html#encoding-sniffing-algorithm): + +- `transportLayerEncodingLabel` is an encoding label that is obtained from the "transport layer" (probably a HTTP `Content-Type` header), which overrides everything but a BOM. +- `defaultEncoding` is the ultimate fallback encoding used if no valid encoding is supplied by the transport layer, and no encoding is sniffed from the bytes. It defaults to `"windows-1252"`, as recommended by the algorithm's table of suggested defaults for "All other locales" (including the `en` locale). + +## Credits + +This package was originally based on the excellent work of [@nicolashenry](https://github.com/nicolashenry), [in jsdom](https://github.com/tmpvar/jsdom/blob/16fd85618f2705d181232f6552125872a37164bc/lib/jsdom/living/helpers/encoding.js). It has since been pulled out into this separate package. diff --git a/tools/ui/node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js b/tools/ui/node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js new file mode 100644 index 0000000000000000000000000000000000000000..360341019651d96bcc1ed30ab22bcd4db2ac6e54 --- /dev/null +++ b/tools/ui/node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js @@ -0,0 +1,295 @@ +"use strict"; +const whatwgEncoding = require("whatwg-encoding"); + +// https://html.spec.whatwg.org/#encoding-sniffing-algorithm +module.exports = (uint8Array, { transportLayerEncodingLabel, defaultEncoding = "windows-1252" } = {}) => { + let encoding = whatwgEncoding.getBOMEncoding(uint8Array); + + if (encoding === null && transportLayerEncodingLabel !== undefined) { + encoding = whatwgEncoding.labelToName(transportLayerEncodingLabel); + } + + if (encoding === null) { + encoding = prescanMetaCharset(uint8Array); + } + + if (encoding === null) { + encoding = defaultEncoding; + } + + return encoding; +}; + +// https://html.spec.whatwg.org/multipage/syntax.html#prescan-a-byte-stream-to-determine-its-encoding +function prescanMetaCharset(uint8Array) { + const l = Math.min(uint8Array.byteLength, 1024); + for (let i = 0; i < l; i++) { + let c = uint8Array[i]; + if (c === 0x3C) { + // "<" + const c1 = uint8Array[i + 1]; + const c2 = uint8Array[i + 2]; + const c3 = uint8Array[i + 3]; + const c4 = uint8Array[i + 4]; + const c5 = uint8Array[i + 5]; + // !-- (comment start) + if (c1 === 0x21 && c2 === 0x2D && c3 === 0x2D) { + i += 4; + for (; i < l; i++) { + c = uint8Array[i]; + const cMinus1 = uint8Array[i - 1]; + const cMinus2 = uint8Array[i - 2]; + // --> (comment end) + if (c === 0x3E && cMinus1 === 0x2D && cMinus2 === 0x2D) { + break; + } + } + } else if ((c1 === 0x4D || c1 === 0x6D) && + (c2 === 0x45 || c2 === 0x65) && + (c3 === 0x54 || c3 === 0x74) && + (c4 === 0x41 || c4 === 0x61) && + (isSpaceCharacter(c5) || c5 === 0x2F)) { + // "meta" + space or / + i += 6; + const attributeList = new Set(); + let gotPragma = false; + let needPragma = null; + let charset = null; + + let attrRes; + do { + attrRes = getAttribute(uint8Array, i, l); + if (attrRes.attr && !attributeList.has(attrRes.attr.name)) { + attributeList.add(attrRes.attr.name); + if (attrRes.attr.name === "http-equiv") { + gotPragma = attrRes.attr.value === "content-type"; + } else if (attrRes.attr.name === "content" && !charset) { + charset = extractCharacterEncodingFromMeta(attrRes.attr.value); + if (charset !== null) { + needPragma = true; + } + } else if (attrRes.attr.name === "charset") { + charset = whatwgEncoding.labelToName(attrRes.attr.value); + needPragma = false; + } + } + i = attrRes.i; + } while (attrRes.attr); + + if (needPragma === null) { + continue; + } + if (needPragma === true && gotPragma === false) { + continue; + } + if (charset === null) { + continue; + } + + if (charset === "UTF-16LE" || charset === "UTF-16BE") { + charset = "UTF-8"; + } + if (charset === "x-user-defined") { + charset = "windows-1252"; + } + + return charset; + } else if ((c1 >= 0x41 && c1 <= 0x5A) || (c1 >= 0x61 && c1 <= 0x7A)) { + // a-z or A-Z + for (i += 2; i < l; i++) { + c = uint8Array[i]; + // space or > + if (isSpaceCharacter(c) || c === 0x3E) { + break; + } + } + let attrRes; + do { + attrRes = getAttribute(uint8Array, i, l); + i = attrRes.i; + } while (attrRes.attr); + } else if (c1 === 0x21 || c1 === 0x2F || c1 === 0x3F) { + // ! or / or ? + for (i += 2; i < l; i++) { + c = uint8Array[i]; + // > + if (c === 0x3E) { + break; + } + } + } + } + } + return null; +} + +// https://html.spec.whatwg.org/multipage/syntax.html#concept-get-attributes-when-sniffing +function getAttribute(uint8Array, i, l) { + for (; i < l; i++) { + let c = uint8Array[i]; + // space or / + if (isSpaceCharacter(c) || c === 0x2F) { + continue; + } + // ">" + if (c === 0x3E) { + break; + } + let name = ""; + let value = ""; + nameLoop:for (; i < l; i++) { + c = uint8Array[i]; + // "=" + if (c === 0x3D && name !== "") { + i++; + break; + } + // space + if (isSpaceCharacter(c)) { + for (i++; i < l; i++) { + c = uint8Array[i]; + // space + if (isSpaceCharacter(c)) { + continue; + } + // not "=" + if (c !== 0x3D) { + return { attr: { name, value }, i }; + } + + i++; + break nameLoop; + } + break; + } + // / or > + if (c === 0x2F || c === 0x3E) { + return { attr: { name, value }, i }; + } + // A-Z + if (c >= 0x41 && c <= 0x5A) { + name += String.fromCharCode(c + 0x20); // lowercase + } else { + name += String.fromCharCode(c); + } + } + c = uint8Array[i]; + // space + if (isSpaceCharacter(c)) { + for (i++; i < l; i++) { + c = uint8Array[i]; + // space + if (isSpaceCharacter(c)) { + continue; + } else { + break; + } + } + } + // " or ' + if (c === 0x22 || c === 0x27) { + const quote = c; + for (i++; i < l; i++) { + c = uint8Array[i]; + + if (c === quote) { + i++; + return { attr: { name, value }, i }; + } + + // A-Z + if (c >= 0x41 && c <= 0x5A) { + value += String.fromCharCode(c + 0x20); // lowercase + } else { + value += String.fromCharCode(c); + } + } + } + + // > + if (c === 0x3E) { + return { attr: { name, value }, i }; + } + + // A-Z + if (c >= 0x41 && c <= 0x5A) { + value += String.fromCharCode(c + 0x20); // lowercase + } else { + value += String.fromCharCode(c); + } + + for (i++; i < l; i++) { + c = uint8Array[i]; + + // space or > + if (isSpaceCharacter(c) || c === 0x3E) { + return { attr: { name, value }, i }; + } + + // A-Z + if (c >= 0x41 && c <= 0x5A) { + value += String.fromCharCode(c + 0x20); // lowercase + } else { + value += String.fromCharCode(c); + } + } + } + return { i }; +} + +function extractCharacterEncodingFromMeta(string) { + let position = 0; + + while (true) { + const indexOfCharset = string.substring(position).search(/charset/ui); + + if (indexOfCharset === -1) { + return null; + } + let subPosition = position + indexOfCharset + "charset".length; + + while (isSpaceCharacter(string[subPosition].charCodeAt(0))) { + ++subPosition; + } + + if (string[subPosition] !== "=") { + position = subPosition - 1; + continue; + } + + ++subPosition; + + while (isSpaceCharacter(string[subPosition].charCodeAt(0))) { + ++subPosition; + } + + position = subPosition; + break; + } + + if (string[position] === "\"" || string[position] === "'") { + const nextIndex = string.indexOf(string[position], position + 1); + + if (nextIndex !== -1) { + return whatwgEncoding.labelToName(string.substring(position + 1, nextIndex)); + } + + // It is an unmatched quotation mark + return null; + } + + if (string.length === position + 1) { + return null; + } + + const indexOfASCIIWhitespaceOrSemicolon = string.substring(position + 1).search(/\x09|\x0A|\x0C|\x0D|\x20|;/u); + const end = indexOfASCIIWhitespaceOrSemicolon === -1 ? + string.length : + position + indexOfASCIIWhitespaceOrSemicolon + 1; + + return whatwgEncoding.labelToName(string.substring(position, end)); +} + +function isSpaceCharacter(c) { + return c === 0x09 || c === 0x0A || c === 0x0C || c === 0x0D || c === 0x20; +} diff --git a/tools/ui/node_modules/html-encoding-sniffer/package.json b/tools/ui/node_modules/html-encoding-sniffer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0049e2be93d2480717ebc64d0fd7971dca7a2475 --- /dev/null +++ b/tools/ui/node_modules/html-encoding-sniffer/package.json @@ -0,0 +1,31 @@ +{ + "name": "html-encoding-sniffer", + "description": "Sniff the encoding from a HTML byte stream", + "keywords": [ + "encoding", + "html" + ], + "version": "3.0.0", + "author": "Domenic Denicola (https://domenic.me/)", + "license": "MIT", + "repository": "jsdom/html-encoding-sniffer", + "main": "lib/html-encoding-sniffer.js", + "files": [ + "lib/" + ], + "scripts": { + "test": "mocha", + "lint": "eslint ." + }, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "devDependencies": { + "@domenic/eslint-config": "^1.4.0", + "eslint": "^7.32.0", + "mocha": "^9.1.1" + }, + "engines": { + "node": ">=12" + } +} diff --git a/tools/ui/node_modules/html-escaper/LICENSE.txt b/tools/ui/node_modules/html-escaper/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..dcfa0aebdc54cb8631f9a76fe9820863202ab7fc --- /dev/null +++ b/tools/ui/node_modules/html-escaper/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/ui/node_modules/html-escaper/README.md b/tools/ui/node_modules/html-escaper/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3dca3412f019ba2696b8e95e3e8c051951c2f1b9 --- /dev/null +++ b/tools/ui/node_modules/html-escaper/README.md @@ -0,0 +1,97 @@ +# html-escaper [![Build Status](https://travis-ci.org/WebReflection/html-escaper.svg?branch=master)](https://travis-ci.org/WebReflection/html-escaper) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/html-escaper/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/html-escaper?branch=master) +A simple module to escape/unescape common problematic entities. + + +### How +This package is available in npm so `npm install html-escaper` is all you need to do, using eventually the global flag too. + +Once the module is present +```js +var html = require('html-escaper'); + +// two basic methods +html.escape('string'); +html.unescape('escaped string'); +``` + + +### Why +there is basically one rule only: do not **ever** replace one char after another if you are transforming a string into another. + +```js +// WARNING: THIS IS WRONG +// if you are that kind of dev that does this +function escape(s) { + return s.replace(/&/g, "&") + .replace(//g, ">") + .replace(/'/g, "'") + .replace(/"/g, """); +} + +// you might be the same dev that does this too +function unescape(s) { + return s.replace(/&/g, "&") + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/'/g, "'") + .replace(/"/g, '"'); +} + +// guess what we have here ? +unescape('&lt;'); + +// now guess this XSS too ... +unescape('&lt;script&gt;alert("yo")&lt;/script&gt;'); + + +``` + +The last example will produce `` instead of the expected `<script>alert("yo")</script>`. + +Nothing like this could possibly happen if we grab all chars at once and either ways. +It's just a fortunate case that after swapping `&` with `&` no other replace will be affected, but it's not portable and universally a bad practice. + +Grab all chars at once, no excuses! + + + +**more details** +As somebody might think it's an `unescape` issue only, it's not. Being an anti-pattern with side effects works both ways. + +As example, changing the order of the replacement in escaping would produce the unexpected: +```js +function escape(s) { + return s.replace(//g, ">") + .replace(/'/g, "'") + .replace(/"/g, """) + .replace(/&/g, "&"); +} + +escape('<'); // &lt; instead of < +``` +If we do not want to code with the fear that the order wasn't perfect or that our order in either escaping or unescaping is different from the order another method or function used, if we understand the issue and we agree it's potentially a disaster prone approach, if we add the fact in this case creating 4 RegExp objects each time and invoking 4 times `.replace` trough the `String.prototype` is also potentially slower than creating one function only holding one object, or holding the function too, we should agree there is not absolutely any valid reason to keep proposing a char-by-char implementation. + +We have proofs this approach can fail already so ... why should we risk? Just avoid and grab all chars at once or simply use this tiny utility. + +### Backtick +Internt explorer < 9 has [some backtick issue](https://html5sec.org/#102) + +For compatibility sake with common server-side HTML entities encoders and decoders, and in order to have the most reliable I/O, this little utility will NOT fix this IE < 9 problem. + +It is also important to note that if we create valid HTML and we set attributes at runtime through this utility, backticks in strings cannot possibly affect attribute behaviors. + +```js +var img = new Image(); +img.src = html.escape( + 'x` `"` `' +); +// it won't cause problems even in IE < 9 +``` + +**However**, if you use `innerHTML` and you target IE < 9 then [this **might** be a problem](https://github.com/nette/nette/issues/1496). + +Accordingly, if you need more chars and/or backticks to be escaped and unescaped, feel free to use alternatives like [lodash](https://github.com/lodash/lodash) or [he](https://www.npmjs.com/package/he) + +Here a bit more of [my POV](https://github.com/WebReflection/html-escaper/commit/52d554fc6e8583b6ffdd357967cf71962fc07cf6#commitcomment-10625122) and why I haven't implemented same thing alternatives did. Good news: those are alternatives ;-) \ No newline at end of file diff --git a/tools/ui/node_modules/html-escaper/cjs/index.js b/tools/ui/node_modules/html-escaper/cjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..164a34cb6fd4f919c8ca9dca8c6978cbe922e31b --- /dev/null +++ b/tools/ui/node_modules/html-escaper/cjs/index.js @@ -0,0 +1,65 @@ +'use strict'; +/** + * Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +var replace = ''.replace; + +var ca = /[&<>'"]/g; +var es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g; + +var esca = { + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' +}; +var unes = { + '&': '&', + '&': '&', + '<': '<', + '<': '<', + '>': '>', + '>': '>', + ''': "'", + ''': "'", + '"': '"', + '"': '"' +}; + +function escape(es) { + return replace.call(es, ca, pe); +} +exports.escape = escape; + +function unescape(un) { + return replace.call(un, es, cape); +} +exports.unescape = unescape; + +function pe(m) { + return esca[m]; +} + +function cape(m) { + return unes[m]; +} diff --git a/tools/ui/node_modules/html-escaper/cjs/package.json b/tools/ui/node_modules/html-escaper/cjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0292b9956f2e40d6eb3d0f3998e710d973113aaa --- /dev/null +++ b/tools/ui/node_modules/html-escaper/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/tools/ui/node_modules/html-escaper/esm/index.js b/tools/ui/node_modules/html-escaper/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e05b93f6a176071a91c4a30a1412b31af92754f0 --- /dev/null +++ b/tools/ui/node_modules/html-escaper/esm/index.js @@ -0,0 +1,62 @@ +/** + * Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +var replace = ''.replace; + +var ca = /[&<>'"]/g; +var es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g; + +var esca = { + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' +}; +var unes = { + '&': '&', + '&': '&', + '<': '<', + '<': '<', + '>': '>', + '>': '>', + ''': "'", + ''': "'", + '"': '"', + '"': '"' +}; + +export function escape(es) { + return replace.call(es, ca, pe); +}; + +export function unescape(un) { + return replace.call(un, es, cape); +}; + +function pe(m) { + return esca[m]; +} + +function cape(m) { + return unes[m]; +} diff --git a/tools/ui/node_modules/html-escaper/index.js b/tools/ui/node_modules/html-escaper/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6c3f2ab4dfea33d81186b9d429532e2ca1cb0e07 --- /dev/null +++ b/tools/ui/node_modules/html-escaper/index.js @@ -0,0 +1,70 @@ +var html = (function (exports) { + 'use strict'; + + /** + * Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + var replace = ''.replace; + + var ca = /[&<>'"]/g; + var es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g; + + var esca = { + '&': '&', + '<': '<', + '>': '>', + "'": ''', + '"': '"' + }; + var unes = { + '&': '&', + '&': '&', + '<': '<', + '<': '<', + '>': '>', + '>': '>', + ''': "'", + ''': "'", + '"': '"', + '"': '"' + }; + + function escape(es) { + return replace.call(es, ca, pe); + } + function unescape(un) { + return replace.call(un, es, cape); + } + function pe(m) { + return esca[m]; + } + + function cape(m) { + return unes[m]; + } + + exports.escape = escape; + exports.unescape = unescape; + + return exports; + +}({})); diff --git a/tools/ui/node_modules/html-escaper/min.js b/tools/ui/node_modules/html-escaper/min.js new file mode 100644 index 0000000000000000000000000000000000000000..54d0c2356b834f49cbcb6f881326564fa645c168 --- /dev/null +++ b/tools/ui/node_modules/html-escaper/min.js @@ -0,0 +1 @@ +var html=function(t){"use strict";var n="".replace,u=/[&<>'"]/g,r=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,a={"&":"&","<":"<",">":">","'":"'",'"':"""},e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'};function c(t){return a[t]}function o(t){return e[t]}return t.escape=function(t){return n.call(t,u,c)},t.unescape=function(t){return n.call(t,r,o)},t}({}); \ No newline at end of file diff --git a/tools/ui/node_modules/html-escaper/package.json b/tools/ui/node_modules/html-escaper/package.json new file mode 100644 index 0000000000000000000000000000000000000000..81d06a97cbeb06f49840434d7cdd7053d1573bb9 --- /dev/null +++ b/tools/ui/node_modules/html-escaper/package.json @@ -0,0 +1,42 @@ +{ + "name": "html-escaper", + "version": "2.0.2", + "description": "fast and safe way to escape and unescape &<>'\" chars", + "main": "./cjs/index.js", + "unpkg": "min.js", + "scripts": { + "build": "npm run cjs && npm run rollup && npm run minify && npm test && npm run size", + "cjs": "ascjs esm cjs", + "coveralls": "cat ./coverage/lcov.info | coveralls", + "minify": "uglifyjs index.js --comments=/^!/ --compress --mangle -o min.js", + "rollup": "rollup --config rollup.config.js", + "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c min.js | wc -c", + "test": "istanbul cover ./test/index.js" + }, + "module": "./esm/index.js", + "repository": { + "type": "git", + "url": "https://github.com/WebReflection/html-escaper.git" + }, + "keywords": [ + "html", + "escape", + "encode", + "unescape", + "decode", + "entities" + ], + "author": "Andrea Giammarchi", + "license": "MIT", + "bugs": { + "url": "https://github.com/WebReflection/html-escaper/issues" + }, + "homepage": "https://github.com/WebReflection/html-escaper", + "devDependencies": { + "ascjs": "^3.1.2", + "coveralls": "^3.0.11", + "istanbul": "^0.4.5", + "rollup": "^2.1.0", + "uglify-js": "^3.8.0" + } +} diff --git a/tools/ui/node_modules/html-escaper/test/index.js b/tools/ui/node_modules/html-escaper/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0eb00dee486368a3a8fbe6180ff05fd461d4b23e --- /dev/null +++ b/tools/ui/node_modules/html-escaper/test/index.js @@ -0,0 +1,23 @@ +delete Object.freeze; + +var html = require('../cjs'); + +console.assert( + html.escape('&<>\'"') === '&<>'"', + 'correct escape' +); + +console.assert( + html.escape('<>\'"&') === '<>'"&', + 'correct inverted escape' +); + +console.assert( + '&<>\'"' === html.unescape('&<>'"'), + 'correct unescape' +); + +console.assert( + '<>\'"&' === html.unescape('<>'"&'), + 'correct inverted unescape' +); diff --git a/tools/ui/node_modules/html-escaper/test/package.json b/tools/ui/node_modules/html-escaper/test/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0292b9956f2e40d6eb3d0f3998e710d973113aaa --- /dev/null +++ b/tools/ui/node_modules/html-escaper/test/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/tools/ui/node_modules/html-void-elements/index.d.ts b/tools/ui/node_modules/html-void-elements/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4abdb3ea3e783dc84e7a48c976e27ae62a380776 --- /dev/null +++ b/tools/ui/node_modules/html-void-elements/index.d.ts @@ -0,0 +1,6 @@ +/** + * List of HTML void tag names. + * + * @type {Array} + */ +export const htmlVoidElements: Array diff --git a/tools/ui/node_modules/html-void-elements/index.js b/tools/ui/node_modules/html-void-elements/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d75f3be6e703f420c51a74c3bf92455589b0e267 --- /dev/null +++ b/tools/ui/node_modules/html-void-elements/index.js @@ -0,0 +1,27 @@ +/** + * List of HTML void tag names. + * + * @type {Array} + */ +export const htmlVoidElements = [ + 'area', + 'base', + 'basefont', + 'bgsound', + 'br', + 'col', + 'command', + 'embed', + 'frame', + 'hr', + 'image', + 'img', + 'input', + 'keygen', + 'link', + 'meta', + 'param', + 'source', + 'track', + 'wbr' +] diff --git a/tools/ui/node_modules/html-void-elements/license b/tools/ui/node_modules/html-void-elements/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/html-void-elements/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/html-void-elements/package.json b/tools/ui/node_modules/html-void-elements/package.json new file mode 100644 index 0000000000000000000000000000000000000000..dd9c020a85445d8b1a44a8026c8ce439bf0817eb --- /dev/null +++ b/tools/ui/node_modules/html-void-elements/package.json @@ -0,0 +1,79 @@ +{ + "name": "html-void-elements", + "version": "3.0.0", + "description": "List of HTML void tag names", + "license": "MIT", + "keywords": [ + "html", + "void", + "tag", + "name", + "element", + "tagname", + "w3c", + "whatwg" + ], + "repository": "wooorm/html-void-elements", + "bugs": "https://github.com/wooorm/html-void-elements/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "main": "index.js", + "types": "index.d.ts", + "files": [ + "index.d.ts", + "index.js" + ], + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^7.0.0", + "hast-util-from-html": "^1.0.0", + "hast-util-select": "^5.0.0", + "hast-util-to-string": "^2.0.0", + "node-fetch": "^3.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "generate": "node --conditions development build.js", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api", + "test": "npm run generate && npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "strict": true, + "ignoreCatch": true + } +} diff --git a/tools/ui/node_modules/html-void-elements/readme.md b/tools/ui/node_modules/html-void-elements/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..d47a4d8bf52e85b3329b67e031e262ccd72cca4e --- /dev/null +++ b/tools/ui/node_modules/html-void-elements/readme.md @@ -0,0 +1,164 @@ +# html-void-elements + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +List of HTML void tag names. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`htmlVoidElements`](#htmlvoidelements) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This is a list of all void tag names according to HTML. + +> 👉 **Note**: includes ancient (such as `basefont` and `bgsound`) tag names +> too. + +## When should I use this? + +You can use this when you’re writing HTML parsers, minifiers, or compilers. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 14.14+, 16.0+), install with [npm][]: + +```sh +npm install html-void-elements +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {htmlVoidElements} from 'https://esm.sh/html-void-elements@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {htmlVoidElements} from 'html-void-elements' + +console.log(htmlVoidElements) +``` + +Yields: + +```js +[ + 'area', + 'base', + 'basefont', + 'bgsound', + 'br', + 'col', + 'command', + 'embed', + 'frame', + 'hr', + 'image', + 'img', + 'input', + 'keygen', + 'link', + 'meta', + 'param', + 'source', + 'track', + 'wbr' +] +``` + +## API + +This package exports the identifier `htmlVoidElements`. +There is no default export. + +### `htmlVoidElements` + +List of HTML void tag names (`Array`). + +## Types + +This package is fully typed with [TypeScript][]. +It exports no additional types. + +## Compatibility + +This package is at least compatible with all maintained versions of Node.js. +As of now, that is Node.js 14.14+ and 16.0+. +It also works in Deno and modern browsers. + +## Security + +This package is safe. + +## Related + +* [`wooorm/html-tag-names`](https://github.com/wooorm/html-tag-names) + — list of HTML tag names +* [`wooorm/html-element-attributes`](https://github.com/wooorm/html-element-attributes) + — map of HTML elements to attributes + +## Contribute + +Yes please! +See [How to Contribute to Open Source][contribute]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/wooorm/html-void-elements/workflows/main/badge.svg + +[build]: https://github.com/wooorm/html-void-elements/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/html-void-elements.svg + +[coverage]: https://codecov.io/github/wooorm/html-void-elements + +[downloads-badge]: https://img.shields.io/npm/dm/html-void-elements.svg + +[downloads]: https://www.npmjs.com/package/html-void-elements + +[size-badge]: https://img.shields.io/bundlephobia/minzip/html-void-elements.svg + +[size]: https://bundlephobia.com/result?p=html-void-elements + +[npm]: https://docs.npmjs.com/cli/install + +[esmsh]: https://esm.sh + +[license]: license + +[author]: https://wooorm.com + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[typescript]: https://www.typescriptlang.org + +[contribute]: https://opensource.guide/how-to-contribute/ diff --git a/tools/ui/node_modules/http-errors/HISTORY.md b/tools/ui/node_modules/http-errors/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..3d81d265fce0e22b50480e292188d9d5b733fd7f --- /dev/null +++ b/tools/ui/node_modules/http-errors/HISTORY.md @@ -0,0 +1,186 @@ +2.0.1 / 2025-11-20 +================== + + * deps: use tilde notation for dependencies + * deps: update statuses to 2.0.2 + +2.0.0 / 2021-12-17 +================== + + * Drop support for Node.js 0.6 + * Remove `I'mateapot` export; use `ImATeapot` instead + * Remove support for status being non-first argument + * Rename `UnorderedCollection` constructor to `TooEarly` + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: statuses@2.0.1 + - Fix messaging casing of `418 I'm a Teapot` + - Remove code 306 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +2021-11-14 / 1.8.1 +================== + + * deps: toidentifier@1.0.1 + +2020-06-29 / 1.8.0 +================== + + * Add `isHttpError` export to determine if value is an HTTP error + * deps: setprototypeof@1.2.0 + +2019-06-24 / 1.7.3 +================== + + * deps: inherits@2.0.4 + +2019-02-18 / 1.7.2 +================== + + * deps: setprototypeof@1.1.1 + +2018-09-08 / 1.7.1 +================== + + * Fix error creating objects in some environments + +2018-07-30 / 1.7.0 +================== + + * Set constructor name when possible + * Use `toidentifier` module to make class names + * deps: statuses@'>= 1.5.0 < 2' + +2018-03-29 / 1.6.3 +================== + + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: setprototypeof@1.1.0 + * deps: statuses@'>= 1.4.0 < 2' + +2017-08-04 / 1.6.2 +================== + + * deps: depd@1.1.1 + - Remove unnecessary `Buffer` loading + +2017-02-20 / 1.6.1 +================== + + * deps: setprototypeof@1.0.3 + - Fix shim for old browsers + +2017-02-14 / 1.6.0 +================== + + * Accept custom 4xx and 5xx status codes in factory + * Add deprecation message to `"I'mateapot"` export + * Deprecate passing status code as anything except first argument in factory + * Deprecate using non-error status codes + * Make `message` property enumerable for `HttpError`s + +2016-11-16 / 1.5.1 +================== + + * deps: inherits@2.0.3 + - Fix issue loading in browser + * deps: setprototypeof@1.0.2 + * deps: statuses@'>= 1.3.1 < 2' + +2016-05-18 / 1.5.0 +================== + + * Support new code `421 Misdirected Request` + * Use `setprototypeof` module to replace `__proto__` setting + * deps: statuses@'>= 1.3.0 < 2' + - Add `421 Misdirected Request` + - perf: enable strict mode + * perf: enable strict mode + +2016-01-28 / 1.4.0 +================== + + * Add `HttpError` export, for `err instanceof createError.HttpError` + * deps: inherits@2.0.1 + * deps: statuses@'>= 1.2.1 < 2' + - Fix message for status 451 + - Remove incorrect nginx status code + +2015-02-02 / 1.3.1 +================== + + * Fix regression where status can be overwritten in `createError` `props` + +2015-02-01 / 1.3.0 +================== + + * Construct errors using defined constructors from `createError` + * Fix error names that are not identifiers + - `createError["I'mateapot"]` is now `createError.ImATeapot` + * Set a meaningful `name` property on constructed errors + +2014-12-09 / 1.2.8 +================== + + * Fix stack trace from exported function + * Remove `arguments.callee` usage + +2014-10-14 / 1.2.7 +================== + + * Remove duplicate line + +2014-10-02 / 1.2.6 +================== + + * Fix `expose` to be `true` for `ClientError` constructor + +2014-09-28 / 1.2.5 +================== + + * deps: statuses@1 + +2014-09-21 / 1.2.4 +================== + + * Fix dependency version to work with old `npm`s + +2014-09-21 / 1.2.3 +================== + + * deps: statuses@~1.1.0 + +2014-09-21 / 1.2.2 +================== + + * Fix publish error + +2014-09-21 / 1.2.1 +================== + + * Support Node.js 0.6 + * Use `inherits` instead of `util` + +2014-09-09 / 1.2.0 +================== + + * Fix the way inheriting functions + * Support `expose` being provided in properties argument + +2014-09-08 / 1.1.0 +================== + + * Default status to 500 + * Support provided `error` to extend + +2014-09-08 / 1.0.1 +================== + + * Fix accepting string message + +2014-09-08 / 1.0.0 +================== + + * Initial release diff --git a/tools/ui/node_modules/http-errors/LICENSE b/tools/ui/node_modules/http-errors/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..82af4df54b4ce9aad915485c4660a0abab727a07 --- /dev/null +++ b/tools/ui/node_modules/http-errors/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/ui/node_modules/http-errors/README.md b/tools/ui/node_modules/http-errors/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a8b7330b09582701c7f06f4b4e5a332b3481c55c --- /dev/null +++ b/tools/ui/node_modules/http-errors/README.md @@ -0,0 +1,169 @@ +# http-errors + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][node-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create HTTP errors for Express, Koa, Connect, etc. with ease. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```console +$ npm install http-errors +``` + +## Example + +```js +var createError = require('http-errors') +var express = require('express') +var app = express() + +app.use(function (req, res, next) { + if (!req.user) return next(createError(401, 'Please login to view this page.')) + next() +}) +``` + +## API + +This is the current API, currently extracted from Koa and subject to change. + +### Error Properties + +- `expose` - can be used to signal if `message` should be sent to the client, + defaulting to `false` when `status` >= 500 +- `headers` - can be an object of header names to values to be sent to the + client, defaulting to `undefined`. When defined, the key names should all + be lower-cased +- `message` - the traditional error message, which should be kept short and all + single line +- `status` - the status code of the error, mirroring `statusCode` for general + compatibility +- `statusCode` - the status code of the error, defaulting to `500` + +### createError([status], [message], [properties]) + +Create a new error object with the given message `msg`. +The error object inherits from `createError.HttpError`. + +```js +var err = createError(404, 'This video does not exist!') +``` + +- `status: 500` - the status code as a number +- `message` - the message of the error, defaulting to node's text for that status code. +- `properties` - custom properties to attach to the object + +### createError([status], [error], [properties]) + +Extend the given `error` object with `createError.HttpError` +properties. This will not alter the inheritance of the given +`error` object, and the modified `error` object is the +return value. + + + +```js +fs.readFile('foo.txt', function (err, buf) { + if (err) { + if (err.code === 'ENOENT') { + var httpError = createError(404, err, { expose: false }) + } else { + var httpError = createError(500, err) + } + } +}) +``` + +- `status` - the status code as a number +- `error` - the error object to extend +- `properties` - custom properties to attach to the object + +### createError.isHttpError(val) + +Determine if the provided `val` is an `HttpError`. This will return `true` +if the error inherits from the `HttpError` constructor of this module or +matches the "duck type" for an error this module creates. All outputs from +the `createError` factory will return `true` for this function, including +if an non-`HttpError` was passed into the factory. + +### new createError\[code || name\](\[msg]\)) + +Create a new error object with the given message `msg`. +The error object inherits from `createError.HttpError`. + +```js +var err = new createError.NotFound() +``` + +- `code` - the status code as a number +- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. + +#### List of all constructors + +|Status Code|Constructor Name | +|-----------|-----------------------------| +|400 |BadRequest | +|401 |Unauthorized | +|402 |PaymentRequired | +|403 |Forbidden | +|404 |NotFound | +|405 |MethodNotAllowed | +|406 |NotAcceptable | +|407 |ProxyAuthenticationRequired | +|408 |RequestTimeout | +|409 |Conflict | +|410 |Gone | +|411 |LengthRequired | +|412 |PreconditionFailed | +|413 |PayloadTooLarge | +|414 |URITooLong | +|415 |UnsupportedMediaType | +|416 |RangeNotSatisfiable | +|417 |ExpectationFailed | +|418 |ImATeapot | +|421 |MisdirectedRequest | +|422 |UnprocessableEntity | +|423 |Locked | +|424 |FailedDependency | +|425 |TooEarly | +|426 |UpgradeRequired | +|428 |PreconditionRequired | +|429 |TooManyRequests | +|431 |RequestHeaderFieldsTooLarge | +|451 |UnavailableForLegalReasons | +|500 |InternalServerError | +|501 |NotImplemented | +|502 |BadGateway | +|503 |ServiceUnavailable | +|504 |GatewayTimeout | +|505 |HTTPVersionNotSupported | +|506 |VariantAlsoNegotiates | +|507 |InsufficientStorage | +|508 |LoopDetected | +|509 |BandwidthLimitExceeded | +|510 |NotExtended | +|511 |NetworkAuthenticationRequired| + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci +[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master +[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master +[node-image]: https://badgen.net/npm/node/http-errors +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/http-errors +[npm-url]: https://npmjs.org/package/http-errors +[npm-version-image]: https://badgen.net/npm/v/http-errors +[travis-image]: https://badgen.net/travis/jshttp/http-errors/master +[travis-url]: https://travis-ci.org/jshttp/http-errors diff --git a/tools/ui/node_modules/http-errors/index.js b/tools/ui/node_modules/http-errors/index.js new file mode 100644 index 0000000000000000000000000000000000000000..82271f6f5a843dcc944ee26ecd790e77152de1f6 --- /dev/null +++ b/tools/ui/node_modules/http-errors/index.js @@ -0,0 +1,290 @@ +/*! + * http-errors + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var deprecate = require('depd')('http-errors') +var setPrototypeOf = require('setprototypeof') +var statuses = require('statuses') +var inherits = require('inherits') +var toIdentifier = require('toidentifier') + +/** + * Module exports. + * @public + */ + +module.exports = createError +module.exports.HttpError = createHttpErrorConstructor() +module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError) + +// Populate exports for all constructors +populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) + +/** + * Get the code class of a status code. + * @private + */ + +function codeClass (status) { + return Number(String(status).charAt(0) + '00') +} + +/** + * Create a new HTTP Error. + * + * @returns {Error} + * @public + */ + +function createError () { + // so much arity going on ~_~ + var err + var msg + var status = 500 + var props = {} + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i] + var type = typeof arg + if (type === 'object' && arg instanceof Error) { + err = arg + status = err.status || err.statusCode || status + } else if (type === 'number' && i === 0) { + status = arg + } else if (type === 'string') { + msg = arg + } else if (type === 'object') { + props = arg + } else { + throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type) + } + } + + if (typeof status === 'number' && (status < 400 || status >= 600)) { + deprecate('non-error status code; use only 4xx or 5xx status codes') + } + + if (typeof status !== 'number' || + (!statuses.message[status] && (status < 400 || status >= 600))) { + status = 500 + } + + // constructor + var HttpError = createError[status] || createError[codeClass(status)] + + if (!err) { + // create error + err = HttpError + ? new HttpError(msg) + : new Error(msg || statuses.message[status]) + Error.captureStackTrace(err, createError) + } + + if (!HttpError || !(err instanceof HttpError) || err.status !== status) { + // add properties to generic error + err.expose = status < 500 + err.status = err.statusCode = status + } + + for (var key in props) { + if (key !== 'status' && key !== 'statusCode') { + err[key] = props[key] + } + } + + return err +} + +/** + * Create HTTP error abstract base class. + * @private + */ + +function createHttpErrorConstructor () { + function HttpError () { + throw new TypeError('cannot construct abstract class') + } + + inherits(HttpError, Error) + + return HttpError +} + +/** + * Create a constructor for a client error. + * @private + */ + +function createClientErrorConstructor (HttpError, name, code) { + var className = toClassName(name) + + function ClientError (message) { + // create the error object + var msg = message != null ? message : statuses.message[code] + var err = new Error(msg) + + // capture a stack trace to the construction point + Error.captureStackTrace(err, ClientError) + + // adjust the [[Prototype]] + setPrototypeOf(err, ClientError.prototype) + + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) + + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) + + return err + } + + inherits(ClientError, HttpError) + nameFunc(ClientError, className) + + ClientError.prototype.status = code + ClientError.prototype.statusCode = code + ClientError.prototype.expose = true + + return ClientError +} + +/** + * Create function to test is a value is a HttpError. + * @private + */ + +function createIsHttpErrorFunction (HttpError) { + return function isHttpError (val) { + if (!val || typeof val !== 'object') { + return false + } + + if (val instanceof HttpError) { + return true + } + + return val instanceof Error && + typeof val.expose === 'boolean' && + typeof val.statusCode === 'number' && val.status === val.statusCode + } +} + +/** + * Create a constructor for a server error. + * @private + */ + +function createServerErrorConstructor (HttpError, name, code) { + var className = toClassName(name) + + function ServerError (message) { + // create the error object + var msg = message != null ? message : statuses.message[code] + var err = new Error(msg) + + // capture a stack trace to the construction point + Error.captureStackTrace(err, ServerError) + + // adjust the [[Prototype]] + setPrototypeOf(err, ServerError.prototype) + + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) + + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) + + return err + } + + inherits(ServerError, HttpError) + nameFunc(ServerError, className) + + ServerError.prototype.status = code + ServerError.prototype.statusCode = code + ServerError.prototype.expose = false + + return ServerError +} + +/** + * Set the name of a function, if possible. + * @private + */ + +function nameFunc (func, name) { + var desc = Object.getOwnPropertyDescriptor(func, 'name') + + if (desc && desc.configurable) { + desc.value = name + Object.defineProperty(func, 'name', desc) + } +} + +/** + * Populate the exports object with constructors for every error class. + * @private + */ + +function populateConstructorExports (exports, codes, HttpError) { + codes.forEach(function forEachCode (code) { + var CodeError + var name = toIdentifier(statuses.message[code]) + + switch (codeClass(code)) { + case 400: + CodeError = createClientErrorConstructor(HttpError, name, code) + break + case 500: + CodeError = createServerErrorConstructor(HttpError, name, code) + break + } + + if (CodeError) { + // export the constructor + exports[code] = CodeError + exports[name] = CodeError + } + }) +} + +/** + * Get a class name from a name identifier. + * + * @param {string} name + * @returns {string} + * @private + */ + +function toClassName (name) { + return name.slice(-5) === 'Error' ? name : name + 'Error' +} diff --git a/tools/ui/node_modules/http-errors/package.json b/tools/ui/node_modules/http-errors/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4b46d62ada7a01dc123d18a30dbcf1071b70ab0a --- /dev/null +++ b/tools/ui/node_modules/http-errors/package.json @@ -0,0 +1,54 @@ +{ + "name": "http-errors", + "description": "Create HTTP error objects", + "version": "2.0.1", + "author": "Jonathan Ong (http://jongleberry.com)", + "contributors": [ + "Alan Plum ", + "Douglas Christopher Wilson " + ], + "license": "MIT", + "repository": "jshttp/http-errors", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint . && node ./scripts/lint-readme-list.js", + "test": "mocha --reporter spec", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + }, + "keywords": [ + "http", + "error" + ], + "files": [ + "index.js", + "HISTORY.md", + "LICENSE", + "README.md" + ] +} diff --git a/tools/ui/node_modules/http-proxy/.auto-changelog b/tools/ui/node_modules/http-proxy/.auto-changelog new file mode 100644 index 0000000000000000000000000000000000000000..38e245582906bb205b30ea751fffe3f999ed4679 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/.auto-changelog @@ -0,0 +1,6 @@ +{ + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": true, + "commitLimit": false +} \ No newline at end of file diff --git a/tools/ui/node_modules/http-proxy/.gitattributes b/tools/ui/node_modules/http-proxy/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..1a6bd458748bdf50ff241ec18cc99027030fe02c --- /dev/null +++ b/tools/ui/node_modules/http-proxy/.gitattributes @@ -0,0 +1 @@ +package-lock.json binary diff --git a/tools/ui/node_modules/http-proxy/CHANGELOG.md b/tools/ui/node_modules/http-proxy/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..6c80d84c4060ccffc24f9f16476689f8c7dfa8e2 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/CHANGELOG.md @@ -0,0 +1,1872 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.18.1](https://github.com/http-party/node-http-proxy/compare/1.18.0...v1.18.1) - 2020-05-17 + +### Merged + +- Skip sending the proxyReq event when the expect header is present [`#1447`](https://github.com/http-party/node-http-proxy/pull/1447) +- Remove node6 support, add node12 to build [`#1397`](https://github.com/http-party/node-http-proxy/pull/1397) + +## [1.18.0](https://github.com/http-party/node-http-proxy/compare/1.17.0...1.18.0) - 2019-09-18 + +### Merged + +- Added in auto-changelog module set to keepachangelog format [`#1373`](https://github.com/http-party/node-http-proxy/pull/1373) +- fix 'Modify Response' readme section to avoid unnecessary array copying [`#1300`](https://github.com/http-party/node-http-proxy/pull/1300) +- Fix incorrect target name for reverse proxy example [`#1135`](https://github.com/http-party/node-http-proxy/pull/1135) +- Fix modify response middleware example [`#1139`](https://github.com/http-party/node-http-proxy/pull/1139) +- [dist] Update dependency async to v3 [`#1359`](https://github.com/http-party/node-http-proxy/pull/1359) +- Fix path to local http-proxy in examples. [`#1072`](https://github.com/http-party/node-http-proxy/pull/1072) +- fix reverse-proxy example require path [`#1067`](https://github.com/http-party/node-http-proxy/pull/1067) +- Update README.md [`#970`](https://github.com/http-party/node-http-proxy/pull/970) +- [dist] Update dependency request to ~2.88.0 [SECURITY] [`#1357`](https://github.com/http-party/node-http-proxy/pull/1357) +- [dist] Update dependency eventemitter3 to v4 [`#1365`](https://github.com/http-party/node-http-proxy/pull/1365) +- [dist] Update dependency colors to v1 [`#1360`](https://github.com/http-party/node-http-proxy/pull/1360) +- [dist] Update all non-major dependencies [`#1356`](https://github.com/http-party/node-http-proxy/pull/1356) +- [dist] Update dependency agentkeepalive to v4 [`#1358`](https://github.com/http-party/node-http-proxy/pull/1358) +- [dist] Update dependency nyc to v14 [`#1367`](https://github.com/http-party/node-http-proxy/pull/1367) +- [dist] Update dependency concat-stream to v2 [`#1363`](https://github.com/http-party/node-http-proxy/pull/1363) +- x-forwarded-host overwrite for mutli level proxies [`#1267`](https://github.com/http-party/node-http-proxy/pull/1267) +- [refactor doc] Complete rename to http-party org. [`#1362`](https://github.com/http-party/node-http-proxy/pull/1362) +- Highlight correct lines for createProxyServer [`#1117`](https://github.com/http-party/node-http-proxy/pull/1117) +- Fix docs for rewrite options - 201 also handled [`#1147`](https://github.com/http-party/node-http-proxy/pull/1147) +- Update .nyc_output [`#1339`](https://github.com/http-party/node-http-proxy/pull/1339) +- Configure Renovate [`#1355`](https://github.com/http-party/node-http-proxy/pull/1355) +- [examples] Restream body before proxying, support for Content-Type of application/x-www-form-urlencoded [`#1264`](https://github.com/http-party/node-http-proxy/pull/1264) + +### Commits + +- [dist] New test fixtures. [`7e4a0e5`](https://github.com/http-party/node-http-proxy/commit/7e4a0e511bc30c059216860153301de2cdd1e97f) +- [dist] End of an era. [`a9b09cc`](https://github.com/http-party/node-http-proxy/commit/a9b09cce43f072db99fb5170030a05536177ccb7) +- [dist] Version bump. 1.18.0 [`9bbe486`](https://github.com/http-party/node-http-proxy/commit/9bbe486c5efcc356fb4d189ef38eee275bbde345) +- [fix] Latest versions. [`59c4403`](https://github.com/http-party/node-http-proxy/commit/59c4403e9dc15ab9b19ee2a3f4aecbfc6c3d94c4) +- [fix test] Update tests. [`dd1d08b`](https://github.com/http-party/node-http-proxy/commit/dd1d08b6319d1def729554446a5b0176978a8dad) +- [dist] Update dependency ws to v3 [SECURITY] [`b00911c`](https://github.com/http-party/node-http-proxy/commit/b00911c93740a00c5cfbacbb91565cb6912ed255) +- [dist] .gitattributes all the things. [`fc93520`](https://github.com/http-party/node-http-proxy/commit/fc93520d741ec80be8ae31ca005f3e9c199e330e) +- [dist] Regenerate package-lock.json. [`16d4f8a`](https://github.com/http-party/node-http-proxy/commit/16d4f8a95162b2e2e4ee6657c500f1208c044b2d) + +## [1.17.0](https://github.com/http-party/node-http-proxy/compare/1.16.2...1.17.0) - 2018-04-20 + +### Merged + +- Fix overwriting of global options [`#1074`](https://github.com/http-party/node-http-proxy/pull/1074) +- Update README.md [`#1131`](https://github.com/http-party/node-http-proxy/pull/1131) +- Update README.md with CoC link [`#1120`](https://github.com/http-party/node-http-proxy/pull/1120) +- Add Code Of Conduct [`#1119`](https://github.com/http-party/node-http-proxy/pull/1119) +- [deps] Update eventemitter3 to version 2.0.x [`#1109`](https://github.com/http-party/node-http-proxy/pull/1109) + +### Fixed + +- Fix "Can't set headers after they are sent" errors [`#930`](https://github.com/http-party/node-http-proxy/issues/930) +- Include websocket non-upgrade response [`#890`](https://github.com/http-party/node-http-proxy/issues/890) + +### Commits + +- Add followRedirects option [`c9a556c`](https://github.com/http-party/node-http-proxy/commit/c9a556cfa57c7ce0b877e16f2c2e1448d8cc278d) +- [test] add test for selfHandleRequest and remove modifyResponse as selfHandleRequest is the only way that functionality works [`4a37175`](https://github.com/http-party/node-http-proxy/commit/4a37175a5296d2ea2da0fc15a3f8fe08599bb592) +- Adding ability to set cookie path [`2c98416`](https://github.com/http-party/node-http-proxy/commit/2c98416ac2bf17bb5f515b9e10ee4485f5913846) +- Updating docs and adding more tests. [`f5c2381`](https://github.com/http-party/node-http-proxy/commit/f5c2381395e01bf8d6655cc70e14032c8f0aaa67) +- [dist] make tests work reliably, add package-lock.json [`09dcb98`](https://github.com/http-party/node-http-proxy/commit/09dcb984565dabb159a01a75a188b974f8c176ad) +- add support for modify response [`e5c02b8`](https://github.com/http-party/node-http-proxy/commit/e5c02b8a8a902e204eee886acafbbfe46c4a3aef) +- [wip] proper tests and reporting [`f4ff100`](https://github.com/http-party/node-http-proxy/commit/f4ff1006b9e71eb4185a3edf03333dbe514a84c9) +- Add detail about "buffer" option [`6f88caf`](https://github.com/http-party/node-http-proxy/commit/6f88caf6e46d84a809910c591e138250b333b39f) +- Add use case for proxy to HTTPS using a PKCS12 client certificate [`d2f9db8`](https://github.com/http-party/node-http-proxy/commit/d2f9db824136358a06dc3dd566644f3a016f24e2) +- [test] for override method feature [`81d58c5`](https://github.com/http-party/node-http-proxy/commit/81d58c531be3f61efb56d2489a66c73a7b2325fe) +- [dist] doc updates [`e94d529`](https://github.com/http-party/node-http-proxy/commit/e94d52973a26cf817a9de12d97e5ae603093f70d) +- feat: 添加response自处理参数 [`89f9ef8`](https://github.com/http-party/node-http-proxy/commit/89f9ef87e0532d54d086719c5ace1a968a42e51b) +- [dist][test] codecov config [`a4bccc3`](https://github.com/http-party/node-http-proxy/commit/a4bccc332d36d7db93db984674cd7e51b43a1b99) +- Removing unnecessary check since this is a private API [`bc6a237`](https://github.com/http-party/node-http-proxy/commit/bc6a23709c37c65b5b16cc802d05cb57f099b0ce) +- issue #953: stop using writeHead [`2c44039`](https://github.com/http-party/node-http-proxy/commit/2c44039a7c30b190043da654ee7e5aed0304e979) +- [fix] move badges [`543636d`](https://github.com/http-party/node-http-proxy/commit/543636d0f662308ec8c9afdbf641f4036f002bfd) +- fix small typos in README [`8231984`](https://github.com/http-party/node-http-proxy/commit/8231984fb02dca331b4ef77e089db50855eea4f5) +- Added timeout option to docs [`107c187`](https://github.com/http-party/node-http-proxy/commit/107c18720c3906f9049cc14d075b31910c0ccf55) +- [dist] document the feature [`d533a1b`](https://github.com/http-party/node-http-proxy/commit/d533a1be437b37fed5bd25f5e58298eea819f974) +- [fix] slightly more tolerant [`de1b808`](https://github.com/http-party/node-http-proxy/commit/de1b80851ab1b1251b5eaeaf0beab164024f09b6) +- Forgot 'i' flag when changing from regex shorthand to string. [`50f58b4`](https://github.com/http-party/node-http-proxy/commit/50f58b4cd9b4422a11512a6a065432159b5bc806) +- Update common.js [`c5d8466`](https://github.com/http-party/node-http-proxy/commit/c5d846648304f2e36a172b25d9fb8300d8131f8c) +- [fix] rm newline [`e6f24ba`](https://github.com/http-party/node-http-proxy/commit/e6f24ba6173c4fdd26089b3c729de5dbdd71ad74) +- [dist] update package-lock.json [`abf882e`](https://github.com/http-party/node-http-proxy/commit/abf882e03c92cf1665d5b7d4dbdaf87feb50a677) + +## [1.16.2](https://github.com/http-party/node-http-proxy/compare/1.16.1...1.16.2) - 2016-12-06 + +### Merged + +- [WIP] Revert default behavior of writeHeaders method [`#1104`](https://github.com/http-party/node-http-proxy/pull/1104) + +## [1.16.1](https://github.com/http-party/node-http-proxy/compare/1.16.0...1.16.1) - 2016-12-04 + +### Commits + +- Enable proxy response to have multiple Set-Cookie raw headers #1101 [`8cb451f`](https://github.com/http-party/node-http-proxy/commit/8cb451f20cff0a19fc9576fc2558307fb17a5710) +- [dist] Version bump. 1.16.1 [`ac1a01b`](https://github.com/http-party/node-http-proxy/commit/ac1a01b1f3caa3a2a9433341bf5e7a95072d6612) + +## [1.16.0](https://github.com/http-party/node-http-proxy/compare/1.15.2...1.16.0) - 2016-12-02 + +### Merged + +- Fix newly introduced error in error handler for ECONNREFUSED in forward proxy [`#1100`](https://github.com/http-party/node-http-proxy/pull/1100) +- Keep original letter case of response header keys [`#1098`](https://github.com/http-party/node-http-proxy/pull/1098) +- Handle errors for forward request, add test case [`#1099`](https://github.com/http-party/node-http-proxy/pull/1099) + +### Commits + +- add node 6 to travis [`2f7f037`](https://github.com/http-party/node-http-proxy/commit/2f7f03778cfb94396acf0d778061ea197212fbb5) + +## [1.15.2](https://github.com/http-party/node-http-proxy/compare/1.15.1...1.15.2) - 2016-10-22 + +### Merged + +- Add proxy-timeout option to documentation [`#1075`](https://github.com/http-party/node-http-proxy/pull/1075) + +### Commits + +- Do not rely on func.name (no scope) [`61c2889`](https://github.com/http-party/node-http-proxy/commit/61c28891093b256bbc0dae78e45e2c5f0acf2101) +- Do not rely on func.name (no scope) [`d48f67e`](https://github.com/http-party/node-http-proxy/commit/d48f67eb90d8af66211093e91efdd6638859e0bf) +- Expose full callback names [`220f5fb`](https://github.com/http-party/node-http-proxy/commit/220f5fb795d2977c5a68ae59d7db65089efed50c) +- test case added [`f5217d6`](https://github.com/http-party/node-http-proxy/commit/f5217d6c20c164ed412a3b20f660786b6f88b35b) +- [fix] style nits [`d0f1dfe`](https://github.com/http-party/node-http-proxy/commit/d0f1dfeb8277d46a057017cd888b50e85f6725d6) +- With a comment [`fbc2668`](https://github.com/http-party/node-http-proxy/commit/fbc266809c289fbdb59d7944345816a858303c96) +- Fix browserification [`8eddf45`](https://github.com/http-party/node-http-proxy/commit/8eddf45f2a043e4e1b3f6e33c304e68fe7e1c406) +- not setting connection header in case of http2 as it is deprecated [`2d01edc`](https://github.com/http-party/node-http-proxy/commit/2d01edc5a5ace591784022b85860a3bbc48c5e12) + +## [1.15.1](https://github.com/http-party/node-http-proxy/compare/1.15.0...1.15.1) - 2016-09-14 + +### Merged + +- Properly write response header optionally including statusMessage [`#1061`](https://github.com/http-party/node-http-proxy/pull/1061) + +### Commits + +- [dist] Version bump. 1.15.1 [`912cd3a`](https://github.com/http-party/node-http-proxy/commit/912cd3acaef484f7ea08affc9339250082e04058) + +## [1.15.0](https://github.com/http-party/node-http-proxy/compare/1.14.0...1.15.0) - 2016-09-14 + +### Merged + +- Made it not to crash with omited Host http header [`#1050`](https://github.com/http-party/node-http-proxy/pull/1050) +- README.md: fix typo: 'ingoing' should be 'incoming' [`#1060`](https://github.com/http-party/node-http-proxy/pull/1060) +- Fix for Reason-Phrase being overwritten on proxy response. [`#1051`](https://github.com/http-party/node-http-proxy/pull/1051) +- cookieDomainRewrite option [`#1009`](https://github.com/http-party/node-http-proxy/pull/1009) +- Update ntlm-authentication.js [`#1025`](https://github.com/http-party/node-http-proxy/pull/1025) +- Restream body before proxying [`#1027`](https://github.com/http-party/node-http-proxy/pull/1027) +- Location rewriting for responses with status 201 [`#1024`](https://github.com/http-party/node-http-proxy/pull/1024) +- #866 Copy CA from options into outbound proxy [`#1042`](https://github.com/http-party/node-http-proxy/pull/1042) + +### Fixed + +- Restream body before proxying (#1027) [`#955`](https://github.com/http-party/node-http-proxy/issues/955) + +### Commits + +- [dist] Version bump. 1.15.0 [`b98c75b`](https://github.com/http-party/node-http-proxy/commit/b98c75b1ff3ebdf7f78224eb0d9aa857af2db1d9) + +## [1.14.0](https://github.com/http-party/node-http-proxy/compare/1.13.3...1.14.0) - 2016-06-15 + +### Merged + +- Emit disconnected event instead of error when ECONNRESET [`#966`](https://github.com/http-party/node-http-proxy/pull/966) +- fix test for node 0.10 + socket.io-client@1.4.6 (engine.io-client@1.6.9) [`#1010`](https://github.com/http-party/node-http-proxy/pull/1010) + +### Commits + +- [dist] Version bump. 1.14.0 [`fcfb0b3`](https://github.com/http-party/node-http-proxy/commit/fcfb0b37f6ac61369565507446377f91d955cf29) + +## [1.13.3](https://github.com/http-party/node-http-proxy/compare/1.13.2...1.13.3) - 2016-05-16 + +### Merged + +- fix browserify compatibility [`#975`](https://github.com/http-party/node-http-proxy/pull/975) +- alter message error [`#998`](https://github.com/http-party/node-http-proxy/pull/998) +- Sanitize header keys before setting them [`#997`](https://github.com/http-party/node-http-proxy/pull/997) +- Update ntlm-authentication.js [`#989`](https://github.com/http-party/node-http-proxy/pull/989) +- Add expected datatype to readme [`#983`](https://github.com/http-party/node-http-proxy/pull/983) +- Update README [`#982`](https://github.com/http-party/node-http-proxy/pull/982) +- Fix formatting of the `headers` option [`#974`](https://github.com/http-party/node-http-proxy/pull/974) +- Set the x-forwarded-host flag when xfwd is enabled [`#967`](https://github.com/http-party/node-http-proxy/pull/967) + +### Fixed + +- Sanitize header keys before setting them (#997) [`#996`](https://github.com/http-party/node-http-proxy/issues/996) + +### Commits + +- [dist] Update LICENSE to reflect 2015 changes. [`f345a1a`](https://github.com/http-party/node-http-proxy/commit/f345a1ac2dde1884e72b952a685a0a1796059f14) +- [dist] Version bump. 1.13.3 [`5082acc`](https://github.com/http-party/node-http-proxy/commit/5082acc067bbf287f503bbd5b776f798ab169db1) + +## [1.13.2](https://github.com/http-party/node-http-proxy/compare/1.13.1...1.13.2) - 2016-02-17 + +### Merged + +- Fixed missing documentation: #options.headers [`#806`](https://github.com/http-party/node-http-proxy/pull/806) +- #949 Proxy example using req instead res on README [`#950`](https://github.com/http-party/node-http-proxy/pull/950) +- mocha: Use default reporter [`#962`](https://github.com/http-party/node-http-proxy/pull/962) +- Remove "transfer-encoding" header if "content-length" is set to zero [`#961`](https://github.com/http-party/node-http-proxy/pull/961) + +### Commits + +- [dist] Version bump. 1.13.2 [`e1b2f4c`](https://github.com/http-party/node-http-proxy/commit/e1b2f4c31b34464431db251b3b6169689dadf518) + +## [1.13.1](https://github.com/http-party/node-http-proxy/compare/1.13.0...1.13.1) - 2016-02-02 + +### Merged + +- README.md: summary to specify reverse proxy [`#932`](https://github.com/http-party/node-http-proxy/pull/932) +- fix(common) urlJoin replace: ":/" -> "http?s:/" [`#947`](https://github.com/http-party/node-http-proxy/pull/947) +- Update README.md [`#948`](https://github.com/http-party/node-http-proxy/pull/948) + +### Commits + +- [dist] Version bump. 1.13.1 [`9d9fa94`](https://github.com/http-party/node-http-proxy/commit/9d9fa940cff3aa6134c60732c23aea8171fc7296) + +## [1.13.0](https://github.com/http-party/node-http-proxy/compare/1.12.1...1.13.0) - 2016-01-26 + +### Merged + +- Fix for #839 (Ignore path and the trailing slash) [`#934`](https://github.com/http-party/node-http-proxy/pull/934) +- Update license year range to 2016 [`#943`](https://github.com/http-party/node-http-proxy/pull/943) + +### Commits + +- [dist] Version bump. 1.13.0 [`268994e`](https://github.com/http-party/node-http-proxy/commit/268994ea45d9f8737343001ab9542e03023a5c96) + +## [1.12.1](https://github.com/http-party/node-http-proxy/compare/1.12.0...1.12.1) - 2016-01-24 + +### Merged + +- Bump version for npm publish [`#942`](https://github.com/http-party/node-http-proxy/pull/942) +- Added check to passes/web-outgoing.js to make sure the header being s… [`#940`](https://github.com/http-party/node-http-proxy/pull/940) +- Created reverse-proxy.js example. [`#825`](https://github.com/http-party/node-http-proxy/pull/825) +- SSE example and test [`#922`](https://github.com/http-party/node-http-proxy/pull/922) +- More structured readme [`#912`](https://github.com/http-party/node-http-proxy/pull/912) +- Updated markdown docs to mention proxy rules module [`#910`](https://github.com/http-party/node-http-proxy/pull/910) +- Add tests for forwarding of continuation frames [`#901`](https://github.com/http-party/node-http-proxy/pull/901) +- Bump requires-port, server and ws [`#904`](https://github.com/http-party/node-http-proxy/pull/904) +- [example] add an example for NTLM authentication [`#903`](https://github.com/http-party/node-http-proxy/pull/903) + +### Commits + +- Organized README more [`cd1d777`](https://github.com/http-party/node-http-proxy/commit/cd1d7776e8fb5d67e2c52b9ef27d8c932e7b72e2) +- Add tests for testing forwarding of continuation frames [`64fa520`](https://github.com/http-party/node-http-proxy/commit/64fa52078913c6d4fe95673f182aac4924961e8b) +- Added back to top helpers [`6106d4c`](https://github.com/http-party/node-http-proxy/commit/6106d4c32f7c7960f0391591661e6f0d229db52d) +- [ci] use node 4.2 to test and do not allow failures [`f82ce18`](https://github.com/http-party/node-http-proxy/commit/f82ce18d2f187b085c2c4f49d857755d21c582b1) +- [fix] bump requires-port, server and ws [`9ea1e89`](https://github.com/http-party/node-http-proxy/commit/9ea1e89a2fd9c392cd40265bdb13494a3614e290) +- Updated markdown docs to mention proxy rules [`eea79ca`](https://github.com/http-party/node-http-proxy/commit/eea79cab53f27371cad387a524ee3aaefa742c48) +- Fixed tests depending on ignorePath [`f9540de`](https://github.com/http-party/node-http-proxy/commit/f9540de7b13f41091be2dcb68d8f23be65ad3885) +- Added check to passes/web-outgoing.js to make sure the header being set is not undefined, which should be the only falsey value that could accidently show up and break that call. This fixes windows NTLM auth issues behind http-proxy. [`3b39d2c`](https://github.com/http-party/node-http-proxy/commit/3b39d2c3dcb1785cc06043fcb226c652f554941e) +- No longer appends / to path if ignorePath is set [`f2093b5`](https://github.com/http-party/node-http-proxy/commit/f2093b5313c855cd6309cc0ddebb31f369e525ed) +- README.md: introduction to specify reverse proxy [`41414a5`](https://github.com/http-party/node-http-proxy/commit/41414a56a11ddfac3a337711ac4c64124eb62377) +- Added note for appending trailing / when using ignorePath [`0cb1d3c`](https://github.com/http-party/node-http-proxy/commit/0cb1d3c68e793fed9aa4a7624c32a018e796aa95) + +## [1.12.0](https://github.com/http-party/node-http-proxy/compare/1.11.3...1.12.0) - 2015-10-22 + +### Merged + +- Issue #896: provide a "proxyReq" event also for websocket connections. [`#897`](https://github.com/http-party/node-http-proxy/pull/897) + +### Commits + +- Provide a "proxyReq" event also for websocket connections. [`a05fc2d`](https://github.com/http-party/node-http-proxy/commit/a05fc2d1692d038f1eaad6d9b26c174039bc1949) +- fixes after PR review [`9752652`](https://github.com/http-party/node-http-proxy/commit/9752652e76da3bcfb6a635620e4162518ca43203) +- [dist] Version bump. 1.12.0 [`b5a6d0e`](https://github.com/http-party/node-http-proxy/commit/b5a6d0e58396363f4c457f6d1654614bdfcfcb73) + +## [1.11.3](https://github.com/http-party/node-http-proxy/compare/1.11.2...1.11.3) - 2015-10-19 + +### Merged + +- Removed unspecified trailing slash in proxy url [`#893`](https://github.com/http-party/node-http-proxy/pull/893) +- Updating the upgrading doc [`#892`](https://github.com/http-party/node-http-proxy/pull/892) + +### Commits + +- [dist] Update .travis.yml to be more modern. [`302d981`](https://github.com/http-party/node-http-proxy/commit/302d981dd2cf06dbf751b1f64e3dfea08d0f9476) +- [dist] Version bump. 1.11.3 [`60baca5`](https://github.com/http-party/node-http-proxy/commit/60baca5aed4f45ef1d7b3f7edd909375853d344b) +- docs: options.headers [`c86ae51`](https://github.com/http-party/node-http-proxy/commit/c86ae51bb9658309a9628f4f5182d4c45c803b84) + +## [1.11.2](https://github.com/http-party/node-http-proxy/compare/v1.11.1...1.11.2) - 2015-08-30 + +### Merged + +- Update gzip-middleware.js [`#870`](https://github.com/http-party/node-http-proxy/pull/870) +- Fix broken option list indentation [`#863`](https://github.com/http-party/node-http-proxy/pull/863) +- Added missing configuration options [`#852`](https://github.com/http-party/node-http-proxy/pull/852) +- Added installation instructions [`#823`](https://github.com/http-party/node-http-proxy/pull/823) +- fixes comment [`#817`](https://github.com/http-party/node-http-proxy/pull/817) + +### Commits + +- Created reverse-proxy.js example. [`38864d0`](https://github.com/http-party/node-http-proxy/commit/38864d016794b9ff3d8d1d1cb81a730b40a1bf9c) +- Added websocket set-cookie headers test [`855cebd`](https://github.com/http-party/node-http-proxy/commit/855cebdac4d33ef5f2fab4c4c78fdc07cdb61402) +- [fix] make more functional [`cea0e86`](https://github.com/http-party/node-http-proxy/commit/cea0e8676b3e609828320bb03051eaf78cc43b54) +- Modify the set-cookie header fix to work with node 0.10.x. [`da674ec`](https://github.com/http-party/node-http-proxy/commit/da674ec4df2b371f09e912f3b376c48581090a0f) +- Use raw headers instead parsed. [`8bfd90c`](https://github.com/http-party/node-http-proxy/commit/8bfd90c4d9331fd129f17a788ef9fc733654b7e0) +- Replaced Object.keys().map with for in loop. [`3d2350c`](https://github.com/http-party/node-http-proxy/commit/3d2350c54ff0fb9271f5fcfea1d23f22ad97c47c) +- [dist] Version bump. 1.11.2 [`30e3b37`](https://github.com/http-party/node-http-proxy/commit/30e3b371de0116e40e15156394f31c7e0b0aa9f1) +- Websocket key was unnecessary long. [`ca73208`](https://github.com/http-party/node-http-proxy/commit/ca732087498582df01ab78fb7da77912dab8f138) + +## [v1.11.1](https://github.com/http-party/node-http-proxy/compare/v1.11.0...v1.11.1) - 2015-04-22 + +### Commits + +- [dist] Version bump. 1.11.1 [`7e6c66a`](https://github.com/http-party/node-http-proxy/commit/7e6c66a7e485a6c0ec3a1c567bbe800fdc56c9fd) +- [fix] dont use bind in the one case we do [`d26ef56`](https://github.com/http-party/node-http-proxy/commit/d26ef56e1bc2a1232b06c01b4740e3bf35d63eda) +- [dist] update to new version of EE3 [`607f96c`](https://github.com/http-party/node-http-proxy/commit/607f96c00cbda2a6b881b8ff1db05437dbf4ce77) +- [fix] use the main export for EE3 [`18c77ca`](https://github.com/http-party/node-http-proxy/commit/18c77cafc7d5479502cf5c4d2b663d8f85cfd6d4) + +## [v1.11.0](https://github.com/http-party/node-http-proxy/compare/v1.10.1...v1.11.0) - 2015-04-20 + +### Merged + +- [api] add an ignorePath option if you want to disregard the path of the ... [`#759`](https://github.com/http-party/node-http-proxy/pull/759) + +### Commits + +- [dist] Version bump. 1.11.0 [`934e6c4`](https://github.com/http-party/node-http-proxy/commit/934e6c4d54292a1b961452074e02fb5d45da729a) + +## [v1.10.1](https://github.com/http-party/node-http-proxy/compare/v1.10.0...v1.10.1) - 2015-04-02 + +### Merged + +- Fix default port detection with node 0.12.x [`#799`](https://github.com/http-party/node-http-proxy/pull/799) + +### Commits + +- [dist] add semver and normalize package.json with --save-dev [`1b89bc9`](https://github.com/http-party/node-http-proxy/commit/1b89bc9a76c229070ff2572f7a0e1b969c4b4701) +- fix protocol and default port detection on node 0.12.x, compatible with 0.10.x [`5f14bca`](https://github.com/http-party/node-http-proxy/commit/5f14bcaa704fe8a5e6f59d3a89722f22958cade9) +- fix expected error message when node 0.12.x [`0ee314c`](https://github.com/http-party/node-http-proxy/commit/0ee314c436226391318b9a1b623cb3f7e8bf4df7) +- force cipher AES128-GCM-SHA256 in https tests [`c33d161`](https://github.com/http-party/node-http-proxy/commit/c33d1616cdbd60587ca2eb326c48b8a87ac56092) +- [fix] properly support iojs with test checking for HTTPS [`c6dfb04`](https://github.com/http-party/node-http-proxy/commit/c6dfb04a67f3b5ac9a402b7b08c1b8baf29f89e6) +- [dist] Version bump. 1.10.1 [`0bd446c`](https://github.com/http-party/node-http-proxy/commit/0bd446c680e9991accfaa3a6a70e411fdac79164) +- [ci] add 0.12 and iojs to travis [`a6ae6c4`](https://github.com/http-party/node-http-proxy/commit/a6ae6c499743ddade9db12b9f7404d980c79f683) + +## [v1.10.0](https://github.com/http-party/node-http-proxy/compare/v1.9.1...v1.10.0) - 2015-04-01 + +### Merged + +- Fixes / additions to URL rewriting [`#787`](https://github.com/http-party/node-http-proxy/pull/787) + +### Commits + +- [dist] Version bump. 1.10.0 [`1dabda2`](https://github.com/http-party/node-http-proxy/commit/1dabda241f3b93eb9195134042e7a3b84fd0ef57) + +## [v1.9.1](https://github.com/http-party/node-http-proxy/compare/v1.9.0...v1.9.1) - 2015-04-01 + +### Merged + +- Fix #747 [`#798`](https://github.com/http-party/node-http-proxy/pull/798) + +### Fixed + +- Merge pull request #798 from damonmcminn/master [`#747`](https://github.com/http-party/node-http-proxy/issues/747) +- Fix https://github.com/nodejitsu/node-http-proxy/issues/747 [`#747`](https://github.com/nodejitsu/node-http-proxy/issues/747) + +### Commits + +- Add test for https://github.com/nodejitsu/node-http-proxy/issues/747 [`d145152`](https://github.com/http-party/node-http-proxy/commit/d145152655a69479348b0ebc726d4dc19720a12b) +- [dist] Version bump. 1.9.1 [`21b30b7`](https://github.com/http-party/node-http-proxy/commit/21b30b754db4f6410c3d2052bc123b3fdae57c46) + +## [v1.9.0](https://github.com/http-party/node-http-proxy/compare/v1.8.1...v1.9.0) - 2015-03-12 + +### Merged + +- Adding the nodejs0.12 auth option [`#792`](https://github.com/http-party/node-http-proxy/pull/792) +- fix "x-forwarded-proto" in node 0.12 and iojs [`#789`](https://github.com/http-party/node-http-proxy/pull/789) +- Add support for auto host rewriting and protocol rewriting [`#1`](https://github.com/http-party/node-http-proxy/pull/1) +- changed highlighted part - very minor [`#756`](https://github.com/http-party/node-http-proxy/pull/756) +- Update README.md for benchmarks [`#625`](https://github.com/http-party/node-http-proxy/pull/625) + +### Fixed + +- fix "x-forwarded-proto" in node 0.12 and iojs [`#772`](https://github.com/http-party/node-http-proxy/issues/772) +- [api] add an ignorePath option if you want to disregard the path of the incoming request when proxying to the target server fixes #758 [`#758`](https://github.com/http-party/node-http-proxy/issues/758) + +### Commits + +- added auth header test [`df158bf`](https://github.com/http-party/node-http-proxy/commit/df158bfc53e35e62609d8169f3883f6dcf12b73c) +- added auth header test [`ff1626f`](https://github.com/http-party/node-http-proxy/commit/ff1626f0719652c92895cf80f9aacc22ededadad) +- refactor some tests for greater readability [`14415a5`](https://github.com/http-party/node-http-proxy/commit/14415a50741d1f258da884686455d87d68eb8121) +- only rewrite redirect urls when it matches target [`26029ba`](https://github.com/http-party/node-http-proxy/commit/26029ba7ac948b5dc0befb2091cc9a5862d0641c) +- auth header added [`ab5c3e5`](https://github.com/http-party/node-http-proxy/commit/ab5c3e5c819ca993e0616d178bc1d282af539508) +- [dist] Version bump. 1.9.0 [`87a92a7`](https://github.com/http-party/node-http-proxy/commit/87a92a72802a27f817fcba87382d55831fd04ddb) +- end of file line space [`e907d7b`](https://github.com/http-party/node-http-proxy/commit/e907d7bb2aa2825b43d9355cb1ee25bec47b15ad) +- space instead of tabs [`7298510`](https://github.com/http-party/node-http-proxy/commit/7298510e9170d74ff057487085bc1e898f044177) +- space instead of tabs [`63c9262`](https://github.com/http-party/node-http-proxy/commit/63c9262df5bd04d83432db44fce2a4d5b19a59ea) +- auth header added tests [`f55ffa3`](https://github.com/http-party/node-http-proxy/commit/f55ffa356a259c09685c6b768a404e4b73f674ce) + +## [v1.8.1](https://github.com/http-party/node-http-proxy/compare/v1.8.0...v1.8.1) - 2014-12-17 + +### Commits + +- Pass HTTPS client parameters. [`402ab05`](https://github.com/http-party/node-http-proxy/commit/402ab057340a29db7a521ff239c5e21ac0c12be8) +- [dist] Version bump. 1.8.1 [`3311106`](https://github.com/http-party/node-http-proxy/commit/3311106c2c2346f3ac1ffe402b80bca3c7c59275) + +## [v1.8.0](https://github.com/http-party/node-http-proxy/compare/v1.7.3...v1.8.0) - 2014-12-17 + +### Merged + +- Fix variables scope in test [`#752`](https://github.com/http-party/node-http-proxy/pull/752) +- Fix typo [`#751`](https://github.com/http-party/node-http-proxy/pull/751) + +### Commits + +- Added websocket close event test [`8bff3dd`](https://github.com/http-party/node-http-proxy/commit/8bff3ddc1276e3ba18fd68c34d8982148cd21455) +- Deprecated proxySocket event in favor to open event. [`c62610e`](https://github.com/http-party/node-http-proxy/commit/c62610e8e4d59e8ba4642370ff3fb933c6ddb4eb) +- Update README.md [`05d18a4`](https://github.com/http-party/node-http-proxy/commit/05d18a4e1ba6c2de41b0b803cd1793357979384d) +- [fix] style spacing wtf [`ea0a4de`](https://github.com/http-party/node-http-proxy/commit/ea0a4ded803b30144e442344ad5a38a0d34bb3ba) +- [api] add close event in ws-incoming.js [`2653786`](https://github.com/http-party/node-http-proxy/commit/26537866b3ca522927aa4604a958f90774c0c0c0) +- [minor] grammar [`f304861`](https://github.com/http-party/node-http-proxy/commit/f30486195cfa6cfcf6400ac445975d5adada72e4) +- Changed proxyServer and destiny to local variables. [`8a8a894`](https://github.com/http-party/node-http-proxy/commit/8a8a894092ddbec8f0365ced0e94a75b1307ecf1) +- [dist] Version bump. 1.8.0 [`f0db5b3`](https://github.com/http-party/node-http-proxy/commit/f0db5b3f708b0858f617d472dfdd0ba211b774ef) + +## [v1.7.3](https://github.com/http-party/node-http-proxy/compare/v1.7.2...v1.7.3) - 2014-12-09 + +### Fixed + +- [fix] use simple regex instead of indexOf to check the protocol to support without the colon fixes #711 [`#711`](https://github.com/http-party/node-http-proxy/issues/711) + +### Commits + +- [test] show that we support protocol without the colon [`89f9ca1`](https://github.com/http-party/node-http-proxy/commit/89f9ca1e89d679b2b85a8f85b65e8b0878694207) +- [dist] Version bump. 1.7.3 [`6a330ff`](https://github.com/http-party/node-http-proxy/commit/6a330ff904d02a41f9a1cac338a98da1849c54ca) + +## [v1.7.2](https://github.com/http-party/node-http-proxy/compare/v1.7.1...v1.7.2) - 2014-12-08 + +### Merged + +- Fix grammar in README.md [`#749`](https://github.com/http-party/node-http-proxy/pull/749) + +### Fixed + +- [fix] properly include port in host header with changeOrigin in all cases fixes #750 [`#750`](https://github.com/http-party/node-http-proxy/issues/750) + +### Commits + +- [test] add tests for the changeOrigin cases in properly setting the host header [`71a06aa`](https://github.com/http-party/node-http-proxy/commit/71a06aab0249487ff650c8a47906cc8281561664) +- [dist] pin down deps and add requires-port [`81874f7`](https://github.com/http-party/node-http-proxy/commit/81874f795b7df7929e03d9d4cb98a947b1ef114b) +- [dist] Version bump. 1.7.2 [`2086e49`](https://github.com/http-party/node-http-proxy/commit/2086e4917c97f347f84c54b166799bc8db9f4162) + +## [v1.7.1](https://github.com/http-party/node-http-proxy/compare/v1.7.0...v1.7.1) - 2014-12-02 + +### Merged + +- Adding harmon to the README [`#716`](https://github.com/http-party/node-http-proxy/pull/716) + +### Fixed + +- [fix] fix #738 [`#738`](https://github.com/http-party/node-http-proxy/issues/738) +- [fix] simple fixes #748 #744 #746 [`#748`](https://github.com/http-party/node-http-proxy/issues/748) + +### Commits + +- [test] add proper failing test case for #738 [`410a8ce`](https://github.com/http-party/node-http-proxy/commit/410a8ce94ccea566a8e50daf3b78e633b82875cb) +- [Bugfix] Allow for multiple ? in outgoing urls. [`70ed1c4`](https://github.com/http-party/node-http-proxy/commit/70ed1c4273bc64500e8bae9b60d7fd6a19135246) +- [dist] Version bump. 1.7.1 [`56a7b77`](https://github.com/http-party/node-http-proxy/commit/56a7b77645b13d337c1a2f879460193d310454c8) + +## [v1.7.0](https://github.com/http-party/node-http-proxy/compare/v1.6.2...v1.7.0) - 2014-11-25 + +### Merged + +- Allow optional redirect host rewriting. [`#741`](https://github.com/http-party/node-http-proxy/pull/741) +- Set `Content-Length` header for OPTIONS requests [`#742`](https://github.com/http-party/node-http-proxy/pull/742) +- copy headers instead of referencing them so they don't unexpectedly get overwritten [`#736`](https://github.com/http-party/node-http-proxy/pull/736) +- Updated to support error callback on proxy.web and start/proxyReq/end co... [`#735`](https://github.com/http-party/node-http-proxy/pull/735) + +### Commits + +- :pencil: Add host rewrite docs and specs. [`add8133`](https://github.com/http-party/node-http-proxy/commit/add81338a90dae132f9e74fd5a5905fbcef030b7) +- [minor] style consistency [`48ae5d8`](https://github.com/http-party/node-http-proxy/commit/48ae5d828c23d6f19c9e2dd8c922d88a09f5ed0f) +- Updated to support error callback on proxy.web and start/proxyReq/end continue working. [`9ba8311`](https://github.com/http-party/node-http-proxy/commit/9ba8311343fd01b32505b8607ecf4294200f9dde) +- style changes [`84036e9`](https://github.com/http-party/node-http-proxy/commit/84036e9ddd1d4d925006c5438b3bcc0f17ba7a48) +- [fix] be defensive and ensure location is in headers before running url.parse() [`8d68ac0`](https://github.com/http-party/node-http-proxy/commit/8d68ac0e0fa3080b31580aa08e92a46cc1f27696) +- [dist] Version bump. 1.7.0 [`276f65a`](https://github.com/http-party/node-http-proxy/commit/276f65a3b810ded01757ec4bfd4fe2b00a1e66a8) + +## [v1.6.2](https://github.com/http-party/node-http-proxy/compare/v1.6.1...v1.6.2) - 2014-11-11 + +### Merged + +- do not modify the query string [`#733`](https://github.com/http-party/node-http-proxy/pull/733) + +### Commits + +- [fix] style changes [`7c5e40a`](https://github.com/http-party/node-http-proxy/commit/7c5e40a429fbc0c538f38d29d74acb633cb9b8d4) +- [minor] this shouldnt be in var block [`3f19e6e`](https://github.com/http-party/node-http-proxy/commit/3f19e6e178e168a16beee74186691f3e0e54d517) +- [dist] Version bump. 1.6.2 [`709b3e9`](https://github.com/http-party/node-http-proxy/commit/709b3e96560d619fab2617f9ddb902b4982b4103) + +## [v1.6.1](https://github.com/http-party/node-http-proxy/compare/v1.6.0...v1.6.1) - 2014-11-04 + +### Merged + +- websocket needs to respect `options.secure` too [`#729`](https://github.com/http-party/node-http-proxy/pull/729) +- changeOrigin option docs fix [`#724`](https://github.com/http-party/node-http-proxy/pull/724) + +### Commits + +- [dist] Version bump. 1.6.1 [`fa797fc`](https://github.com/http-party/node-http-proxy/commit/fa797fca900c10ebc848a2b445204b47da799483) + +## [v1.6.0](https://github.com/http-party/node-http-proxy/compare/v1.5.3...v1.6.0) - 2014-10-29 + +### Merged + +- Added changeOrigin option with test and docs [`#723`](https://github.com/http-party/node-http-proxy/pull/723) +- I presume you mean couchdb here [`#717`](https://github.com/http-party/node-http-proxy/pull/717) +- update modify request body eg [`#712`](https://github.com/http-party/node-http-proxy/pull/712) + +### Commits + +- harmon notes [`9f684d0`](https://github.com/http-party/node-http-proxy/commit/9f684d0439174d889d7b9a4ef6e2353e09481b2d) +- [dist] Version bump. 1.6.0 [`43641b0`](https://github.com/http-party/node-http-proxy/commit/43641b00b34ccc05bdf09f904695061d7c857aeb) + +## [v1.5.3](https://github.com/http-party/node-http-proxy/compare/v1.5.2...v1.5.3) - 2014-10-01 + +### Merged + +- close socket if upstream request fails [`#709`](https://github.com/http-party/node-http-proxy/pull/709) + +### Commits + +- [dist] Version bump. 1.5.3 [`9577a0f`](https://github.com/http-party/node-http-proxy/commit/9577a0faf2b78af606168673407ac47a851c084c) + +## [v1.5.2](https://github.com/http-party/node-http-proxy/compare/v1.5.1...v1.5.2) - 2014-10-01 + +### Merged + +- close websocket if proxyReq is closed before upgrade [`#708`](https://github.com/http-party/node-http-proxy/pull/708) + +### Commits + +- test closing upstream socket prior to upgrade [`7730548`](https://github.com/http-party/node-http-proxy/commit/77305489d9b88d283802477e155340e5dacfcc2c) +- [dist] Version bump. 1.5.2 [`43c6f0c`](https://github.com/http-party/node-http-proxy/commit/43c6f0c7c06d25a670c410500a8623531df458b1) + +## [v1.5.1](https://github.com/http-party/node-http-proxy/compare/v1.5.0...v1.5.1) - 2014-09-30 + +### Commits + +- [fix] do a check to make sure the server exists before we try and emit [`10a294a`](https://github.com/http-party/node-http-proxy/commit/10a294af4d4baac30b98ea9bec683a974443b83d) +- [dist] Version bump. 1.5.1 [`f0bf741`](https://github.com/http-party/node-http-proxy/commit/f0bf7418156db2cb87a616b0a34bb1f028db9142) + +## [v1.5.0](https://github.com/http-party/node-http-proxy/compare/v1.4.3...v1.5.0) - 2014-09-30 + +### Merged + +- exposing proxySocket on socket to support sniffing messages coming from proxy target [`#706`](https://github.com/http-party/node-http-proxy/pull/706) +- Fixed misleading documentation [`#705`](https://github.com/http-party/node-http-proxy/pull/705) +- Fix typo in README.md [`#702`](https://github.com/http-party/node-http-proxy/pull/702) +- handle 'upgrade' in comma-separated connection header [`#691`](https://github.com/http-party/node-http-proxy/pull/691) + +### Commits + +- test new detection of connection: upgrade [`ec683b9`](https://github.com/http-party/node-http-proxy/commit/ec683b924b1ef8cbdd2cd2bfb7e141b502773163) +- emitting proxySocket on proxyServer [`000eb53`](https://github.com/http-party/node-http-proxy/commit/000eb533de144cad01cfd97edf9ab6c350593d3c) +- [fix] perf optimization so we have a precompiled regexp [`c0a796b`](https://github.com/http-party/node-http-proxy/commit/c0a796b3e31de4f22eef00d93164e7238d9aa3ba) +- use regex to check for upgrade header [`65a21bc`](https://github.com/http-party/node-http-proxy/commit/65a21bce6dbbc6142a851dc959e237c0ef2b1091) +- [dist] Version bump. 1.5.0 [`232258b`](https://github.com/http-party/node-http-proxy/commit/232258b6ec2229497fe557454a121d917968f5e8) +- [minor] extra space [`e7d50b1`](https://github.com/http-party/node-http-proxy/commit/e7d50b1a376035a50c82db38605e99feb30afd36) + +## [v1.4.3](https://github.com/http-party/node-http-proxy/compare/v1.4.2...v1.4.3) - 2014-09-12 + +### Merged + +- Urgent: Fix breaking bug on url joining resulting in paths like `///path`. [`#699`](https://github.com/http-party/node-http-proxy/pull/699) + +### Commits + +- [minor] Added missing JSDoc comments [`73e8a4c`](https://github.com/http-party/node-http-proxy/commit/73e8a4cdd576868bf61d0848cc51f083a75454f9) +- Fix breaking bug on url joining resulting in paths like `///path`. [`73d865b`](https://github.com/http-party/node-http-proxy/commit/73d865bc9f8940f61c1ad4812f220920ead553b5) +- [minor] Code style adjustment. [`3ab6e95`](https://github.com/http-party/node-http-proxy/commit/3ab6e9591e66c203647605b4f275d374472c9d5f) +- Bump version v1.4.3 [`554f59c`](https://github.com/http-party/node-http-proxy/commit/554f59c5182d58b359df0159a29ff5ea35dd3830) +- [ignore] Ignore npm-debug.log [`a934cb6`](https://github.com/http-party/node-http-proxy/commit/a934cb6a46298c380e9bc794f18873576cf73c4c) + +## [v1.4.2](https://github.com/http-party/node-http-proxy/compare/v1.4.1...v1.4.2) - 2014-09-12 + +### Commits + +- [fix] ensure path works on windows because path.join doesnt like URLs [`ed73f06`](https://github.com/http-party/node-http-proxy/commit/ed73f06ed307ad2204e565781cc3154047941a8c) +- [dist] Version bump. 1.4.2 [`df12aeb`](https://github.com/http-party/node-http-proxy/commit/df12aeb12de79de1157898d45f4347fd0037dd70) + +## [v1.4.1](https://github.com/http-party/node-http-proxy/compare/v1.3.1...v1.4.1) - 2014-09-11 + +### Merged + +- Trimming contents of distributed npm package. [`#644`](https://github.com/http-party/node-http-proxy/pull/644) +- Remove changelog - it was not maintained [`#669`](https://github.com/http-party/node-http-proxy/pull/669) +- Removed duplicated imported dependencies [`#695`](https://github.com/http-party/node-http-proxy/pull/695) + +### Commits + +- [test] add test for prependPath option [`e44fabe`](https://github.com/http-party/node-http-proxy/commit/e44fabe58a233b367d42f26f15113e2022f71d7b) +- [api] add prependPath option to go with path change [`9a534c6`](https://github.com/http-party/node-http-proxy/commit/9a534c6ff63d776140918bc839801d247affd18d) +- [dist] Version bump. 1.4.1 [`d5c656b`](https://github.com/http-party/node-http-proxy/commit/d5c656bceb50dc9008ef223bc58b918adcf05352) +- [dist] Version bump. 1.4.0 [`dceef40`](https://github.com/http-party/node-http-proxy/commit/dceef407a1130033679e7e836c6753b76187ce5f) + +## [v1.3.1](https://github.com/http-party/node-http-proxy/compare/v1.3.0...v1.3.1) - 2014-09-09 + +### Merged + +- Allow proxy to maintain the original target path [`#693`](https://github.com/http-party/node-http-proxy/pull/693) +- Clarify usable parameters for 'proxyRes' event [`#686`](https://github.com/http-party/node-http-proxy/pull/686) + +### Commits + +- fix tests for maintaining proxy path [`a65021d`](https://github.com/http-party/node-http-proxy/commit/a65021d52b0ee039486819b5a95f442229458776) +- Fix proxy path [`511b7b3`](https://github.com/http-party/node-http-proxy/commit/511b7b3d4743636de9d9fbe8ff409730d221d273) +- Clarify usable parameters for proxyRes event. [`49a0de1`](https://github.com/http-party/node-http-proxy/commit/49a0de1e7cdcec9b555695605ab914038f99d66b) +- [dist] Version bump. 1.3.1 [`fc73828`](https://github.com/http-party/node-http-proxy/commit/fc73828035baf3cea3664560f8964f2a2a200d0a) +- [ci] remove 0.11.x to avoid failing builds caused by TLS errors [`6b83ae4`](https://github.com/http-party/node-http-proxy/commit/6b83ae47bbf2d5eab8ac94b4d6130e09a21ac85b) + +## [v1.3.0](https://github.com/http-party/node-http-proxy/compare/v1.2.1...v1.3.0) - 2014-08-14 + +### Merged + +- Added functionality to close proxy. [`#679`](https://github.com/http-party/node-http-proxy/pull/679) + +### Commits + +- [fix] cleanup and stylize close function [`261742a`](https://github.com/http-party/node-http-proxy/commit/261742a4295268ef93f45aa0f1e3a04208a2aed3) +- updated close function for safety [`8be9d94`](https://github.com/http-party/node-http-proxy/commit/8be9d945d03169056bbf84d702292b5763b015dc) +- [dist] Version bump. 1.3.0 [`05f0b89`](https://github.com/http-party/node-http-proxy/commit/05f0b891a610fb7779f90916fcd9ed750df818b2) + +## [v1.2.1](https://github.com/http-party/node-http-proxy/compare/v1.2.0...v1.2.1) - 2014-08-14 + +### Commits + +- Added close method to proxy server. [`a3d0219`](https://github.com/http-party/node-http-proxy/commit/a3d02196c5e62cd58bc0ebe8a66afcdb905d96b3) +- [fix] emit an error if proper URL is not passed in as a target [`37036dd`](https://github.com/http-party/node-http-proxy/commit/37036dd32565f72ad5777e47509293db18b60ed3) +- [dist] Version bump. 1.2.1 [`0a6b424`](https://github.com/http-party/node-http-proxy/commit/0a6b424e2c3b6cef68362a71f0e56740b2605af7) + +## [v1.2.0](https://github.com/http-party/node-http-proxy/compare/v1.1.6...v1.2.0) - 2014-08-05 + +### Merged + +- [api] Add event-based ability to modify pre-flight proxy requests. [`#673`](https://github.com/http-party/node-http-proxy/pull/673) + +### Commits + +- [dist] Version bump. 1.2.0 [`63c53a1`](https://github.com/http-party/node-http-proxy/commit/63c53a177217283ec14e4f7c2e891db48842ab4b) + +## [v1.1.6](https://github.com/http-party/node-http-proxy/compare/v1.1.5...v1.1.6) - 2014-07-17 + +### Fixed + +- do proper checking for a pass not existing. fixes #671 [`#671`](https://github.com/http-party/node-http-proxy/issues/671) + +### Commits + +- Remove changelog - it was not maintained [`e336b52`](https://github.com/http-party/node-http-proxy/commit/e336b52629276e647abeee300d7091db44e5b885) +- [dist] Version bump. 1.1.6 [`ed9e12b`](https://github.com/http-party/node-http-proxy/commit/ed9e12b0edb0fc206610e94bd696425619868474) + +## [v1.1.5](https://github.com/http-party/node-http-proxy/compare/v1.1.4...v1.1.5) - 2014-07-10 + +### Merged + +- Fix simple-balancer example [`#666`](https://github.com/http-party/node-http-proxy/pull/666) +- Added proxyTimeout option and two tests for timeout [`#658`](https://github.com/http-party/node-http-proxy/pull/658) + +### Fixed + +- Fix #657 [`#657`](https://github.com/http-party/node-http-proxy/issues/657) +- Fix #657 [`#657`](https://github.com/http-party/node-http-proxy/issues/657) + +### Commits + +- Added targetTimeout option and two tests for timeout [`0f24351`](https://github.com/http-party/node-http-proxy/commit/0f243516e1c6737b95fba220a5028439264b5de6) +- Change name targetTimeout to proxyTimeout [`7b79a74`](https://github.com/http-party/node-http-proxy/commit/7b79a7409ade7a8c79b2ae5761abc4843529063a) +- Trimming contents of distributed npm package. [`431aba7`](https://github.com/http-party/node-http-proxy/commit/431aba79d8d521e228c1403aaf4fd4a26fba03c3) +- [api] also emit the target on a proxy error [`d1baa36`](https://github.com/http-party/node-http-proxy/commit/d1baa3684e449610a2aae270816a7b8a907e588e) +- [dist] Version bump. 1.1.5 [`7104a7c`](https://github.com/http-party/node-http-proxy/commit/7104a7c023073a49091969f825738c79ae036123) +- fix balancer example [`9df4bc1`](https://github.com/http-party/node-http-proxy/commit/9df4bc1e1216a8e53675f0be16fb9081c11da225) + +## [v1.1.4](https://github.com/http-party/node-http-proxy/compare/v1.1.3...v1.1.4) - 2014-05-11 + +### Merged + +- `proxyRes` event, provide access to the req and res objects [`#642`](https://github.com/http-party/node-http-proxy/pull/642) + +### Commits + +- Add a test for the proxyRes event [`1385635`](https://github.com/http-party/node-http-proxy/commit/1385635e18f081af759c8e088f2f6b0219df83db) +- [dist] Version bump. 1.1.4 [`7cb98a4`](https://github.com/http-party/node-http-proxy/commit/7cb98a4e417312f01cf4432b52dbb3773aca60a0) +- Add the req and res objects to the proxyRes event [`1213e46`](https://github.com/http-party/node-http-proxy/commit/1213e46b1b0975ad1d5c5d0aaeace40a0811118f) + +## [v1.1.3](https://github.com/http-party/node-http-proxy/compare/v1.1.2...v1.1.3) - 2014-05-11 + +### Merged + +- Don't override connection header if Upgrading [`#640`](https://github.com/http-party/node-http-proxy/pull/640) + +### Commits + +- Adding test cases on preventing upgrade override [`8aa7c51`](https://github.com/http-party/node-http-proxy/commit/8aa7c519b15f734af7db34d2102781adbeae10aa) +- Update README.md for benchmarks [`4947484`](https://github.com/http-party/node-http-proxy/commit/4947484806f839d5e0a1b615b56a1bc847b8f534) +- [minor] style [`ccad177`](https://github.com/http-party/node-http-proxy/commit/ccad17795417de74bea2bcb6d6c559a4601af76d) +- [dist] Version bump. 1.1.3 [`c472527`](https://github.com/http-party/node-http-proxy/commit/c472527ea60da8b2f737d5742bc61ad2772b7e0b) + +## [v1.1.2](https://github.com/http-party/node-http-proxy/compare/v1.1.1...v1.1.2) - 2014-04-14 + +### Commits + +- [fix test] handle proxy error since we are properly aborting the proxy Request [`61c8734`](https://github.com/http-party/node-http-proxy/commit/61c8734e8b1115fab0e0db23fd8eeccbae61eee0) +- [fix] handle error on incoming request as well and properly abort proxy if client request is aborted [`77a1cff`](https://github.com/http-party/node-http-proxy/commit/77a1cff9bcf697eab27819eef054024bdc0a2ba3) +- [dist] Version bump. 1.1.2 [`c54278b`](https://github.com/http-party/node-http-proxy/commit/c54278bd3b00e82f4253393b6f6beb1d5a1b19e5) + +## [v1.1.1](https://github.com/http-party/node-http-proxy/compare/v1.1.0...v1.1.1) - 2014-04-11 + +### Commits + +- [dist] Version bump. 1.1.1 [`d908e2a`](https://github.com/http-party/node-http-proxy/commit/d908e2ad61013ed1f6e2f80c4b67a6dce7d0f504) +- [fix] let user make the decision on what to do with the buffer [`4f07dc2`](https://github.com/http-party/node-http-proxy/commit/4f07dc220d700ac90bd8405f7cb0724bdae4b430) + +## [v1.1.0](https://github.com/http-party/node-http-proxy/compare/v1.0.3...v1.1.0) - 2014-04-09 + +### Merged + +- Update UPGRADING.md [`#616`](https://github.com/http-party/node-http-proxy/pull/616) + +### Fixed + +- [fix] always be an eventemitter for consistency fixes #606 [`#606`](https://github.com/http-party/node-http-proxy/issues/606) + +### Commits + +- [api] emit a start an an end event [`8b48a9f`](https://github.com/http-party/node-http-proxy/commit/8b48a9fdab01624f7249c53f25919b1295eefb10) +- [dist] Version bump. 1.1.0 [`97ceeb3`](https://github.com/http-party/node-http-proxy/commit/97ceeb37d04e5d2195352365985165866323c4d7) +- [minor] missing angle bracket [`eca765a`](https://github.com/http-party/node-http-proxy/commit/eca765a856164c077ff9128949019552cdaf9a67) + +## [v1.0.3](https://github.com/http-party/node-http-proxy/compare/v1.0.2...v1.0.3) - 2014-03-27 + +### Merged + +- Fix for #591 [`#592`](https://github.com/http-party/node-http-proxy/pull/592) +- Add Repository field to package.json [`#578`](https://github.com/http-party/node-http-proxy/pull/578) +- Fix doc: option lines [`#575`](https://github.com/http-party/node-http-proxy/pull/575) + +### Fixed + +- [api] add toProxy method to allow absolute URLs to be sent when sending to another proxy fixes #603 [`#603`](https://github.com/http-party/node-http-proxy/issues/603) + +### Commits + +- [doc] update docs with toProxy option [`ece85b4`](https://github.com/http-party/node-http-proxy/commit/ece85b4e1ba379b3ed084bd8f606e285c14d4db3) +- [fix] set connection to CLOSE in cases where the agent is false. [`89a22bc`](https://github.com/http-party/node-http-proxy/commit/89a22bc00396f069eeb054ce30891a204077d16d) +- @xtreme-topher-bullock - update package.json to have proper repository key and formatting [`68fa17b`](https://github.com/http-party/node-http-proxy/commit/68fa17bbcaa73ae2d9539cba6f6ddff29f9e30d5) +- [dist] Version bump. 1.0.3 [`07fceb7`](https://github.com/http-party/node-http-proxy/commit/07fceb7c7aed25a8991d0295db4b4a7e50d79cf9) +- Add support for localAddress [`e633b0f`](https://github.com/http-party/node-http-proxy/commit/e633b0f7e4fd719d809eaeb4725e589f79c271ab) + +## [v1.0.2](https://github.com/http-party/node-http-proxy/compare/v1.0.1...v1.0.2) - 2014-01-28 + +### Merged + +- Update README.md [`#566`](https://github.com/http-party/node-http-proxy/pull/566) +- Fix argument order for ws stream pass [`#560`](https://github.com/http-party/node-http-proxy/pull/560) +- Extend listen to enable IPv6 support. [`#558`](https://github.com/http-party/node-http-proxy/pull/558) +- Fix before and after type check [`#556`](https://github.com/http-party/node-http-proxy/pull/556) + +### Fixed + +- Close outgoing ws if incoming ws emits error [`#559`](https://github.com/http-party/node-http-proxy/issues/559) +- [fix] closes #555 [`#555`](https://github.com/http-party/node-http-proxy/issues/555) + +### Commits + +- [fix] replicate node core behavior and throw an error if the user does not add their own error listener [`daad470`](https://github.com/http-party/node-http-proxy/commit/daad4703f3a80014936c89f4d67affdc3246f478) +- [dist] Version bump. 1.0.2 [`4bdc3e4`](https://github.com/http-party/node-http-proxy/commit/4bdc3e4f455b2749c03961404db74e3112a3e9e8) +- [doc] Fix broken image in npm by using an absolute link [`8004f4e`](https://github.com/http-party/node-http-proxy/commit/8004f4e5fc0f535806e92ec4e1bd973a45367dac) + +## [v1.0.1](https://github.com/http-party/node-http-proxy/compare/v1.0.0...v1.0.1) - 2014-01-17 + +### Fixed + +- [fix] closes #553 [`#553`](https://github.com/http-party/node-http-proxy/issues/553) + +### Commits + +- [dist] bump v1.0.1 [`68c5512`](https://github.com/http-party/node-http-proxy/commit/68c55123039369cdf8a55a64b36b719c96b672cf) +- typo [`689459f`](https://github.com/http-party/node-http-proxy/commit/689459fe46885a1b3b8e32a4df55f2d1339143e5) + +## [v1.0.0](https://github.com/http-party/node-http-proxy/compare/v0.10.4...v1.0.0) - 2014-01-16 + +### Merged + +- Http proxy 1.0 [`#552`](https://github.com/http-party/node-http-proxy/pull/552) +- Caronte [`#551`](https://github.com/http-party/node-http-proxy/pull/551) +- Only emit response if a valid server is present [`#549`](https://github.com/http-party/node-http-proxy/pull/549) +- [fix] add `type` to before and after to grab correct `passes`, fixes #537 [`#539`](https://github.com/http-party/node-http-proxy/pull/539) +- export the proxy itself from the main require [`#536`](https://github.com/http-party/node-http-proxy/pull/536) + +### Fixed + +- [fix] closes #547 [`#547`](https://github.com/http-party/node-http-proxy/issues/547) +- Merge pull request #539 from nodejitsu/fix-before-after [`#537`](https://github.com/http-party/node-http-proxy/issues/537) +- [fix] add `type` to before and after to grab correct `passes`, fixes #537 [`#537`](https://github.com/http-party/node-http-proxy/issues/537) + +### Commits + +- [nuke] old files [`a4ee8f9`](https://github.com/http-party/node-http-proxy/commit/a4ee8f9d82f71ef423c401b1f5e9f712b13cbc98) +- [docs] upgrade UPGRADING.md [`e599151`](https://github.com/http-party/node-http-proxy/commit/e5991519dbc7838aa4b8aeb5077d1c1ec5a13813) +- [api] export the httpProxy.Server as the main export but preserve the createServer factory [`182c76c`](https://github.com/http-party/node-http-proxy/commit/182c76cd2322d4d4c041c2a964d51db396c5c96b) +- [fix] remove caronte [`d6d2d0c`](https://github.com/http-party/node-http-proxy/commit/d6d2d0c8821bba9888eee7c3881fc408b3b2008e) +- [fix] ee3 error handling [`d23353d`](https://github.com/http-party/node-http-proxy/commit/d23353d980d8aa1b2606e3d36a83d27432952bef) +- [fix] comments [`6fa23e1`](https://github.com/http-party/node-http-proxy/commit/6fa23e11f6dc0b9c09766b268611ade919bfaa08) + +## [v0.10.4](https://github.com/http-party/node-http-proxy/compare/v0.10.3...v0.10.4) - 2013-12-27 + +### Merged + +- Update README.md [`#521`](https://github.com/http-party/node-http-proxy/pull/521) +- Better examples [`#520`](https://github.com/http-party/node-http-proxy/pull/520) +- Send path in req.path and not the url [`#416`](https://github.com/http-party/node-http-proxy/pull/416) +- Fix websocket error handing [`#518`](https://github.com/http-party/node-http-proxy/pull/518) +- attempting to fix links to 2 source locations in README.md [`#502`](https://github.com/http-party/node-http-proxy/pull/502) +- [merge] rename codename to actual project name [`#492`](https://github.com/http-party/node-http-proxy/pull/492) +- [merge] Added error handling example [`#484`](https://github.com/http-party/node-http-proxy/pull/484) +- [merge] https & agent [`#482`](https://github.com/http-party/node-http-proxy/pull/482) +- [merge] caronte tests [`#476`](https://github.com/http-party/node-http-proxy/pull/476) +- FIX: ws error event [`#475`](https://github.com/http-party/node-http-proxy/pull/475) +- Fix accidental write to global variable. [`#472`](https://github.com/http-party/node-http-proxy/pull/472) +- [fix] 2 spelling mistakes [`#14`](https://github.com/http-party/node-http-proxy/pull/14) +- [fix] add ability to proxy websockets over HTTPS [`#11`](https://github.com/http-party/node-http-proxy/pull/11) +- Tests [`#3`](https://github.com/http-party/node-http-proxy/pull/3) + +### Fixed + +- determine x-forwarded-port from host header [`#341`](https://github.com/http-party/node-http-proxy/issues/341) +- [fix] closes #529 [`#529`](https://github.com/http-party/node-http-proxy/issues/529) +- [fix] fixes #341 [`#341`](https://github.com/http-party/node-http-proxy/issues/341) +- [tests] https test pass, fix #511. Exposed the rejectUnauthorized flag [`#511`](https://github.com/http-party/node-http-proxy/issues/511) +- [fix] pass proper options object that extend the global options and parse the per proxy args into options. fixes #510 [`#510`](https://github.com/http-party/node-http-proxy/issues/510) +- [readme] add links to badges on readme, fix #483 [`#483`](https://github.com/http-party/node-http-proxy/issues/483) +- [fix] pooled connections, closes #478 [`#478`](https://github.com/http-party/node-http-proxy/issues/478) +- [fix] add 0.10 link, fixes #459 [`#459`](https://github.com/http-party/node-http-proxy/issues/459) +- [fix] closes #473 [`#473`](https://github.com/http-party/node-http-proxy/issues/473) +- [fix] add 0.10 compatibily.. closes #474 [`#474`](https://github.com/http-party/node-http-proxy/issues/474) +- [fix] headers, closes #469 [`#469`](https://github.com/http-party/node-http-proxy/issues/469) +- [fix] headers, fixes #467 [`#467`](https://github.com/http-party/node-http-proxy/issues/467) +- [fix] yawnt baaaka .. fixes #8 [`#8`](https://github.com/http-party/node-http-proxy/issues/8) + +### Commits + +- [fix] more jshint intendation [`17399e7`](https://github.com/http-party/node-http-proxy/commit/17399e7c3ef9addf9dd8f7c628b273e693f128a1) +- [fix] tests [`a255f98`](https://github.com/http-party/node-http-proxy/commit/a255f984fecf24c9290f3ad58d1b68e54a7509eb) +- [minor] remove coverage [`335af81`](https://github.com/http-party/node-http-proxy/commit/335af81d0244e62ecb501690bd15bc5a04ec51a3) +- [examples] updated websockets examples [`ed8c9ee`](https://github.com/http-party/node-http-proxy/commit/ed8c9eeba99d60f39f5c36c4f34ed1a781d2cfd8) +- [tests] removed unused tests [`7e25bde`](https://github.com/http-party/node-http-proxy/commit/7e25bded27effc1b3d47121ce21465a4e2ec7c0b) +- [tests] Added a test case for run all the examples [`bc236d7`](https://github.com/http-party/node-http-proxy/commit/bc236d7e95ef10bc17cf551eea2cd2fb9bf265eb) +- [tests] drop the test of own streams, moved the usable tests [`dc9d7e5`](https://github.com/http-party/node-http-proxy/commit/dc9d7e5452c7d39ae1d242cb8021ca75e4f736d4) +- [fix] default port [`d166354`](https://github.com/http-party/node-http-proxy/commit/d1663549ec070e7ae8bc45ffb148f40ee903192f) +- [tests] added the ws passes test and the streams webscokets test [`8b3fe32`](https://github.com/http-party/node-http-proxy/commit/8b3fe32f6ae60ae067bc5e40cdc43015e689467f) +- [refactor minor] s/caronte/http-proxy/ or s/caronte/httpProxy/ where appropriate. [`bb0d28c`](https://github.com/http-party/node-http-proxy/commit/bb0d28c58729e2cc70e8446f7fbf1113a6fa9310) +- [examples] updated bodyDecoder middleware example [`c82ff2c`](https://github.com/http-party/node-http-proxy/commit/c82ff2c3c0c0165421fbc4e7e94fa3f59d59aa38) +- [dist] first [`4d13156`](https://github.com/http-party/node-http-proxy/commit/4d131567211bcefc6ef0b0592d374fef7bd5abd8) +- [examples] update forward and custom error examples [`b726116`](https://github.com/http-party/node-http-proxy/commit/b7261161343c3471201d6de36ba1030aced26425) +- [refactor docs] add descriptions [`d05af4a`](https://github.com/http-party/node-http-proxy/commit/d05af4af60a5f3d308aa68bf09ab0cf9e5528c52) +- [tests] make the tests run with the last refactor [`5bb83b9`](https://github.com/http-party/node-http-proxy/commit/5bb83b967edb514402698eecfe3db7ab5fe60b06) +- [examples] deleted this examples [`bdeabb7`](https://github.com/http-party/node-http-proxy/commit/bdeabb767a537bcb9f98ef74f6efe9762a9b1c34) +- websocket draft [`07551c6`](https://github.com/http-party/node-http-proxy/commit/07551c63e428551e5d6e52362efd9620a14c71b4) +- [fix] naming [`2a59366`](https://github.com/http-party/node-http-proxy/commit/2a593664a5768c90d9b2edf4c298460416b38926) +- [dist doc] Added documentation for consistent benchmarking of node-http-proxy [`f7f5fa7`](https://github.com/http-party/node-http-proxy/commit/f7f5fa727e8f1d3f4946e61ad03830dab1da01a5) +- [examples] update old examples [`7e44d36`](https://github.com/http-party/node-http-proxy/commit/7e44d3669bbd1b13e6452f265d52b22396f68b5d) +- [docs] more short examples to the Readme [`0393b5d`](https://github.com/http-party/node-http-proxy/commit/0393b5da990bb45e873bb80d87a0bc9e4dd6a477) +- [examples] updated old proxy examples [`e02317c`](https://github.com/http-party/node-http-proxy/commit/e02317ce86ff2dabd496cf7e2741e219a22ac817) +- [wip] Initial HTTPS->HTTP test, updated https-secure example. Work in progress, need to add more https tests [`33a2462`](https://github.com/http-party/node-http-proxy/commit/33a2462d28c7d1fa26b03bcf290242ff7cd83e7a) +- [docs] readme [`886a870`](https://github.com/http-party/node-http-proxy/commit/886a8707078f59d0467b34686455bb5bdfadbc0c) +- [examples] added error-handling using callbacks and HTTP-to-HTTPS examples [`d7064f2`](https://github.com/http-party/node-http-proxy/commit/d7064f2e1e149fe870cbb158932cb99f9f192fce) +- [examples] updated old examples [`588327c`](https://github.com/http-party/node-http-proxy/commit/588327c2c4392618b515164989f08ef20a30842b) +- stuff [`e45bfd6`](https://github.com/http-party/node-http-proxy/commit/e45bfd66a21a2470c5a4a4cc1d6095494bbc0f6b) +- [doc] added some documentation to functions and comments to understand better the code [`5dcdf2b`](https://github.com/http-party/node-http-proxy/commit/5dcdf2b36c24a9584f044b7529265b9ac861d8c7) +- Fixed issue where error callback would not invoke, including new test cases. Added req/res values to error events. [`0bfb9be`](https://github.com/http-party/node-http-proxy/commit/0bfb9be418926f2113489e92504038127d4c04bb) +- [examples] updated balancer examples [`831a44b`](https://github.com/http-party/node-http-proxy/commit/831a44b3c8c3acf6c046c47703a07cd6362a0d1c) +- socket.io stuff [`a74cd85`](https://github.com/http-party/node-http-proxy/commit/a74cd85c8a5aae2851acf7139648fefd6a02a57b) +- [tests] move contributions of @mmoulton to correct place [`7c72f3b`](https://github.com/http-party/node-http-proxy/commit/7c72f3b407a084a896e420c23ababc3e9357feca) +- [tests] this file is not necessary anymore [`881c7e6`](https://github.com/http-party/node-http-proxy/commit/881c7e62e0bef7b4b9f81b6fd121f7ad6641bd77) +- [refactor] move to leaner architecture [`8273cb6`](https://github.com/http-party/node-http-proxy/commit/8273cb6461e4d33f36e583b0354d1bea038d0a56) +- [fix] remove trailing whitespaces [`0aeaba7`](https://github.com/http-party/node-http-proxy/commit/0aeaba7fe6c51f150d0322eb90a77c1701ed88f5) +- [test] added tests for web-outgoing.js [`16a4d9d`](https://github.com/http-party/node-http-proxy/commit/16a4d9da1136b79f40ad80482d3fd17dc74274b1) +- [fix] some stuff start debugging proxystream [`d4f0da8`](https://github.com/http-party/node-http-proxy/commit/d4f0da898e5e8a2d6740e50a7fc34576435e1132) +- [tests] now each test use a different port to avoid some slow opening and closing ports [`c75d06c`](https://github.com/http-party/node-http-proxy/commit/c75d06c5f92eb7c814deb49bb33cf9fffc632d97) +- [tests] fixed inherits problem and listen for the correct event [`c65ffbb`](https://github.com/http-party/node-http-proxy/commit/c65ffbb976467dc1768983dcffe111d18e8f2db1) +- [fix] ProxyStraem now works [`356f43d`](https://github.com/http-party/node-http-proxy/commit/356f43d719998d135e0fc404ac8508e330cf1e5b) +- [examples] fix the copyright header of example files [`e592c53`](https://github.com/http-party/node-http-proxy/commit/e592c53d1a23b7920d603a9e9ac294fc0e841f6d) +- [feature] start working on the new server [`b79bd29`](https://github.com/http-party/node-http-proxy/commit/b79bd29d5e984f34b9c07fbdc803aed83b3fd0bb) +- ENH: updated examples [`f566a42`](https://github.com/http-party/node-http-proxy/commit/f566a42e511f4a6a8f3620f64e05df209e61b64f) +- [examples] add example of gzip using the connect.compress() middleware [`2142c50`](https://github.com/http-party/node-http-proxy/commit/2142c506e08f56d52e1995da5506c3e032f19c3c) +- [fix] refactor error handling [`601dbcb`](https://github.com/http-party/node-http-proxy/commit/601dbcbfe929af31995568b4f36b877245809058) +- [tests] fixed according new refactor and added test to common.setupSocket() [`1cb967b`](https://github.com/http-party/node-http-proxy/commit/1cb967b90aaa5b9da57727b8acbd95108437797a) +- [feature] websocket support [`79a14ac`](https://github.com/http-party/node-http-proxy/commit/79a14acfd2b2bf03f5ae2b334e7a37e619da6bb9) +- keepalive sockets [`dad211e`](https://github.com/http-party/node-http-proxy/commit/dad211e71c9ac3b32eba1ea3755edb688053b9d3) +- [tests] Using target field, tests now pass. We are missing the tests using forward field [`8085178`](https://github.com/http-party/node-http-proxy/commit/8085178dc2c24567adfb872a583863709ce60b5b) +- [fix] callback as optional error handler [`c7924e0`](https://github.com/http-party/node-http-proxy/commit/c7924e01f92aeec07333273f0882c1dd5e9521ae) +- ENH: added new https example, needs to be simplified before merge [`427d8d8`](https://github.com/http-party/node-http-proxy/commit/427d8d85369b0cd1d38afa0dd0f28ac98fa16001) +- [test] proxystream test [`c961279`](https://github.com/http-party/node-http-proxy/commit/c9612798f1207a4c40b616608bf6274d79ad0e4d) +- [lib] initial draft to websockets passes [`79f7f99`](https://github.com/http-party/node-http-proxy/commit/79f7f99528661162ae4153856888f078f666e017) +- [fix] minor [`7599cee`](https://github.com/http-party/node-http-proxy/commit/7599cee3fd03a5ce645e313f35557a41c9ac1aee) +- [tests] added HTTPS to HTTPS test [`31d919b`](https://github.com/http-party/node-http-proxy/commit/31d919b0a3d0b7f574e88fc5eed093c6b1a53548) +- [feature] started working on error propagation, kinda sucks, gotta think it over [`9ab8749`](https://github.com/http-party/node-http-proxy/commit/9ab8749a9bec33b49c495975e8364336ad7be1a3) +- [test] testing the onResponse proxy method [`27df8d7`](https://github.com/http-party/node-http-proxy/commit/27df8d72ad86d02cfce00a6e5c183d93dd50f97e) +- [fix] remove duplicate [`10c0f11`](https://github.com/http-party/node-http-proxy/commit/10c0f11b68e39552051e508c7bf20d65d2d59177) +- [tests] add more tests [`cedc5c4`](https://github.com/http-party/node-http-proxy/commit/cedc5c4bd2059585e1222ec4f03f09e8bcc808fc) +- [docs] Update readme with more how to [`ae0faef`](https://github.com/http-party/node-http-proxy/commit/ae0faef5aa0080d742a9740f9cb38bfd54b7d97e) +- [tests] added test for socket.io proxying [`10a0db4`](https://github.com/http-party/node-http-proxy/commit/10a0db4f0dd4594839f9098b9d67130085a067bc) +- [tests] added test HTTPS to HTTP using own server [`bbe3bfd`](https://github.com/http-party/node-http-proxy/commit/bbe3bfdf98255b82a185a798ff9f29e74615b6ca) +- [examples] update the error-handling example using the new error handle way [`a1b25a1`](https://github.com/http-party/node-http-proxy/commit/a1b25a123b4ff71e731f9beb27c5e078acfead65) +- [fix] quote [`c4ddc4e`](https://github.com/http-party/node-http-proxy/commit/c4ddc4edd324d9910a11eea14561a0e3b953f29c) +- ENH: updated README and added examples file. [`07091b5`](https://github.com/http-party/node-http-proxy/commit/07091b5077a40dfee29f6fd33ecb38d3fa25b801) +- [test] passes/web.js (first 2 funcs) [`d40e4be`](https://github.com/http-party/node-http-proxy/commit/d40e4beb62381b962b6cf3254451de0a39f182b1) +- [test] add test for forwardstream [`8fc3389`](https://github.com/http-party/node-http-proxy/commit/8fc33893672d26013c2b2ff396b777bcf1751527) +- [tests] fixing tests, fixed some typos and changed how passes are stored [`a704213`](https://github.com/http-party/node-http-proxy/commit/a7042132c881656dd32f915d9b0b962f0ef92efb) +- [test] added the lib/caronte/streams/forward.js initial test, one test pending [`2fac7b9`](https://github.com/http-party/node-http-proxy/commit/2fac7b9b009b12a940efb22de3af6db55ee686a9) +- [api] add draft for proxystream [`4f24664`](https://github.com/http-party/node-http-proxy/commit/4f24664e8a50aa9b9a3ea155d067b85f94a8c81b) +- [experiment] new api for proxying [`07cfa6b`](https://github.com/http-party/node-http-proxy/commit/07cfa6b981ff54d8d96eea6c9aa4b560ee3867ec) +- [tests] the options got a problem and this test probe that timeout is not being set [`1d1ee88`](https://github.com/http-party/node-http-proxy/commit/1d1ee8858283d7c8984f1c1d6c5185b6822f9235) +- new error propagation [`3a39e44`](https://github.com/http-party/node-http-proxy/commit/3a39e444ff68a74f6b586f0736bbd3f8a2511ca5) +- [fix] docs [`ec981c5`](https://github.com/http-party/node-http-proxy/commit/ec981c5b74bf43dd36c8ca89833b751f59f01d38) +- [examples] added concurrent proxy example [`04c1011`](https://github.com/http-party/node-http-proxy/commit/04c10113f7a3b568fb95b18f30e4aca3e059d961) +- [fix] closes number #487 [`cde08fb`](https://github.com/http-party/node-http-proxy/commit/cde08fb2ee2df03c9457678d8e6776a5d89165b2) +- [test] started writing tests [`16eacfa`](https://github.com/http-party/node-http-proxy/commit/16eacfa961d2a2d80534e95eba83010ed6ab01b4) +- [tests] added tests for websockets [`02007ed`](https://github.com/http-party/node-http-proxy/commit/02007ed0fb38f798436ae5669bb18d4f27496667) +- Revert "[fix] fixed options and server reference to can access them from passes functions" [`babdf53`](https://github.com/http-party/node-http-proxy/commit/babdf531fecd32f9af0963902909fcfa2cd374f1) +- mm test file [`1a7bef0`](https://github.com/http-party/node-http-proxy/commit/1a7bef0cda58243416a263075dc6eb51f22b6dec) +- [fix] fixed options and server reference to can access them from passes functions [`90fb01d`](https://github.com/http-party/node-http-proxy/commit/90fb01d38ac5af7ef395547b24e985b6f63b4abc) +- [examples] added forward example [`7a3f6df`](https://github.com/http-party/node-http-proxy/commit/7a3f6dfbcc80ba32fa81004438c637e8d29eb029) +- [docs] add UPGRADING.md [`db12f6c`](https://github.com/http-party/node-http-proxy/commit/db12f6c24e22c034c698457cc28ff60c990b55a5) +- DOC: Added error handling example [`32a4088`](https://github.com/http-party/node-http-proxy/commit/32a40889cedfd6b0d92224aa921700a7b7271c68) +- [examples] updated the modifyResponse-middleware example [`de3ff11`](https://github.com/http-party/node-http-proxy/commit/de3ff11656b4a847de3a63b28feed39b6c816480) +- [test] test onError part, proxying to no where [`b85aa16`](https://github.com/http-party/node-http-proxy/commit/b85aa16e75401a223a947cde444d42cf7eeafb67) +- ENH: updated agent options in `common.setupOutgoing` [`12cda56`](https://github.com/http-party/node-http-proxy/commit/12cda561afe534427a5f84da9d7e0beb64a8ecbc) +- [fix] minor and short fixes [`e0faaaf`](https://github.com/http-party/node-http-proxy/commit/e0faaaf81152203b96f0313c68706468e7ee7357) +- support websockets [`4a4607d`](https://github.com/http-party/node-http-proxy/commit/4a4607d075a912746386d1751fd6b0fc98cf6b20) +- [test] COVERAGE [`004a46c`](https://github.com/http-party/node-http-proxy/commit/004a46c09df2f0f7b15d8e8f7119bc6039e0c01c) +- [misc] add a LICENSE file [`584ce76`](https://github.com/http-party/node-http-proxy/commit/584ce76e7576c906e25cdd04a2e079f97bcf86ff) +- ENH: updated https and agent option [`13741a8`](https://github.com/http-party/node-http-proxy/commit/13741a823f1c1c884d4a37e597e4b188598b0e25) +- [fix] write connection header [`2c10f25`](https://github.com/http-party/node-http-proxy/commit/2c10f256b658bc0e906c20f29d94ab7eaf653055) +- [fix] merge #495, thanks @glasser [`d0862af`](https://github.com/http-party/node-http-proxy/commit/d0862aff0c693366dcb11649b6abe1d011268953) +- support forward [`8c8c455`](https://github.com/http-party/node-http-proxy/commit/8c8c455541f21ad9a9ac7ca19d1f37368206a2e2) +- [tests] fix tests set correct host headers [`cfd417d`](https://github.com/http-party/node-http-proxy/commit/cfd417de2352b0f05535b979dc15abff60c1fb96) +- [fix] Optimize fix for `x-forwarded-for-port`. [`2d42709`](https://github.com/http-party/node-http-proxy/commit/2d42709c3283637de16a49e815b03e63432bbd29) +- ENH: updated readme with an example [`edd8e2f`](https://github.com/http-party/node-http-proxy/commit/edd8e2f04e4b39391b062fa6437d61b4ebde8748) +- [doc] update README.md [`dcb873a`](https://github.com/http-party/node-http-proxy/commit/dcb873ad9992b1534615d59b8a0a70e8b87d7884) +- [test] passes/web.js XHeaders func [`c02b721`](https://github.com/http-party/node-http-proxy/commit/c02b721321c455bc287c3fed6b9b21392ce2fc70) +- [fix] fixed passes functions, now 'this' can be used and options are stored on 'this.options' [`9b3e1eb`](https://github.com/http-party/node-http-proxy/commit/9b3e1eb247df29d18ea299ff4ebb2f10eeb71269) +- Revert "[fix] fixed passes functions, now 'this' can be used and options are stored on 'this.options'" [`5e130de`](https://github.com/http-party/node-http-proxy/commit/5e130de8548ad41b821da49299b4fd1c9536c5f0) +- [minor] Remove duplicate dependencies and cleanup of the scripts [`a51b062`](https://github.com/http-party/node-http-proxy/commit/a51b0622780f48160001f9e74340f7d720cbfce6) +- TEST: added agent and header tests [`39b0c46`](https://github.com/http-party/node-http-proxy/commit/39b0c46a6967fda5329760ad93a8ec01bc4a6f14) +- [examples] fix styling and bad spaces [`6a6dfbb`](https://github.com/http-party/node-http-proxy/commit/6a6dfbb79dc156679f75dd519344d19a5b61613b) +- ENH: added error events [`1b867a7`](https://github.com/http-party/node-http-proxy/commit/1b867a7f594f7dfe49fc17ff53451a353ec509d9) +- [test] remove chunked on http1.0 [`ca09263`](https://github.com/http-party/node-http-proxy/commit/ca092635e7ac4d967b554e3b94a16a931946d464) +- [tests] fix test to use the new way to pass options [`52ecd52`](https://github.com/http-party/node-http-proxy/commit/52ecd52ee5aa78603e44ba8d5ff9187410351622) +- [examples] fixed https examples [`a467b7b`](https://github.com/http-party/node-http-proxy/commit/a467b7b4a9614a7cbfdc256524e1495616e3d4d9) +- Revert "[tests] fix test to use the new way to pass options" [`2bf20d6`](https://github.com/http-party/node-http-proxy/commit/2bf20d61d53201e9820c5f9215e641fcf88f5172) +- [fix] better code [`3d8e538`](https://github.com/http-party/node-http-proxy/commit/3d8e5383cd9d527825f95d9071a87865fcebca05) +- [feature] implement _write and _read [`6a4294c`](https://github.com/http-party/node-http-proxy/commit/6a4294cbdfe85fa162969b1393032adc9d418441) +- [fix] use the correct arguments order [`cc09ae6`](https://github.com/http-party/node-http-proxy/commit/cc09ae6a345cfde1689e1d8731c5822675c59d4d) +- [fix] fix the correct order of arguments in ws-incoming passes [`02df9a3`](https://github.com/http-party/node-http-proxy/commit/02df9a33c5cce17ea32a892017acbe5ce57ab2e5) +- [fix] write status [`e08d4ed`](https://github.com/http-party/node-http-proxy/commit/e08d4edad339d0f7f55900b3e6e6a0e770960215) +- [fix] finished jshint fixes [`455f97e`](https://github.com/http-party/node-http-proxy/commit/455f97e14cb4929e0a3a5c746471e9c5e76436fc) +- Update the README to describe middleware err handler. [`25bb3bf`](https://github.com/http-party/node-http-proxy/commit/25bb3bfa7012e0f975e10f0311cae8c39183fa41) +- Prevent headers to be sent twice [`8332e74`](https://github.com/http-party/node-http-proxy/commit/8332e744202ed9de94288d8f1c822cd9fe788983) +- [examples] added package.json with the dependencies needed by examples [`d85ccdd`](https://github.com/http-party/node-http-proxy/commit/d85ccdd333edcfc7551bcf8e0ffd7dc166e38e61) +- [tests] added .travis.yml file [`0602500`](https://github.com/http-party/node-http-proxy/commit/06025002303f351f71d9e5f78a93895257f0d283) +- [dist minor] 2 space indents next time @samalba [`7e8041d`](https://github.com/http-party/node-http-proxy/commit/7e8041d2b687b8375a1d0fe45270029c6e8ddee6) +- [fix] naming [`8931009`](https://github.com/http-party/node-http-proxy/commit/893100972c22febbf133134394bc0bcef47d9e12) +- Fix for #458. Host header may cause some sites not to be proxyable with changeOrigin enabled [`781c038`](https://github.com/http-party/node-http-proxy/commit/781c038f2b4d14a01cc9297e1e0dba6ce39dd6cb) +- [docs] typos, typos everywhere... [`03880d8`](https://github.com/http-party/node-http-proxy/commit/03880d8d069e9e17ca7d7aea6eb760f6626a869c) +- ENH: updated `ws` and `web` functions to use the global options object as a base [`268afe3`](https://github.com/http-party/node-http-proxy/commit/268afe34bb51448d511c9cd73c03e97d1c1baee0) +- [fix] make @mmalecki a happy camper [`c9cd6d2`](https://github.com/http-party/node-http-proxy/commit/c9cd6d2ad324e0e6222932c8f29f27621071e045) +- write [`f97c0c6`](https://github.com/http-party/node-http-proxy/commit/f97c0c6167371c5ff92e6361b1df02e3fd5506d7) +- [fix] [`a9f9e21`](https://github.com/http-party/node-http-proxy/commit/a9f9e21eda2f8e912523e6b62abb0101c0353505) +- [fix] coveralls.. will it work? [`f36cb4d`](https://github.com/http-party/node-http-proxy/commit/f36cb4d5a110fc86272e878278f103f313c86f56) +- ENH: updated target and forward options so that a string may be specified [`ef946a7`](https://github.com/http-party/node-http-proxy/commit/ef946a7697b38b13178881b3d1ebde63681dd4a1) +- added option for eventlistenerCount(max) [`8eb6780`](https://github.com/http-party/node-http-proxy/commit/8eb6780f8705caff13a5375446539b0621d497d7) +- [fix] support buffer [`1204a35`](https://github.com/http-party/node-http-proxy/commit/1204a35e467c6c1855ba0dac8f55d79f899148a6) +- DOC: updated readme with options [`1b5fb1d`](https://github.com/http-party/node-http-proxy/commit/1b5fb1d8fc21421b8383919d93e4149b586b211b) +- ENH: added 'headers' to available options, to add or overwrite existing headers [`7d840d3`](https://github.com/http-party/node-http-proxy/commit/7d840d35151be1aac612798754af47368594781d) +- [fix] move logo [`57abb7f`](https://github.com/http-party/node-http-proxy/commit/57abb7f26c14e281c3be07a8b84e3c79e066f59f) +- FIX: tests. still need to add more tests tho [`a350fad`](https://github.com/http-party/node-http-proxy/commit/a350fadea6bace293131581487f8c66948009449) +- [fix] move logo [`aaff196`](https://github.com/http-party/node-http-proxy/commit/aaff1966e4e2eb42c9890e57737f57a64e8d964a) +- [docs] add travis build status [`6b61878`](https://github.com/http-party/node-http-proxy/commit/6b618787598a2a37850898dbdb3b4fe8f3c3414d) +- [fix] do not send chunked responses to http1.0 clients [`8663ac1`](https://github.com/http-party/node-http-proxy/commit/8663ac1c43505f0081d906c3cd8e702d4b5ddeb0) +- [dist] Bump dependencies. [`a81dd8d`](https://github.com/http-party/node-http-proxy/commit/a81dd8d53e1595cba9acf5cc3ca9517165dcc4aa) +- [fix] readme [`4d3a4e1`](https://github.com/http-party/node-http-proxy/commit/4d3a4e1ee7370347898d1863ab73aa68ed345d8d) +- [fix] proxying to https [`26c4c43`](https://github.com/http-party/node-http-proxy/commit/26c4c43a06263ec6721bc0e8a90644297d0cf217) +- [fix] new logo [`ee3cc38`](https://github.com/http-party/node-http-proxy/commit/ee3cc380665a31ec6af28ddb73dfc543f430d3f8) +- [fix] naming convention [`7d71a86`](https://github.com/http-party/node-http-proxy/commit/7d71a867a8bdc375f7577cec3905cca89bbf415c) +- fix docs [`9243444`](https://github.com/http-party/node-http-proxy/commit/9243444ac006f73c00b0f1f78c4a77f342b0b4e4) +- [fix] short circuit [`a6256ca`](https://github.com/http-party/node-http-proxy/commit/a6256cac1df1739e3da78fe5f0cf122ef7ce6b14) +- [tests] this test is already in web-incoming tests [`920f1e7`](https://github.com/http-party/node-http-proxy/commit/920f1e7707aa1751577533cd368529f8a704d7af) +- Emit middlewareError when on middleware error. [`bc12ca3`](https://github.com/http-party/node-http-proxy/commit/bc12ca39394f9aeed3e3047f59035ba48afa2885) +- DOC: updated readme [`7ad5c0f`](https://github.com/http-party/node-http-proxy/commit/7ad5c0f993294c9e2e7650e15fbc62d11a2cb062) +- [docs] add logo [`8b05626`](https://github.com/http-party/node-http-proxy/commit/8b05626eed5e45e72cf9b1f14a4c4dca1dd2ed0f) +- [fix] making @stoke a happy camper [`34f16e7`](https://github.com/http-party/node-http-proxy/commit/34f16e74647095199f84ab61e10c8dafd60b505a) +- [feature] add buffer support [`e3f8d5f`](https://github.com/http-party/node-http-proxy/commit/e3f8d5fdbe1ebc4f04188d95bbef768d09718d2c) +- [Fix] 2 spelling mistakes [`5823842`](https://github.com/http-party/node-http-proxy/commit/58238421945bcc4236e280ebca7799b831ae29a4) +- [fix] do not call .end [`6e77cd3`](https://github.com/http-party/node-http-proxy/commit/6e77cd390929842088ae9f6deb922a6627ddfecd) +- attempting to fix link to valid options properties [`bbe2b27`](https://github.com/http-party/node-http-proxy/commit/bbe2b2788a7ee3c74fd44fe88b6dcf213264436f) +- [fix] slimmer proxying [`031aa0f`](https://github.com/http-party/node-http-proxy/commit/031aa0fbf30bd377696c4efa508f6fc769bf1070) +- [fix] use agent pool [`abf1d90`](https://github.com/http-party/node-http-proxy/commit/abf1d90fdf05a17ebe05a3e90d464a592e0aee69) +- [tests] fix test using undefined url [`c4d56a5`](https://github.com/http-party/node-http-proxy/commit/c4d56a5faf1e89cdeb911f0ece0efe065eb58c45) +- [fix] legacy [`162a42f`](https://github.com/http-party/node-http-proxy/commit/162a42f58f515c5418ccfac0b68f4c928103b1e1) +- [tests] fixing minor typos [`b333e63`](https://github.com/http-party/node-http-proxy/commit/b333e63648aa67ea1b1aaf17ba684e5fc6f751a6) +- Updated readme [`bd106d6`](https://github.com/http-party/node-http-proxy/commit/bd106d69f074a1c7018e685a4e144e23a17beb8c) +- [misc] use the local mocha instead the global [`f1aeb05`](https://github.com/http-party/node-http-proxy/commit/f1aeb0500cde39b63e570323e0e478530d1222ab) +- added unlimited listeners to the reverproxy event obj. [`1333c0c`](https://github.com/http-party/node-http-proxy/commit/1333c0cc62e7b590843f9b00326fe80137163c5e) +- [tests] throw error when no options, ALL TESTS PASSING! YAY [`86750c7`](https://github.com/http-party/node-http-proxy/commit/86750c7e594c419dfae957aaf7e44e61e1d480e8) +- ENH: updated example [`1c7ace2`](https://github.com/http-party/node-http-proxy/commit/1c7ace26c5a36fb63497f1ab67793c5b75495063) +- [merge] PR #470 [`38e6d7c`](https://github.com/http-party/node-http-proxy/commit/38e6d7cd5449a7264dcf5244b3dfd07b2dda60e1) +- [fix] remove stuff [`6a03e5f`](https://github.com/http-party/node-http-proxy/commit/6a03e5f7cf356416ea13584e279f5bfa3791c058) +- [test][misc] remove node@0.8 to test on travis [`8eff1a1`](https://github.com/http-party/node-http-proxy/commit/8eff1a1f26bb739dfc5a1ad90b140ff2a18921d5) +- merge with @cronopio [`0fb3381`](https://github.com/http-party/node-http-proxy/commit/0fb33810f5e70b714bd9868557d85a531b8e11e3) +- [merge] text [`98f29bd`](https://github.com/http-party/node-http-proxy/commit/98f29bdcfca9b818ffe107b09578539fdf379c8a) +- [fix] woops [`bd3df45`](https://github.com/http-party/node-http-proxy/commit/bd3df45010f282997cae3a699c7ecb885c01bdf8) +- [test] Test on newer version of node [`ebbba73`](https://github.com/http-party/node-http-proxy/commit/ebbba73eda49563ade09f38bdc8aef13d1cf6c00) +- new error propagation - follows [`1993faf`](https://github.com/http-party/node-http-proxy/commit/1993faf8a4227acda3423d46cf2cf13b4d9861e7) +- [fix] minor typo [`5a1504f`](https://github.com/http-party/node-http-proxy/commit/5a1504f0764b7747b53cc0d92a69ff3093e85ade) +- [fix] proxy to http(s) [`3c91ed3`](https://github.com/http-party/node-http-proxy/commit/3c91ed3d26d9af640d0c7a09fb9cdaf80ad673ca) +- Put the arguments the right way around in the README. [`1457980`](https://github.com/http-party/node-http-proxy/commit/145798062e332ac2aed7f8e8e3240e38464c870a) +- [fix] use some [`4480699`](https://github.com/http-party/node-http-proxy/commit/4480699d3a2a5080c051e7b8a100689fd1f58657) +- [fix] layout [`d7078e2`](https://github.com/http-party/node-http-proxy/commit/d7078e2fdd16d23d0b5f8f1d8a7ab3e9011fea4f) +- [docs] logo [`dd0f7b8`](https://github.com/http-party/node-http-proxy/commit/dd0f7b8876ae5b57fffab8857735b25b159f2bdb) +- [fix] url [`0637322`](https://github.com/http-party/node-http-proxy/commit/0637322d96e54bbcf5a14bf009dd73314cada4ce) +- [fix] opts [`adc5be0`](https://github.com/http-party/node-http-proxy/commit/adc5be020c7fff09a1c05ac771d5c5ab61002c23) +- [docs] fix syntax highlighting [`da9de70`](https://github.com/http-party/node-http-proxy/commit/da9de7034a452d1281217a349bc9403fddcc2b7f) +- [fix] typo [`275a519`](https://github.com/http-party/node-http-proxy/commit/275a5192fa257f78287a954b347e65023795487d) +- [tests] fix code coverage, changed pattern on blanket options [`4090250`](https://github.com/http-party/node-http-proxy/commit/40902506af3361b642b8798350b48404fe0a4e78) +- Put the arguments the right way around in emitter. [`7c8ecc8`](https://github.com/http-party/node-http-proxy/commit/7c8ecc8ea85b59fc16b55b9a142372b6ac168b2a) +- [fix] link [`72a89ea`](https://github.com/http-party/node-http-proxy/commit/72a89eab8bafef3742d78e8de8631094f961f427) +- [fix] space [`69f126b`](https://github.com/http-party/node-http-proxy/commit/69f126b34cbd190be8541a854d21f13bfb5a61bf) +- [fix] tests [`8269eca`](https://github.com/http-party/node-http-proxy/commit/8269eca2bb34d08336b8889e06e53d3522fa79fe) +- [fix] console [`18341d5`](https://github.com/http-party/node-http-proxy/commit/18341d559717e0a86f5ee4da024109e4b5a595a7) +- Set travis to run `npm test` while we fix coveralss.io integration [`e2a5d51`](https://github.com/http-party/node-http-proxy/commit/e2a5d513cac3ebceff446787fa106c7f00caf785) +- [fix] making @jcrugzz a happy camper [`2e7343d`](https://github.com/http-party/node-http-proxy/commit/2e7343d728a3187d48821b88ec2e2d4699bb2afe) +- [fix] minor typo [`5d66ce1`](https://github.com/http-party/node-http-proxy/commit/5d66ce11bb7eef7e704a2de2c0ef3b5f754843e9) +- [tests] tests fixed [`d60353f`](https://github.com/http-party/node-http-proxy/commit/d60353f80bbbcba128a2c51066e107365270e878) +- [tests] disabled the examples-test by now [`d83fdf6`](https://github.com/http-party/node-http-proxy/commit/d83fdf69a1121bfcfba72bbffcd3105ae5852c56) +- [fix] _ because it is unused [`590bb60`](https://github.com/http-party/node-http-proxy/commit/590bb604dae11223a0ae80469b59d6d341488f1f) +- [tests] disable test, by now is not throwing without options [`a2b1f0a`](https://github.com/http-party/node-http-proxy/commit/a2b1f0a4c9079342db6255c5f92db4a0cb992707) +- [fix] support target and forward [`961d2f9`](https://github.com/http-party/node-http-proxy/commit/961d2f9400b4cfd236c3c8ccbf401d37f8e871b8) +- [dist] Version bump. 0.10.4 [`840f6d8`](https://github.com/http-party/node-http-proxy/commit/840f6d8d29dffc11d3726123c2d400940ca2bdda) +- [fix] remove old reminescence [`4d65280`](https://github.com/http-party/node-http-proxy/commit/4d65280ea313438a94589bacf55f7a09cc107888) +- [feature] add emit proxyRes [`dda6f7a`](https://github.com/http-party/node-http-proxy/commit/dda6f7a45a46d2bf63e482d0b47b7c36ae548546) +- [docs] test badge [`1ceea3e`](https://github.com/http-party/node-http-proxy/commit/1ceea3e5f9b6232d60d673946bbccb7d8ccb4beb) +- [tests] remove caronte and use http-proxy for file names [`c9f5772`](https://github.com/http-party/node-http-proxy/commit/c9f5772fc18226aca31471bc96c44a6dbff5cbea) +- [logo] [`4c2f2f3`](https://github.com/http-party/node-http-proxy/commit/4c2f2f3b9a5ba65f97403e778a670f14301d52c1) + +## [v0.10.3](https://github.com/http-party/node-http-proxy/compare/v0.10.2...v0.10.3) - 2013-06-20 + +### Merged + +- Pass default certs to SNICallback example [`#419`](https://github.com/http-party/node-http-proxy/pull/419) + +### Fixed + +- Pass default certs to SNICallback example [`#399`](https://github.com/http-party/node-http-proxy/issues/399) + +### Commits + +- [dist] Bump version to 0.10.3 [`2fd748f`](https://github.com/http-party/node-http-proxy/commit/2fd748fb61dac7de0daa50aabbface7033c6a222) +- [fix] Respect `maxSockets` from `target` options in `RoutingProxy` [`e1d384e`](https://github.com/http-party/node-http-proxy/commit/e1d384e769e9f4adc5a06c516cfb721ff24b4b6d) +- Send path in req.path and not the url [`0c75323`](https://github.com/http-party/node-http-proxy/commit/0c753234c0c85333f909bdbef034ffb6e192bad5) + +## [v0.10.2](https://github.com/http-party/node-http-proxy/compare/v0.10.1...v0.10.2) - 2013-04-21 + +### Merged + +- Correct keep-alive responses to HTTP 1.0 clients [`#407`](https://github.com/http-party/node-http-proxy/pull/407) + +### Fixed + +- [minor] Style compliance. Fixes #402. [`#402`](https://github.com/http-party/node-http-proxy/issues/402) + +### Commits + +- Correct keep-alive responses to HTTP 1.0 clients. [`a29b5e8`](https://github.com/http-party/node-http-proxy/commit/a29b5e8e289c34c00d2b450e5fb9dd1969db4b97) +- [minor] Strip trailing whitespace. [`7fc39d7`](https://github.com/http-party/node-http-proxy/commit/7fc39d77f47311b82c24ab05f8e1a45a2733305c) +- Add headers on 'handshake' [`985025c`](https://github.com/http-party/node-http-proxy/commit/985025c90f3b2fafede64d8b17c318326f2423d9) +- Don't test raw HTTP 1.0 requests over HTTPS. [`daf53bd`](https://github.com/http-party/node-http-proxy/commit/daf53bd753879223dc84a49c92d0efaf576c1fd3) +- [dist] Version bump. 0.10.2 [`de0928f`](https://github.com/http-party/node-http-proxy/commit/de0928f616dd62165e8a22c00d091cabf31e1e87) + +## [v0.10.1](https://github.com/http-party/node-http-proxy/compare/v0.10.0...v0.10.1) - 2013-04-12 + +### Merged + +- Fix for slab buffer retention, leading to large memory consumption [`#370`](https://github.com/http-party/node-http-proxy/pull/370) + +### Commits + +- [dist] Version bump. 0.10.1 [`9c13ad4`](https://github.com/http-party/node-http-proxy/commit/9c13ad46e416125373d6604f3954ec3df1f55449) + +## [v0.10.0](https://github.com/http-party/node-http-proxy/compare/v0.9.1...v0.10.0) - 2013-03-18 + +### Merged + +- Change the emitter of the `proxyResponse` event [`#385`](https://github.com/http-party/node-http-proxy/pull/385) +- Fixing a bug that generates an unexpected TypeError [`#383`](https://github.com/http-party/node-http-proxy/pull/383) +- Mention Harmon used for response modifications in the readme [`#384`](https://github.com/http-party/node-http-proxy/pull/384) + +### Commits + +- [dist] Update CHANGELOG.md [`8665f3c`](https://github.com/http-party/node-http-proxy/commit/8665f3cc600feecbb4c8229699823149c69a144f) +- Harmon messsage [`35ba0db`](https://github.com/http-party/node-http-proxy/commit/35ba0db554c6bace21b1bacfa8f5fb6df4228db0) +- [fix breaking] Emit the `proxyResponse` event on the HttpProxy instance to reduce listener churn and reference counts. [`2620f06`](https://github.com/http-party/node-http-proxy/commit/2620f06e2db9a267945566f10837c4c2a5df753d) +- [dist] Version bump. 0.10.0 [`71183bf`](https://github.com/http-party/node-http-proxy/commit/71183bf30bc2b9ad2eaf57c51980eeb0bc7edff0) +- Fixing the if statement as it lead to 'TypeError: Parameter 'url' must be a string, not undefined' in certain cases [`c9b6895`](https://github.com/http-party/node-http-proxy/commit/c9b6895c5e14add6aba4f826a2173458a1896a5f) +- Harmon messsage [`4e42354`](https://github.com/http-party/node-http-proxy/commit/4e42354e77d5731a383d516fc0b249d5d0eda745) + +## [v0.9.1](https://github.com/http-party/node-http-proxy/compare/v0.9.0...v0.9.1) - 2013-03-09 + +### Commits + +- [dist doc] Updated CHANGELOG.md for `v0.9.1` [`ea5e214`](https://github.com/http-party/node-http-proxy/commit/ea5e214522d8ac34d1129b28ff188c0f232ce63f) +- [dist] Version bump. 0.9.1 [`701dc69`](https://github.com/http-party/node-http-proxy/commit/701dc698e3eb39ca6836a02611d8dce750f4e212) +- [breaking] Ensure that `webSocketProxyError` also receives the error to be consistent with `proxyError` events. [`c78356e`](https://github.com/http-party/node-http-proxy/commit/c78356e9cf27a21c57e4c98ef7dd3c22abe864c2) + +## [v0.9.0](https://github.com/http-party/node-http-proxy/compare/v0.8.7...v0.9.0) - 2013-03-09 + +### Merged + +- If HTTP 1.1 is used and backend doesn't return 'Connection' header, expicitly return Connection: keep-alive. [`#298`](https://github.com/http-party/node-http-proxy/pull/298) +- add "with custom server logic" to the "Proxying WebSockets" section of the readme [`#332`](https://github.com/http-party/node-http-proxy/pull/332) +- routing proxy 'this' reference bug? [`#365`](https://github.com/http-party/node-http-proxy/pull/365) +- fixed issue #364 'proxyError' event emitted twice [`#374`](https://github.com/http-party/node-http-proxy/pull/374) +- Misleading documentation for Websockets via .createServer [`#349`](https://github.com/http-party/node-http-proxy/pull/349) + +### Fixed + +- [api test] Manually merge #195 from @tglines since that fork was deleted. Update tests to use new macros. Fixes #195. Fixes #60. [`#195`](https://github.com/http-party/node-http-proxy/issues/195) [`#60`](https://github.com/http-party/node-http-proxy/issues/60) +- [fix] Set "content-length" header to "0" if it is not already set on DELETE requests. Fixes #338. [`#338`](https://github.com/http-party/node-http-proxy/issues/338) +- [fix] Do not use "Transfer-Encoding: chunked" header for proxied DELETE requests with no "Content-Length" header. Fixes #373. [`#373`](https://github.com/http-party/node-http-proxy/issues/373) +- [fix] http-proxy should not modify the protocol in redirect request for external sites. Fixes #359. [`#359`](https://github.com/http-party/node-http-proxy/issues/359) +- [fix] Emit `notFound` event when ProxyTable location does not exist. Fixes #355. Fixes #333. [`#355`](https://github.com/http-party/node-http-proxy/issues/355) [`#333`](https://github.com/http-party/node-http-proxy/issues/333) +- [fix] Make options immutable in `RoutingProxy`. Fixes #248. [`#248`](https://github.com/http-party/node-http-proxy/issues/248) +- [fix] Remove special case handling of `304` responses since it was fixed in 182dcd3. Fixes #322. [`#322`](https://github.com/http-party/node-http-proxy/issues/322) +- [fix] Ensure `response.headers.location` is defined. Fixes #276. [`#276`](https://github.com/http-party/node-http-proxy/issues/276) + +### Commits + +- [minor] s/function(/function (/ s/){/) {/ [`9cecd97`](https://github.com/http-party/node-http-proxy/commit/9cecd97153ccce4f81c5eda35a49079e651fb27a) +- working on x-forwarded-for [`1332409`](https://github.com/http-party/node-http-proxy/commit/133240937dc63aca0007388327837bc24808f79a) +- Routing Proxy was not sending x-forward-*. Fixing It... [`916d44e`](https://github.com/http-party/node-http-proxy/commit/916d44e3d2a17bb9d5178f347ddad9796b988e05) +- Added timeout option and test to test new timeout parameter, added requestFail assertion. [`89d43c2`](https://github.com/http-party/node-http-proxy/commit/89d43c20dd0dec1dda1fd70e57f3f250b9e3b431) +- Add tests for headers bug fixes [`ecb5472`](https://github.com/http-party/node-http-proxy/commit/ecb547223f3f1d9bf551842c2026ee2f1a18638a) +- Added simple round robin example with websocket support [`83fbd42`](https://github.com/http-party/node-http-proxy/commit/83fbd4250660f41de1ab2b5490a3bf58200ae148) +- - support unix donain sockets and windows named pipes (socketPath) on node 0.8.x. On node 0.6.x the support was opaque via port, but on the new node, socketPath should be set explicitely. [`ffe74ed`](https://github.com/http-party/node-http-proxy/commit/ffe74ed299f81206b898147dbcc985519b2921f8) +- pathnameOnly flag added. Ignores hostname and applies routing table to the paths being requested. [`46b078a`](https://github.com/http-party/node-http-proxy/commit/46b078a98d10de7726a3bbca89121acc57ad7625) +- [doc] added comments to pathnameOnly block. [`5e6be6c`](https://github.com/http-party/node-http-proxy/commit/5e6be6ccf5a39ff450e57d7b24e374a83569fa85) +- remove offending code, final fix for issue #364 [`3b84e27`](https://github.com/http-party/node-http-proxy/commit/3b84e27ab4efd5ce3b8ac837d699d4ff6661c7e7) +- memory leak fix in closing of the scokets [`2055d0c`](https://github.com/http-party/node-http-proxy/commit/2055d0c8ec16699ffb06adf6d64d9506920b2071) +- Fix truncated chunked responses [`ef66833`](https://github.com/http-party/node-http-proxy/commit/ef66833c4d7f07ae9f42026f2bcc0fbca2440579) +- Re-added previous description [`603106a`](https://github.com/http-party/node-http-proxy/commit/603106a13d28c0199fa4456cc9aee1692eb2588c) +- pathnameOnly option documented in the Readme.md [`a1607c1`](https://github.com/http-party/node-http-proxy/commit/a1607c1684a7d7617e5148a0dca882eb08a9f03b) +- [fix minor] Prevent crashes from attempting to remove listeners more than once when proxying websocket requests. [`a681493`](https://github.com/http-party/node-http-proxy/commit/a681493371ae63f026e869bf58b6fea682dc5de3) +- Added comments [`64efa7f`](https://github.com/http-party/node-http-proxy/commit/64efa7f9291a2377a32e942a247700b71b107993) +- Revert "[fix minor] Prevent crashes from attempting to remove listeners more than once when proxying websocket requests." [`c6da760`](https://github.com/http-party/node-http-proxy/commit/c6da760ca9f375025229fe3fc174aca943362f38) +- [doc dist] Update CHANGELOG.md for `v0.9.0`. [`133115c`](https://github.com/http-party/node-http-proxy/commit/133115c9760130dcef447efbd18c470c08795c90) +- add support for loading CA bundles [`10f6b05`](https://github.com/http-party/node-http-proxy/commit/10f6b0577518bdfcb6b43c1f516dc988bdcade53) +- problem: don't want to run my server as root to bind to privileged ports (e.g. 80, 443). [`2c36507`](https://github.com/http-party/node-http-proxy/commit/2c3650746cd90fed63b140a8d393e18bd35cd8f9) +- Add 'proxyResponse' event so observer can modify response headers or abort response. [`3b86a7a`](https://github.com/http-party/node-http-proxy/commit/3b86a7aae3fc366c5fa8645285a4368dbac7a0dc) +- [minor] Move private helper to end of file. [`476cbe7`](https://github.com/http-party/node-http-proxy/commit/476cbe741fc41b7f1eb269d841d922784e8b3c6b) +- Fix for retaining large slab buffers in node core [`d2888c8`](https://github.com/http-party/node-http-proxy/commit/d2888c83f5eab3fb82425ef4fd51e62621bf2764) +- [dist] Update `devDependencies` [`ad21310`](https://github.com/http-party/node-http-proxy/commit/ad213106d06cfc79004841f04b8e73fe7d7ef67a) +- [minor] Small whitespace compliance. [`ea0587a`](https://github.com/http-party/node-http-proxy/commit/ea0587a8f98b1eedc38c66b69293ae091e24be6e) +- [doc fix] Add undefined var in example. [`deca756`](https://github.com/http-party/node-http-proxy/commit/deca7565c51fd678354d26eaae7fe2481e36e2c3) +- working on x-forwarded-for [`31fc94a`](https://github.com/http-party/node-http-proxy/commit/31fc94aa5e43c54033d5384caaf104eebf3889bd) +- Allow event observers to access upstream response headers and data. [`4c130f5`](https://github.com/http-party/node-http-proxy/commit/4c130f5dac5f2cfbfc2618446b86244aff4cb04f) +- [fix doc] Fix bad variable reference in `README.md`. [`440013c`](https://github.com/http-party/node-http-proxy/commit/440013c263a96c6681bfe92a8f56db93b58efa8d) +- Change wording for handling websocket proxy events [`ee6bbe0`](https://github.com/http-party/node-http-proxy/commit/ee6bbe00244c90bd532b11ff1c796aea8c7372f8) +- [dist] Version bump. 0.9.0 [`c68e038`](https://github.com/http-party/node-http-proxy/commit/c68e0389120d8530e578e20496d8ee091e69a580) +- fix 'this' reference in routing proxy listener bindings [`15afc23`](https://github.com/http-party/node-http-proxy/commit/15afc23a275f3fa16653fff6179368122661a0af) +- cleanning [`8d87399`](https://github.com/http-party/node-http-proxy/commit/8d8739999fcaf4cdd8f2471046f6f036c44dc8f7) +- cleanning [`9672b99`](https://github.com/http-party/node-http-proxy/commit/9672b9927156a0dfe3ce4539f380aaf3172f6267) +- Fix typo which slipped in during patch clean-up [`ba65a48`](https://github.com/http-party/node-http-proxy/commit/ba65a485fcf7230e85cee77f6eefcd17e46c8f86) +- Remove data event that is not needed after-all. [`b1c4bd6`](https://github.com/http-party/node-http-proxy/commit/b1c4bd61e8ae5705d4cc97bf719c381554671967) + +## [v0.8.7](https://github.com/http-party/node-http-proxy/compare/v0.8.6...v0.8.7) - 2012-12-22 + +### Commits + +- [fix] Handle errors on request object [`edfe869`](https://github.com/http-party/node-http-proxy/commit/edfe86915941e465a06c1d0a3330ee32e5834aa6) +- [dist] Bump version to 0.8.7 [`26d3646`](https://github.com/http-party/node-http-proxy/commit/26d3646ff252129f35525ab0540a31f5617a31d2) +- [fix] Don't remove `error` listener after response ends [`223eacd`](https://github.com/http-party/node-http-proxy/commit/223eacda85a4267f2860f6c46f7dedfa9db8c224) + +## [v0.8.6](https://github.com/http-party/node-http-proxy/compare/v0.8.5...v0.8.6) - 2012-12-21 + +### Merged + +- http-proxy: 304 responses should emit 'end' too [`#337`](https://github.com/http-party/node-http-proxy/pull/337) + +### Commits + +- [bench] Remove silly "benchmarks" [`2bd9cd9`](https://github.com/http-party/node-http-proxy/commit/2bd9cd9adb6cea6763930468d22cb56fffab6218) +- [bench] Add a benchmark for websockets throughput [`6797a27`](https://github.com/http-party/node-http-proxy/commit/6797a2705a309d19a655ab468bcc80ba2e43cf41) +- [fix] Handle socket errors [`2a61ec8`](https://github.com/http-party/node-http-proxy/commit/2a61ec85bdaeed9a5fca2a117efb36a7f76becc4) +- [dist] Update `devDependencies` [`b81d9b7`](https://github.com/http-party/node-http-proxy/commit/b81d9b71daa32a571384cff29d81227993299236) +- [dist] Bump version to 0.8.6 [`6cd78f6`](https://github.com/http-party/node-http-proxy/commit/6cd78f6af9ca08b8797c409896eea2ae6bb6d835) +- [bench] More exact size display [`7bc1a62`](https://github.com/http-party/node-http-proxy/commit/7bc1a628feab78f8931e9e6481737dd871debfeb) + +## [v0.8.5](https://github.com/http-party/node-http-proxy/compare/v0.8.4...v0.8.5) - 2012-11-16 + +### Merged + +- lib: allow overriding maxSockets [`#323`](https://github.com/http-party/node-http-proxy/pull/323) + +### Fixed + +- [fix] Convert strings to numbers if possible in `.createServer` [`#321`](https://github.com/http-party/node-http-proxy/issues/321) + +### Commits + +- [test] Delete invalid core test [`886a395`](https://github.com/http-party/node-http-proxy/commit/886a395429f20163992ca76e7b0d059256f56ba6) +- [test] Upgrade `common.js` from node core [`fefbf04`](https://github.com/http-party/node-http-proxy/commit/fefbf04ac03126858bdad07df7b10131a46e17d6) +- add "with custom server logic" to the "Proxying WebSockets" section of the readme.md [`03dbe11`](https://github.com/http-party/node-http-proxy/commit/03dbe115c2b088737e5b9abcadf91a8298f56f1f) +- [test] Kill child process when exiting test runner [`74ec175`](https://github.com/http-party/node-http-proxy/commit/74ec1757153c503ce57eb552031648fe79731d48) +- [fix] Correctly kill test processes [`b8c27ed`](https://github.com/http-party/node-http-proxy/commit/b8c27ed565e416827b7c4bb123aa9ee119d008e6) +- [test] Make global detection work with older node versions [`3531fd6`](https://github.com/http-party/node-http-proxy/commit/3531fd609a8ce156d27c27ca38ac912a73aebfeb) +- [dist] Bump version to 0.8.5 [`22639b3`](https://github.com/http-party/node-http-proxy/commit/22639b378189ec78f9962dde64337df050e29a6f) +- [test] Run core tests on `npm test` [`41c9a9c`](https://github.com/http-party/node-http-proxy/commit/41c9a9caad679221b8f1d4dcfb74f9b2bdb8270b) +- [test] Stop testing on `node v0.9`, tests timeout [`9042665`](https://github.com/http-party/node-http-proxy/commit/9042665ea98a6587e1d6800e51d3c354c0a1b20a) + +## [v0.8.4](https://github.com/http-party/node-http-proxy/compare/v0.8.2...v0.8.4) - 2012-10-23 + +### Merged + +- Events patch [`#320`](https://github.com/http-party/node-http-proxy/pull/320) +- documentation for options [`#315`](https://github.com/http-party/node-http-proxy/pull/315) +- Added travis build status [`#308`](https://github.com/http-party/node-http-proxy/pull/308) +- Fix installation instructions: s/http/https/ [`#302`](https://github.com/http-party/node-http-proxy/pull/302) +- If supplied pass changeOrigin option through to HttpProxy instance if set in RoutingProxy [`#285`](https://github.com/http-party/node-http-proxy/pull/285) + +### Commits + +- [fix test] Fix examples to use newest version of socket.io and helpers. Added tests for ensuring that examples require as expected with no errors. [`fd648a5`](https://github.com/http-party/node-http-proxy/commit/fd648a529090cefc202613fff3fdfec9ba0e6a72) +- [fix] spdy should look like https when forwarding (until we get a client) [`698b01d`](https://github.com/http-party/node-http-proxy/commit/698b01da8e1fe6195b00e5006032d262a0a86f4e) +- [docs] options [`4c8e1d9`](https://github.com/http-party/node-http-proxy/commit/4c8e1d96a36523a548959415903bc669ebcc138d) +- http-proxy: emit websocket:start [`5df6e7b`](https://github.com/http-party/node-http-proxy/commit/5df6e7bdb8d4685a18e94ff1bf117ce8eff8d1c9) +- [fix] `destroy()` websockets in case of an error [`0d00b06`](https://github.com/http-party/node-http-proxy/commit/0d00b06af307dc5c70c36e89617a08486eb665e2) +- [fix] Suppress EADDRINUSE errors from `test/examples-test.js` since we are just looking for require-time errors. Isolate tests to ensure idempotency of ports [`c4a7b15`](https://github.com/http-party/node-http-proxy/commit/c4a7b1584302fe12a8fc06b6774db5ff602c3607) +- [docs] more options [`d4cb9da`](https://github.com/http-party/node-http-proxy/commit/d4cb9dad6ce36a823c9e8970e0bb3266d844e536) +- If HTTP 1.1 is used and backend doesn't return 'Connection' header, explicitly [`850171c`](https://github.com/http-party/node-http-proxy/commit/850171cdc41cb93343f7c31f650ac908a8d2dacb) +- [refactor] Pass all options to `Agent` constructor [`eafdc74`](https://github.com/http-party/node-http-proxy/commit/eafdc744b67b33b5ed3cfc80de84dafcd850bdd0) +- Fix socket leaks when FIN packet isn't responded to [`24b8406`](https://github.com/http-party/node-http-proxy/commit/24b84068eac1c704d9f8df3dc833b976850c328f) +- [fix] Partial fix for rejecting self-signed certs in tests [`2e7d8a8`](https://github.com/http-party/node-http-proxy/commit/2e7d8a88f4b470dcc9da1639fe2a69e03251036c) +- [fix] Dont use `-i` when running vows because it supresses `--target=` and `--proxy=` CLI arguments [`1783ab0`](https://github.com/http-party/node-http-proxy/commit/1783ab0625743355eecc11f5cfd57469c429daa0) +- [test] Add `node v0.9` testing, test all branches [`4f6387c`](https://github.com/http-party/node-http-proxy/commit/4f6387c17f55c23da4aac161cf2e5a4dd2a25c40) +- [minor] Remove `setEncoding` on incoming socket [`812868d`](https://github.com/http-party/node-http-proxy/commit/812868ddfc720b6c4fd26603c2fe4d5ae68f2492) +- [dist] v0.8.3 [`a89a5b8`](https://github.com/http-party/node-http-proxy/commit/a89a5b80889a56dd31634096bc6546b6b7b26da2) +- [fix] Ignore npm version errors when installing dependencies for examples [`a454666`](https://github.com/http-party/node-http-proxy/commit/a454666e7a0465ed65b7bbd29cf1b0c6c126d153) +- [fix] function [`213e03c`](https://github.com/http-party/node-http-proxy/commit/213e03c99844c5c984fbf857bae32095165a1e8f) +- [dist] Bump version to 0.8.4 [`4d7e8a8`](https://github.com/http-party/node-http-proxy/commit/4d7e8a808d83d3db1b729820aba5f481ab3d18f4) +- [minor doc] Correct comment [`cee27fe`](https://github.com/http-party/node-http-proxy/commit/cee27feeddf9b4db06917dfa9e59e6bcd7e14c27) + +## [v0.8.2](https://github.com/http-party/node-http-proxy/compare/v0.8.1...v0.8.2) - 2012-07-22 + +### Merged + +- Add example for gzip middleware using a proxy table. [`#221`](https://github.com/http-party/node-http-proxy/pull/221) +- Implement RoutingProxy.prototype.remove [`#246`](https://github.com/http-party/node-http-proxy/pull/246) +- prefer `target.hostname` over `target.host` [`#235`](https://github.com/http-party/node-http-proxy/pull/235) +- add "Using two certificiates" to the https section of the readme.md [`#275`](https://github.com/http-party/node-http-proxy/pull/275) +- Add support for setting the host in the executable [`#268`](https://github.com/http-party/node-http-proxy/pull/268) +- Hi! I fixed some calls to "sys" for you! [`#270`](https://github.com/http-party/node-http-proxy/pull/270) +- Fix bug: x-forwarded-proto set incorrectly as httphttps or wswss [`#266`](https://github.com/http-party/node-http-proxy/pull/266) + +### Commits + +- [refactor] Rewrite tests to use saner vows idioms. Update tests to use latest socket.io [`4ae7a5b`](https://github.com/http-party/node-http-proxy/commit/4ae7a5b84011bb5b9ec3a36ded4c5e5b3330db80) +- [dist] Remove out-dated docco docs [`2d75510`](https://github.com/http-party/node-http-proxy/commit/2d75510d827c770c30a7292c31ef0f2007da7086) +- [refactor test] Finish removing old test code. [`e2dc7f9`](https://github.com/http-party/node-http-proxy/commit/e2dc7f96937e5d565fea16c9f56b9f5d3e427de2) +- [dist] Complete JSHint compliance except for `too many var statements` [`36226da`](https://github.com/http-party/node-http-proxy/commit/36226daa2e4cbc65fae80d2d09fd64c0e7ce36ba) +- [refactor test] Add support for `http*-to-http*` testing from CLI arguments [`828dbeb`](https://github.com/http-party/node-http-proxy/commit/828dbebcaaf11e338a7727bf9d2fff8bfbd3726e) +- [fix api] Optimize lookups in the ProxyTable. Ensure that RoutingProxy can proxy to `https` by default. [`55286a7`](https://github.com/http-party/node-http-proxy/commit/55286a7c499c0fe267f75d8e8441ff89f1e65f99) +- Whitespace fixes. [`04ce49c`](https://github.com/http-party/node-http-proxy/commit/04ce49c5b289acb6ad72303e9ac70c637ea490b2) +- [refactor tests] Finished refactoring tests to support `ws*-to-ws*` tests based on CLI arguments [`7e854d7`](https://github.com/http-party/node-http-proxy/commit/7e854d778b89201f7cb933e8bbda66316b98b0b4) +- [doc] Minor formatting updates to README.md [`6753951`](https://github.com/http-party/node-http-proxy/commit/67539519faf1f32073fdb562404bd897072e24ee) +- [fix] Changed require('util') to require('util') for compatibility with node v0.8 [`bf7e328`](https://github.com/http-party/node-http-proxy/commit/bf7e328fb837de69455c42f41822b0caae2777b6) +- [test] Add .travis.yml file for Travis CI. [`29e6e74`](https://github.com/http-party/node-http-proxy/commit/29e6e748f780629d05635eebb421e8ee1d125058) +- Use changeOrigin for proxyRequest. [`0273958`](https://github.com/http-party/node-http-proxy/commit/0273958b0a5c7823c6212cb6ce6e4f801a215d3b) +- adding support for setting the host [`06e78f2`](https://github.com/http-party/node-http-proxy/commit/06e78f27475165d023fd66afbe5dd626a6a548af) +- match style requested by @cronopio [`415d4ed`](https://github.com/http-party/node-http-proxy/commit/415d4ed908e45332421d683eb45e0d6873b85ae7) +- Fix bug: x-forwarded-proto set incorrectly [`0933f1c`](https://github.com/http-party/node-http-proxy/commit/0933f1c598c1b62a75e040c3ed3ccb262612d3c9) +- [dist] Version bump. 0.8.2 [`13c34d0`](https://github.com/http-party/node-http-proxy/commit/13c34d09b2f8be14fbbe4be77c49b23066667f1b) + +## [v0.8.1](https://github.com/http-party/node-http-proxy/compare/v0.8.0...v0.8.1) - 2012-06-05 + +### Merged + +- [misc] Updating the changelog. Close #137 [`#256`](https://github.com/http-party/node-http-proxy/pull/256) +- Fix problem with req.url not being not properly replaced. [`#218`](https://github.com/http-party/node-http-proxy/pull/218) +- Re-emit 'start', 'forward' and 'end' events in RoutingProxy, and fix some hanging issues. [`#216`](https://github.com/http-party/node-http-proxy/pull/216) +- Fixes to make the websockets example work. [`#225`](https://github.com/http-party/node-http-proxy/pull/225) +- [minor] Syntax error [`#222`](https://github.com/http-party/node-http-proxy/pull/222) +- [docs] Making README links consistent with latest project structure. [`#208`](https://github.com/http-party/node-http-proxy/pull/208) +- [docs] improved grammar [`#205`](https://github.com/http-party/node-http-proxy/pull/205) +- proposed doc addition for #180 [`#189`](https://github.com/http-party/node-http-proxy/pull/189) + +### Fixed + +- Merge pull request #256 from nodejitsu/changelog [`#137`](https://github.com/http-party/node-http-proxy/issues/137) +- [misc] Updating the changelog. Close #137 [`#137`](https://github.com/http-party/node-http-proxy/issues/137) + +### Commits + +- Whitespace fixes [`e9fd3f4`](https://github.com/http-party/node-http-proxy/commit/e9fd3f43d7e890f0164b5a03a34f196dd162d043) +- Added example for gzip middleware using a ProxyTable. [`6201328`](https://github.com/http-party/node-http-proxy/commit/62013281b8a980c53a38362f10d746bfbf36c52e) +- [examples] Added simple load balancer example [`fd7fcd8`](https://github.com/http-party/node-http-proxy/commit/fd7fcd8decbf0c7ab00cab84e151991e380b8fae) +- [dist] Update author field for consistency [`27316e2`](https://github.com/http-party/node-http-proxy/commit/27316e22e8e7786252583cdb9131cfd8cacb07c1) +- Add documentation for listening for proxy events to prevent a common mistake. [`4f2bc58`](https://github.com/http-party/node-http-proxy/commit/4f2bc58431c7f44d486ee8c1ee3136b3637f9405) +- Fix RoutingProxy hanging when there is an error [`b26b434`](https://github.com/http-party/node-http-proxy/commit/b26b434e9fc501f7e0c4a966dbee6220c355bc7c) +- prefer `target.hostname` over `target.host` [`c4d185d`](https://github.com/http-party/node-http-proxy/commit/c4d185dca9696c77d5c38d24d897c2679f6762a0) +- [doc] Fix style in websockets example [`ed06af9`](https://github.com/http-party/node-http-proxy/commit/ed06af97efe406ea2533009be64a6b568f9d0601) +- Add tests for remapping URL properly. [`5d839dd`](https://github.com/http-party/node-http-proxy/commit/5d839dd5f8890c6d2af96807b96d1bd5bb0f7276) +- fixed comment typos in examples/http/proxy-https-to-http.js and proxy-https-to-https.js, lines 37 and 46 [`868f7e7`](https://github.com/http-party/node-http-proxy/commit/868f7e7a287c4709c541c077f3e2303f45b1f072) +- [misc] changelog updated to version 0.8.1 [`e9a3a30`](https://github.com/http-party/node-http-proxy/commit/e9a3a3012c5507dff46afd3e5cececf43b1717ae) +- Implement RoutingProxy.prototype.remove [`0532995`](https://github.com/http-party/node-http-proxy/commit/0532995dfa0be53d285c886a9922b8915f297d36) +- Making README links consistent with latest project structure. [`7fa6599`](https://github.com/http-party/node-http-proxy/commit/7fa6599f4f2c92bb29bc5fc8a9ba06d704652c5e) +- Address ticket #180 here since that problem is so hard to discover when you run into it. If there was an error, people would search for the error text, but there isn't. [`73e415a`](https://github.com/http-party/node-http-proxy/commit/73e415a22634bfc9e5993377902f67ac3212714a) +- [tests] used socket.io 0.6.17 fixed version for tests [`45d67f4`](https://github.com/http-party/node-http-proxy/commit/45d67f42cba373db4f47765d6a3dd38a7d19dae6) +- [fix] x-forwarded-proto sets properly [`ca37ad7`](https://github.com/http-party/node-http-proxy/commit/ca37ad74367764cca479a1af63bd7491dc79606b) +- [doc] add missing {} to make an object [`843901e`](https://github.com/http-party/node-http-proxy/commit/843901eeeb24611ad24889f13edcbfd5dee4314d) +- fix the broken english and clarified the sentence (I hope) [`e15db4f`](https://github.com/http-party/node-http-proxy/commit/e15db4fb50db3e2191f3ebd30e12eeed9c376bc2) +- Re-emit 'start', 'forward' and 'end' events in RoutingProxy. [`99ee542`](https://github.com/http-party/node-http-proxy/commit/99ee54259eae70c0c680ee82efc7dd184313f182) +- [doc] call listen() to get the server started [`4fc1ee8`](https://github.com/http-party/node-http-proxy/commit/4fc1ee85d35d9feb468f808ddd11aaf186eaedd4) +- syntax error fixed [`5842d0e`](https://github.com/http-party/node-http-proxy/commit/5842d0ee7de875378d9b8ae240748dd2af567be9) +- [dist] Version bump 0.8.1 [`81f6095`](https://github.com/http-party/node-http-proxy/commit/81f6095cf08f84a84ae2bbda7ca0315729638fe0) +- finally removed hidden char [`4358a4c`](https://github.com/http-party/node-http-proxy/commit/4358a4c1225acf8c13536fd742b845166f3a65a6) +- [minor fix] delete white space [`df650d1`](https://github.com/http-party/node-http-proxy/commit/df650d11dd0a47653a4905f871d8d3d6c327d600) + +## [v0.8.0](https://github.com/http-party/node-http-proxy/compare/v0.7.3...v0.8.0) - 2011-12-23 + +### Merged + +- Fix issue where front-end is HTTPS, back-end is HTTP, and server issues a redirect. [`#165`](https://github.com/http-party/node-http-proxy/pull/165) +- Modified the ad-hoc proxy lookup to use _getKey(), rather than the error-prone in-line method. [`#164`](https://github.com/http-party/node-http-proxy/pull/164) +- Allows node-http-proxy to append new values to existing headers for incoming "x-forward-for","x-forward-proto" and "x-forward-port" [`#163`](https://github.com/http-party/node-http-proxy/pull/163) +- [fix] only set one drain listener while paused [`#136`](https://github.com/http-party/node-http-proxy/pull/136) +- [docs] grammar correction [`#134`](https://github.com/http-party/node-http-proxy/pull/134) + +### Fixed + +- [fix] Avoid `Transfer-Encoding: chunked` for HTTP/1.0 client, closes #59. [`#59`](https://github.com/http-party/node-http-proxy/issues/59) + +### Commits + +- [refactor minor] Update vendor/websocket.js to be compatible with node@0.6.x [`ea7fea6`](https://github.com/http-party/node-http-proxy/commit/ea7fea627255ed34d39902438b55e740c7c9b08c) +- [test] Add common.js file from core [`543f214`](https://github.com/http-party/node-http-proxy/commit/543f214361605cffdbee7b233029edf343c358c1) +- [test] Add core `test-http-proxy` test [`feb324b`](https://github.com/http-party/node-http-proxy/commit/feb324b0d4c0a2307493b35be944ed08ffc9187a) +- [test] Add core `test-http` test [`25a9e2d`](https://github.com/http-party/node-http-proxy/commit/25a9e2d217cabef07d6f161f5d6ded49342dbb2f) +- [test] Add core `test-http-host-headers` test [`f298411`](https://github.com/http-party/node-http-proxy/commit/f298411f76a106791f34dd4d31ea033a7bdca9c7) +- [test] Add core `test-http-extra-response` test [`c26ab5e`](https://github.com/http-party/node-http-proxy/commit/c26ab5e46ff2649f0ea6585f20d8f58b7d0cadef) +- [test] Add core `test-http-set-cookies` test [`b3b5cce`](https://github.com/http-party/node-http-proxy/commit/b3b5cce3aee98a7fd5b50fb8e1bd6bd5e1c7512f) +- [test] Add core `test-http-client-abort` test [`7bf8d4a`](https://github.com/http-party/node-http-proxy/commit/7bf8d4a7be668591b350144b4546559abf9a0b5f) +- [test] Add core `test-http-client-upload` test [`7648fe5`](https://github.com/http-party/node-http-proxy/commit/7648fe50c1859597dc390e9e628db938372483e7) +- [test] Add core `test-http-client-upload-buf` test [`5ac9878`](https://github.com/http-party/node-http-proxy/commit/5ac987857c934d07073b853f5243d2d8fc6d8c2b) +- [test] Add core `test-http-upgrade-server2` test [`bc98c0d`](https://github.com/http-party/node-http-proxy/commit/bc98c0dbce154ef266eef83d3c2f737a2d60f0e6) +- [test] Implement basic runner for multiple tests [`a4079c6`](https://github.com/http-party/node-http-proxy/commit/a4079c6a1c8b87334d12d47d67f060cbb1214696) +- [test] Add core `test-http-upload-timeout` test [`60ff181`](https://github.com/http-party/node-http-proxy/commit/60ff181af9c22405d3822ce5955f178ab13de79d) +- [test] Add core `test-http-status-code` test [`82060a5`](https://github.com/http-party/node-http-proxy/commit/82060a53430de05f2dc95450d8487bc8139544d5) +- [test] Add core `test-http-many-keep-alive-connections` test [`4e1ca6e`](https://github.com/http-party/node-http-proxy/commit/4e1ca6e61899b11cad1b437cc9d9490b9d856665) +- [test] Add core `test-http-chunked` test [`d7461f3`](https://github.com/http-party/node-http-proxy/commit/d7461f3206cca0691fbd438545ff325589770627) +- [test] Add core `test-http-head-response-has-no-body-end` test [`13389db`](https://github.com/http-party/node-http-proxy/commit/13389db1bef38a7fc7ddc3ada479a608f033020c) +- [test] Add core `test-http-server-multiheaders` test [`d7f15d0`](https://github.com/http-party/node-http-proxy/commit/d7f15d02f7477c76529fc76daddee5029079eb2d) +- [test] Add core `test-http-multi-line-headers` test [`35d2088`](https://github.com/http-party/node-http-proxy/commit/35d2088c96bacb44b17755176b6e9451ed0299dd) +- [test] Add core `test-http-head-response-has-no-body` test [`f79f3ad`](https://github.com/http-party/node-http-proxy/commit/f79f3adf0295ec5bb7fb9f6525b48ba5209d04c6) +- [refactor] Improved event handler cleanup [`9f92332`](https://github.com/http-party/node-http-proxy/commit/9f923325d08ac018a3325beaa9e0805b5eda61e6) +- [fix minor] Correctly set x-forwarded-proto in WebSocket requests [`c81bae2`](https://github.com/http-party/node-http-proxy/commit/c81bae2fdde3bf0087fe71a39855c61c43ffb145) +- Revert "[refactor] Improved event handler cleanup " [`c83d88e`](https://github.com/http-party/node-http-proxy/commit/c83d88ee88faac10b53cd4296165ed85f26036b4) +- Allowing the common proxy headers' value to be appended in proxy chain scenarios. [`621f9b4`](https://github.com/http-party/node-http-proxy/commit/621f9b425a272421de98a674f1679f0c47912733) +- [test] Add basic test runner [`87999d0`](https://github.com/http-party/node-http-proxy/commit/87999d028880dfccca349c9c44f9e66a613c4d38) +- [examples] Add some hand-crafted middleware [`6e65c20`](https://github.com/http-party/node-http-proxy/commit/6e65c20017a2e1a87dc6d58e847bc6db16440f3c) +- [test] Add core `test-http-malformed-request` test [`a635389`](https://github.com/http-party/node-http-proxy/commit/a6353897cdbe8c380d52a060f5e66784f67ad98e) +- [example] Response modification middleware [`dd83199`](https://github.com/http-party/node-http-proxy/commit/dd8319972c1c2f9421a90a21dce9560fd5ca199f) +- [test] Add core `test-http-head-request` test [`c0857f2`](https://github.com/http-party/node-http-proxy/commit/c0857f2d59c33d91cb3e0c131c44ec1667f592fa) +- [test] Add core `test-http-response-close` test [`f1c0be3`](https://github.com/http-party/node-http-proxy/commit/f1c0be3f0bd2c5e87d44a37ba4f29aafd9903ad4) +- [refactor] core proxy logic. all tests should be passing. [`63ac925`](https://github.com/http-party/node-http-proxy/commit/63ac9252606d23e2003696da1fb34a539abee7ca) +- [test] Add core `test-http-contentLength0` test [`275109b`](https://github.com/http-party/node-http-proxy/commit/275109b2f8c8519c56ca9f456096d4002698fab1) +- [test] Add core `test-http-client-abort2` test [`98bbe54`](https://github.com/http-party/node-http-proxy/commit/98bbe541e4fa581f1b9e2eadb821c0609da6ab81) +- adding tests for url segment proxytable routing [`91e9bb9`](https://github.com/http-party/node-http-proxy/commit/91e9bb90709cc8a361066d6f6b8f51f58bfd7e36) +- [test] Add core `test-http-eof-on-connect` test [`80c216d`](https://github.com/http-party/node-http-proxy/commit/80c216df0cc59b88c6934f795c03ea16a737af34) +- [example] Replace `sys` usages with `util` [`8d701bb`](https://github.com/http-party/node-http-proxy/commit/8d701bb20b593c6cdf0ff1bc35cf83051b21a35e) +- [refactor] Updates to support http2 from @mikeal [`5b52c89`](https://github.com/http-party/node-http-proxy/commit/5b52c896947db42ac01e6038c9170d8859d33aea) +- [refactor] Listen for `socket` events since reverseProxy.socket is no longer set synchronously [`3828616`](https://github.com/http-party/node-http-proxy/commit/38286168161d4f4ad24d2ad95ccd8335e9ed08a4) +- [test] Run tests in `test/core/simple` by default [`68cebbe`](https://github.com/http-party/node-http-proxy/commit/68cebbe0e79ea283eea8a1ca850ab462c66c611a) +- simplify proxytable path segment rewrite logic [`c03a450`](https://github.com/http-party/node-http-proxy/commit/c03a450d9b952e1463ae2609303029e317ff5da2) +- change proxytable routing to route one level shallower [`4d50915`](https://github.com/http-party/node-http-proxy/commit/4d50915373b6afaafc7857a3e9366e8e77315683) +- [docs] Little explanation for test/core directory [`8ca5d83`](https://github.com/http-party/node-http-proxy/commit/8ca5d83497cc106a2456ff7f2ebe3db5c8634d69) +- [minor] Allow user to set `colors.mode` [`48d4a8b`](https://github.com/http-party/node-http-proxy/commit/48d4a8b263faa9acda06651bceeff50881f21b26) +- [minor] Indentation fix [`9e630da`](https://github.com/http-party/node-http-proxy/commit/9e630daf81d10485206ec136c3e1a07fe065ffeb) +- [v0.6] `http.Agent` uses different structure for sockets [`86b4122`](https://github.com/http-party/node-http-proxy/commit/86b4122323ca32d455714b1149b99acce49a9e45) +- [minor] Nicer output from test runner [`5c3d41b`](https://github.com/http-party/node-http-proxy/commit/5c3d41bf4e101d0250fb0b3db4a8dc078104dcad) +- Modified the ad-hoc proxy lookup to use _getKey(), rather than the [`553e7fb`](https://github.com/http-party/node-http-proxy/commit/553e7fbc335a9befd166d472f057aa50452a9d40) +- [fix] When client request is aborted, abort server request [`4d43d81`](https://github.com/http-party/node-http-proxy/commit/4d43d81e5c2d7c8088716d4fd574019f43ebb5ce) +- Fixes memory leak when clients abort connections [`c98ccb4`](https://github.com/http-party/node-http-proxy/commit/c98ccb40e9fe5c5198a1605fa8835efc3ff1856c) +- [fix test] Make test runner exit after test exits [`31a8c68`](https://github.com/http-party/node-http-proxy/commit/31a8c6800ddf8d91b477d980605a4c19284a1648) +- [test dist] Run core tests on `npm test` [`8358ef8`](https://github.com/http-party/node-http-proxy/commit/8358ef8a2bdf817c8ed515be7bc9cec0a9b5f486) +- don't add upgrade handler if a custom handler is passed in [`d6ea3a4`](https://github.com/http-party/node-http-proxy/commit/d6ea3a425c203695394eaba4ce8abd57f7809e98) +- always emit end in 0.4 [`182dcd3`](https://github.com/http-party/node-http-proxy/commit/182dcd34555f361c1bb2b8d2777689e64ce32f87) +- [fix] Fix incorrect depth check. [`3ab02f3`](https://github.com/http-party/node-http-proxy/commit/3ab02f3ad7f2c59d73c621695eb238233c16d09c) +- [minor] Everybody loves Unicode [`38bd906`](https://github.com/http-party/node-http-proxy/commit/38bd906f2bc9322b156b92c47457bb7904f0d23a) +- [test minor] Update copyright notice on test runner [`2ccc5c7`](https://github.com/http-party/node-http-proxy/commit/2ccc5c73eaef30ab5a2af7e456bfcc270583c460) +- [minor] When running tests output only basename [`e109eba`](https://github.com/http-party/node-http-proxy/commit/e109eba9724494737021579938c1094c9dfbc8ee) +- [dist] Version bump. 0.8.0 [`5055689`](https://github.com/http-party/node-http-proxy/commit/5055689a11f3b990f848bf2699e0111d9e708d5f) +- Revert "[dist] Adjusted engines field to allow for 0.6; version bump 0.7.7" [`1e33434`](https://github.com/http-party/node-http-proxy/commit/1e33434fcc4772c233825b5aada7472113c0be50) +- changeOrigin option: set the host header to the proxy destination [`f27d26f`](https://github.com/http-party/node-http-proxy/commit/f27d26f4515c900ea4cf1756ef279257a189e308) +- [dist] Adjusted engines field to allow for 0.6; version bump 0.7.7 [`30dac89`](https://github.com/http-party/node-http-proxy/commit/30dac898f30a8508b4c4b4236e9438987f320167) +- [fix] In routing proxy, match line beginning [`63dfc7f`](https://github.com/http-party/node-http-proxy/commit/63dfc7f1757fc9a1a9bceeb3b035e97be6504692) +- [v0.6] Don't use `agent.appendMessage()` [`6655e01`](https://github.com/http-party/node-http-proxy/commit/6655e0164216449a97090651230266da8ced0150) +- bump version 0.7.4 [`3dfba2b`](https://github.com/http-party/node-http-proxy/commit/3dfba2ba4591e0fcd65ff0bfd012b3ab749a0a02) +- bump version 0.7.6 [`c5dc929`](https://github.com/http-party/node-http-proxy/commit/c5dc9295c711177c165bfb34c67407e1a5a0ed06) +- Revert "update outgoing.headers.host incase the destination does proxying" [`2061c71`](https://github.com/http-party/node-http-proxy/commit/2061c713664b044852fdf67aa5e173e5c3b6d874) +- update outgoing.headers.host incase the destination does proxying [`65b7872`](https://github.com/http-party/node-http-proxy/commit/65b7872e6ad433deae4de823c63629cb341bd649) +- bump version 0.7.5 [`b4d41c3`](https://github.com/http-party/node-http-proxy/commit/b4d41c3628ade82792eb361b095ab014a88d537a) +- [minor] Fix indent on timeout notice [`c4124da`](https://github.com/http-party/node-http-proxy/commit/c4124da4f25860497790fc06c97dde6e8985ab73) +- [minor] Change test runner output order [`b76680b`](https://github.com/http-party/node-http-proxy/commit/b76680b045f69e03759bc119f4827f337a8f395d) +- grammar correction [`729496d`](https://github.com/http-party/node-http-proxy/commit/729496d2898612969f5369e7f1c313cb4034f96c) +- [dist] Test runner depends on `async` [`219b0ff`](https://github.com/http-party/node-http-proxy/commit/219b0ff8f8780cde4714267273b0a1637c84679f) +- [test fix] Remove unnecessary console.log in tests/websocket/websocket-proxy-test.js [`f188f4f`](https://github.com/http-party/node-http-proxy/commit/f188f4ffd8c47b6312cd88c28de7e5ac63565047) +- [test refactor] `test/core/{run => run-single}` [`004be38`](https://github.com/http-party/node-http-proxy/commit/004be38048792d6f1d3efb361a5e7e66d5dbee8d) + +## [v0.7.3](https://github.com/http-party/node-http-proxy/compare/v0.7.2...v0.7.3) - 2011-10-03 + +### Commits + +- added what is necessary for having proxyError on Routing proxywq [`b7adf86`](https://github.com/http-party/node-http-proxy/commit/b7adf866b595f0d64a3ef6bde19271276450e723) +- [dist] Version bump. 0.7.3 [`db185bb`](https://github.com/http-party/node-http-proxy/commit/db185bb303ce9c413b2abccbc885f8ec43b61202) + +## [v0.7.2](https://github.com/http-party/node-http-proxy/compare/v0.7.1...v0.7.2) - 2011-09-30 + +### Merged + +- [fix] Examples have working require paths now. [`#118`](https://github.com/http-party/node-http-proxy/pull/118) + +### Commits + +- [fix] Fixed require paths in examples [`2e8d4c6`](https://github.com/http-party/node-http-proxy/commit/2e8d4c6e49e2e9b27443c0b9ae2b96331715402b) +- [websockets] add latest websockets support [`45ef87e`](https://github.com/http-party/node-http-proxy/commit/45ef87e71bc9cccefe5fb6afc3121fb09b8efbc3) +- [dist] Version bump. 0.7.2 [`ccccc45`](https://github.com/http-party/node-http-proxy/commit/ccccc45f11fbe535017b1806fad43578f143649d) + +## [v0.7.1](https://github.com/http-party/node-http-proxy/compare/v0.7.0...v0.7.1) - 2011-09-21 + +### Merged + +- Readme fixes [`#114`](https://github.com/http-party/node-http-proxy/pull/114) +- #107: Set x-forwarded-for header (amongst others) [`#110`](https://github.com/http-party/node-http-proxy/pull/110) +- command line tool - make sure targetPort is an integer [`#109`](https://github.com/http-party/node-http-proxy/pull/109) + +### Fixed + +- [dist] Version bump v0.7.1, closes #107 #112 [`#107`](https://github.com/http-party/node-http-proxy/issues/107) + +### Commits + +- [test] Added a test for the "x-forwarded-for" header [`66e9820`](https://github.com/http-party/node-http-proxy/commit/66e982060c6c41ad7dfadce1403c8e13d267781a) +- [docs] Updated examples in README.md for 0.7.x API. [`24ef919`](https://github.com/http-party/node-http-proxy/commit/24ef9194953c27fb11a8f1ceb499e5feca11c30c) +- [examples] Updated examples to v0.7.x API. [`8fc8d96`](https://github.com/http-party/node-http-proxy/commit/8fc8d966c4681d514af00516b348105608e13382) +- [examples] More fixes to examples. [`549360a`](https://github.com/http-party/node-http-proxy/commit/549360a462c134cc2b02301070209084ec94c393) +- [fix] x-forwarded http headers should set properly. [`2677bb6`](https://github.com/http-party/node-http-proxy/commit/2677bb6c44244ea0b584db744955bedf7aee2c62) +- [fix] connection.socket -> socket for source of x-forwarded-for data [`1f33943`](https://github.com/http-party/node-http-proxy/commit/1f33943b231cdf2cb619977801c7b0d4e98ab6df) +- Make sure the target port is an integer [`5ba25aa`](https://github.com/http-party/node-http-proxy/commit/5ba25aa3451f131b6c6c8892848a4f236f5b859e) + +## [v0.7.0](https://github.com/http-party/node-http-proxy/compare/v0.6.6...v0.7.0) - 2011-09-10 + +### Fixed + +- [fix] Add `x-forward-*` headers for WebSocket requests. Closes #74 [`#74`](https://github.com/http-party/node-http-proxy/issues/74) +- [doc] Document `setMaxSockets`. Fixes #81 [`#81`](https://github.com/http-party/node-http-proxy/issues/81) + +### Commits + +- [api test dist] Stubbed out the API for the higher-level `RoutingProxy` object to be exposed by `node-http-proxy` [`5927ecd`](https://github.com/http-party/node-http-proxy/commit/5927ecd62a082269c3b6a0ae4f5b4a673784bcdb) +- [api] Finalized the RoutingProxy API [`f765f90`](https://github.com/http-party/node-http-proxy/commit/f765f90ec37defaa2b493f859a982add51e25b76) +- [minor] Move private methods to the bottom of file(s) [`ec03d72`](https://github.com/http-party/node-http-proxy/commit/ec03d72c5d8749aee835f571869f69816be02265) +- [test] Updated tests to reflect finalized API of the RoutingProxy [`734769f`](https://github.com/http-party/node-http-proxy/commit/734769fa9b2c3054d45e33c3e552af80ce3f4740) +- [api doc] Rebuilt httpProxy.createServer() with the newer high-level RoutingProxy API [`598fe2e`](https://github.com/http-party/node-http-proxy/commit/598fe2e38def56518a1f0a8196b2fcb7f1bc569e) +- [minor] Remove commented out debug statements. [`5575bcf`](https://github.com/http-party/node-http-proxy/commit/5575bcf60c87def74d1755b2e5cc73e085dbf8c3) +- [doc] Updated examples [`13eaec5`](https://github.com/http-party/node-http-proxy/commit/13eaec55dc50e2aae164cb8adaa0f1a3c5a66c68) +- Add flow control [`6a7fd14`](https://github.com/http-party/node-http-proxy/commit/6a7fd14bfa9f25694d75cf490e32817ff15a94fe) +- Add flow control [`2b9e09b`](https://github.com/http-party/node-http-proxy/commit/2b9e09b00ac40e6c6de2b68754df7b8e8c1e3878) +- Emit drain if it doesn't happen on its own in 100ms [`37e2541`](https://github.com/http-party/node-http-proxy/commit/37e25418916a31e4a513ee5866d6013858d579cf) +- resume() can throw [`558a8a4`](https://github.com/http-party/node-http-proxy/commit/558a8a4f79716496dbdee13759c8641606458c05) +- [fix] Memory leak hunting. [`ca1d12c`](https://github.com/http-party/node-http-proxy/commit/ca1d12cf1bbfbe98b5159f9c02e2f6c818a1c749) +- Emit drain if it doesn't happen on its own in 100ms [`84be9f2`](https://github.com/http-party/node-http-proxy/commit/84be9f2c3a244c7dbfe2c6320fa26d85cf80ec31) +- resume() can throw [`0c71119`](https://github.com/http-party/node-http-proxy/commit/0c71119ee58ee84068120be72308ecb28cb3e532) +- [dist] Update examples/package.json to conform to nodejitsu style guidelines [`2937229`](https://github.com/http-party/node-http-proxy/commit/29372298208135f571538cc29dcc05f41f79b01c) +- Fixed large DoS vector in the middleware implementation [`0e36912`](https://github.com/http-party/node-http-proxy/commit/0e36912906640fdb007e0492b75c3f6a7b580ec6) +- [api] Added new `close()` method which cleans up sockets from HttpProxy instances [`0eae2a9`](https://github.com/http-party/node-http-proxy/commit/0eae2a913a2173d85478f8c9deec929388284ee2) +- Fixed large DoS vector in the middleware implementation [`07c8d2e`](https://github.com/http-party/node-http-proxy/commit/07c8d2ee6017264c3d4deac9f42ca264a3740b48) +- [minor] More contextual errors when middleware(s) error [`38315f6`](https://github.com/http-party/node-http-proxy/commit/38315f6b1f7b01bc6e55587878a57590135945c0) +- [dist] Update scripts in package.json [`6e1ade0`](https://github.com/http-party/node-http-proxy/commit/6e1ade0bb8174b744abb58df72b098bd96134ca4) +- [dist] Version bump. 0.7.0 [`0182ba3`](https://github.com/http-party/node-http-proxy/commit/0182ba37cd4c618cd50947ea2addef823349e49f) +- [merge] Merge from significant internal refactor in v0.7.x. No external API changes [`f7010e5`](https://github.com/http-party/node-http-proxy/commit/f7010e5169ac23114b9b35da272e9a041743fbb9) +- [minor] Small update to bin/node-http-proxy [`2cd8256`](https://github.com/http-party/node-http-proxy/commit/2cd8256c4d6089409f603655ea3b3a5ccf1fb065) +- [dist] Update .gitignore [`6c1c554`](https://github.com/http-party/node-http-proxy/commit/6c1c5544515bf17f0e6ed3588e16ae1a75f8a25b) +- [doc] Update README.md [`0ba5023`](https://github.com/http-party/node-http-proxy/commit/0ba5023e82fe8a08ed55194644d147c323368f41) +- [doc] Drop version number from README.md. [`bdf48be`](https://github.com/http-party/node-http-proxy/commit/bdf48bea36eae441c775e9321ab6e17db470bf27) +- [dist] Version bump. 0.7.0 [`00e34a1`](https://github.com/http-party/node-http-proxy/commit/00e34a10bd9ffca9e636b2e5aebb4f18ff6765ec) +- [test] Whitespace fix [`3a4d312`](https://github.com/http-party/node-http-proxy/commit/3a4d312eda08e7a5cecb3c82b04023e22f368e2b) +- [dist] Reorganize examples based on classification(s): http, websocket, or middleware [`81d6c31`](https://github.com/http-party/node-http-proxy/commit/81d6c318758231f77a52fab7de174fcc63b7a243) + +## [v0.6.6](https://github.com/http-party/node-http-proxy/compare/v0.6.5...v0.6.6) - 2011-08-31 + +### Commits + +- Memory leak hunting. [`f4fcf93`](https://github.com/http-party/node-http-proxy/commit/f4fcf934030e84c15cceca620e974aafc35f1691) +- [fix] Add guards to every throw-able res.end call [`e1c41d0`](https://github.com/http-party/node-http-proxy/commit/e1c41d06942b56f6cd65a079ae78b54456a8bbe1) +- [fix] Only set `x-forward-*` headers if req.connection and req.connection.socket [`de4a6fe`](https://github.com/http-party/node-http-proxy/commit/de4a6fe8a5f78460b030e635e5f4a63312cd4a76) +- [dist] Version bump. 0.6.6 [`967884c`](https://github.com/http-party/node-http-proxy/commit/967884c5de311f21b8405a5030730ef8db912531) + +## [v0.6.5](https://github.com/http-party/node-http-proxy/compare/v0.6.4...v0.6.5) - 2011-08-29 + +### Commits + +- [fix] Use `req.connection` for all x-forward-* headers [`f6dc12a`](https://github.com/http-party/node-http-proxy/commit/f6dc12a971fdd892614b32d2a4fb2ff39ddc0e67) +- [dist] Version bump. 0.6.5 [`7beead5`](https://github.com/http-party/node-http-proxy/commit/7beead54654bdc7f9ab4ed0c17000118a3e7b4fc) + +## [v0.6.4](https://github.com/http-party/node-http-proxy/compare/v0.6.3...v0.6.4) - 2011-08-28 + +### Fixed + +- Fix #95 Don't look on req.connection if it's not set. [`#95`](https://github.com/http-party/node-http-proxy/issues/95) + +### Commits + +- [api breaking] Begin refactor to optimize node-http-proxy by managing one instance of HttpProxy per `host:port` location [`d2b0e43`](https://github.com/http-party/node-http-proxy/commit/d2b0e4399e8026d3e2ece78ac8fdb1def6649950) +- [api test] Updated httpProxy.createServer() for new API exposed by simplified HttpProxy object. [`be4562d`](https://github.com/http-party/node-http-proxy/commit/be4562da9fafef8b26856f7f73f6c5a2c4e389b0) +- [test fix] A few minor fixes to ensure basic WebSocket tests are working. Better scope tests by supported protocol [`daf9231`](https://github.com/http-party/node-http-proxy/commit/daf9231a66f10a25782d2227df1b1501099ac5d1) +- [test] Updates for readability [`db10c4a`](https://github.com/http-party/node-http-proxy/commit/db10c4af918c3e4bc448163f4b9e9b9267145d47) +- Add guards to every throw-able res.end call [`7bda25b`](https://github.com/http-party/node-http-proxy/commit/7bda25b1c60d082f0f2fd12fc61b45a33b74f13d) +- [minor] Dont use `.bind()` [`340be42`](https://github.com/http-party/node-http-proxy/commit/340be42797e87fcc11859a771200075e7fe0c5f1) +- [dist] Version bump. 0.6.4 [`216d46d`](https://github.com/http-party/node-http-proxy/commit/216d46dc81bda1aeb0feb1318e34f37bee38c8fb) + +## [v0.6.3](https://github.com/http-party/node-http-proxy/compare/v0.5.11...v0.6.3) - 2011-08-28 + +### Merged + +- This adds a flag to ProxyRequest to disable the setting of x-forwarded-[for|port|proto] [`#73`](https://github.com/http-party/node-http-proxy/pull/73) + +### Fixed + +- Merge branch 'patch-1' of https://github.com/KimSchneider/node-http-proxy [`#80`](https://github.com/http-party/node-http-proxy/issues/80) + +### Commits + +- [minor] Style updates and whitespace cleaning for consistency [`f0917a3`](https://github.com/http-party/node-http-proxy/commit/f0917a3f97e8df2d58252f14c15ec54369c969ae) +- [api] refactor out middlewares from examples. [`2cf4e0a`](https://github.com/http-party/node-http-proxy/commit/2cf4e0a9e6c78dfd093c098fc87100ae71bc9450) +- [docs] add middleware examples (first draft) [`020290a`](https://github.com/http-party/node-http-proxy/commit/020290a162146c4996831f4f13d71c1dc949f508) +- [fix] use routing table mhen proxying WebSockets. [`efa17ef`](https://github.com/http-party/node-http-proxy/commit/efa17ef6cf614b763fc3b76570a24e750e2ddd31) +- Tested & fixed url middleware example, added comments. [`4cc18f4`](https://github.com/http-party/node-http-proxy/commit/4cc18f4217739b0bd1b3ac88287cc8a23d486b6b) +- [minor] add middleware to node-http-proxy [`b54666f`](https://github.com/http-party/node-http-proxy/commit/b54666ff69c574d842ce1349700c6b6248484d24) +- [minor] add middleware to node-http-proxy [`c773eed`](https://github.com/http-party/node-http-proxy/commit/c773eedeb6d0b22e2b41ab9215cfdc064a8095e3) +- [minor] add url-proxying middleware example [`45f3df8`](https://github.com/http-party/node-http-proxy/commit/45f3df80937ffd5854727c91ea6b0e09cf77e160) +- [fix] Removed bad example. [`2626308`](https://github.com/http-party/node-http-proxy/commit/2626308cd845982c82a284b0d0bc064090aaf116) +- [minor] add example to test concurrency [`6ec8d6c`](https://github.com/http-party/node-http-proxy/commit/6ec8d6caace3797841c0447feb081aa7920aa0dd) +- [minor] add example of using middleware to gzip response [`d3c0697`](https://github.com/http-party/node-http-proxy/commit/d3c06973a1bf1f1c54ca55a5d7f93b77133ef9a2) +- support old (port,host) and (options) style when using middlewares [`7976de1`](https://github.com/http-party/node-http-proxy/commit/7976de1121a40f963e18ea0a4673d185f847df4c) +- [minor] Added body decoder middleware example. Needs fixing. [`8eaec35`](https://github.com/http-party/node-http-proxy/commit/8eaec3507456731c1138c0b8ebb4e51dedc7c300) +- [minor dist] Use `pkginfo`. Minor updates to variable scoping in `.createServer()` [`5d0bbb3`](https://github.com/http-party/node-http-proxy/commit/5d0bbb38c3af14907567e2dc7c4f84a915b60ce5) +- [doc] add comments to examples/url-middleware.js [`f6484de`](https://github.com/http-party/node-http-proxy/commit/f6484de4112463c74105db82d27f131d64478f1d) +- Handle cases where res.write throws [`be3a0d8`](https://github.com/http-party/node-http-proxy/commit/be3a0d84a1e75b45bc1fc63fe63cdabd9844eb59) +- [minor] code style changes [`8b48b7e`](https://github.com/http-party/node-http-proxy/commit/8b48b7e0af656fdbd6da2b16ec6365beec47c302) +- [doc] note in readme about middleware [`b5d5eaa`](https://github.com/http-party/node-http-proxy/commit/b5d5eaababa276f7d197e4b6a8a771b364b73139) +- Allow forwarding for x-forwarded-[for|port|proto] to enabled layering of http-proxies. [`404818b`](https://github.com/http-party/node-http-proxy/commit/404818b1dce9e77a917ce9f0c187772eb8c18042) +- [style] tidy [`0f8fe8e`](https://github.com/http-party/node-http-proxy/commit/0f8fe8e2460fd27edfba44989b78aa6b8c9a38e2) +- [fix] do not use middleware code if it's not needed [`2012588`](https://github.com/http-party/node-http-proxy/commit/20125889b362c61c85924810de446e1e7b18d079) +- [minor] minor fixes to gzip middleware example [`caa1f49`](https://github.com/http-party/node-http-proxy/commit/caa1f494ab4effabad6d08272c3606c1d82005ea) +- [minor] default enableXForwarded to true [`e3d95ec`](https://github.com/http-party/node-http-proxy/commit/e3d95ecab24700535184df32f3a97e8699099b7f) +- Updating to enableXForwarded [`ee3506a`](https://github.com/http-party/node-http-proxy/commit/ee3506a8e7262f780eeada331898d42ca0e9838a) +- [api] Expose adapted version of `stack` so it can be used with HttpProxy instances not created by `httpProxy.createServer()` [`5d6e6b9`](https://github.com/http-party/node-http-proxy/commit/5d6e6b9f78eb98b28db01490a36b23c1aade133f) +- The number of maxSockets has to be set after the agent is created. Setting the property in the constructor does not work. [`2caa5d2`](https://github.com/http-party/node-http-proxy/commit/2caa5d2b0d55898c133a0bf3a0048ee969efb121) +- [fix] Dont use res.* in proxyWebSocketRequest [`f7452bc`](https://github.com/http-party/node-http-proxy/commit/f7452bc42d963406f7ee19dfa353d72ce3252dd6) +- [fix] fix syntax errors. close issue #86 [`b8f8499`](https://github.com/http-party/node-http-proxy/commit/b8f84994b0515e12c9d87f89f81a8601be47a6ff) +- [api] merge middleware branch [`e6ff8d6`](https://github.com/http-party/node-http-proxy/commit/e6ff8d6597a977baf0caf4f69c75bfa93d7281f3) +- [dist] Version bump. 0.6.3 [`1389b70`](https://github.com/http-party/node-http-proxy/commit/1389b706b5c1d857c571c2947b7c758b5cc70ca3) +- merged [`5ba0f89`](https://github.com/http-party/node-http-proxy/commit/5ba0f89aa356b2e76f5cf64c16e8578d71c45d8a) +- [fix] handler variable in createServer was global (!) [`25c06a3`](https://github.com/http-party/node-http-proxy/commit/25c06a3a952068de6a24c643cb0c872f7b9a0846) +- [dist] bump version 6.0 [`03475a5`](https://github.com/http-party/node-http-proxy/commit/03475a59445a1c1c1029d0673aafabe63af1e711) +- [dist] bump version 0.6.2 [`d8068a8`](https://github.com/http-party/node-http-proxy/commit/d8068a832d437790ce8680b9b34a9f171d75786c) +- [dist] bump version 5.12 [`5d33ad7`](https://github.com/http-party/node-http-proxy/commit/5d33ad711895b2afcbd6dd5e1c0449cee1ceae7b) +- [dist] bump version 0.6.1 [`fea371d`](https://github.com/http-party/node-http-proxy/commit/fea371dc0a47dfb4f84427e5740e8756f4e5b285) +- [fix] broken RegExp [`549bfea`](https://github.com/http-party/node-http-proxy/commit/549bfeac233888ec84edeec350ed5a7377f3773e) +- [doc] add note on middleware to Using node-http-proxy section of the README [`5bf2d59`](https://github.com/http-party/node-http-proxy/commit/5bf2d59241a7695f43bb89e5cb41ade2ab7a0ad2) + +## [v0.5.11](https://github.com/http-party/node-http-proxy/compare/v0.5.10...v0.5.11) - 2011-06-26 + +### Fixed + +- [api] Simplify the usage for the `.changeHeaders` option. Fixes #34 [`#34`](https://github.com/http-party/node-http-proxy/issues/34) + +### Commits + +- [api doc test] node-http-proxy now emits `websocket:*` on important WebSocket events. Added tests for these features and updated some code docs [`4f85ca0`](https://github.com/http-party/node-http-proxy/commit/4f85ca04e425a7d4df1e46c9cadd6026eeed32f6) +- [doc] Updated docco docs [`f0649d8`](https://github.com/http-party/node-http-proxy/commit/f0649d8d6a9f84ac61d5f173c585fa4307ffb3c3) +- [doc] Added examples/latent-websocket-proxy.js [`fcfe846`](https://github.com/http-party/node-http-proxy/commit/fcfe84626fff15be21ac83ccd69b96bf3ca1f7a2) +- [doc] Added sample for custom error messages using the `proxyError` event [`4cdbf0e`](https://github.com/http-party/node-http-proxy/commit/4cdbf0e8729a0665904b577376240c00e56ad876) +- [doc] Add examples/standalone-websocket-proxy.js [`1ee8ae7`](https://github.com/http-party/node-http-proxy/commit/1ee8ae710497e239716f72d45e2f61ead3995dc3) +- [dist] Version bump. 0.5.11 [`baf0b9e`](https://github.com/http-party/node-http-proxy/commit/baf0b9e25af53e2738812ff78614cc12966e99e3) +- [doc] Small update to code docs [`9d9509f`](https://github.com/http-party/node-http-proxy/commit/9d9509f791c4c566629c2e323259885f1c3db7ed) +- [minor] Add missing space [`b608a02`](https://github.com/http-party/node-http-proxy/commit/b608a029f8aa26f1a74a917e0bec0ac37e4615a0) + +## [v0.5.10](https://github.com/http-party/node-http-proxy/compare/v0.5.9...v0.5.10) - 2011-06-13 + +### Commits + +- [refactor] Manage our own internal list of Agent instances [`887c580`](https://github.com/http-party/node-http-proxy/commit/887c5808c90b7128c040e510e237ddb4d034fe3e) +- [doc] Update docco docs for 0.5.9 [`b4ac4d4`](https://github.com/http-party/node-http-proxy/commit/b4ac4d441fe4fb84d463bd889a5ce8d7f4d596ca) +- [test] Update tests to use `localhost` [`a1cdf00`](https://github.com/http-party/node-http-proxy/commit/a1cdf005b98c422c777c88a7d7baf2eeb91f732d) +- [dist] Version bump. 0.5.10 [`7b574d3`](https://github.com/http-party/node-http-proxy/commit/7b574d3d3e52b09a6445c011b8f2ae0d78282111) +- [doc] Bump version in README.md [`653c6ca`](https://github.com/http-party/node-http-proxy/commit/653c6ca1af607623b653d3148b1bb45a304aab87) + +## [v0.5.9](https://github.com/http-party/node-http-proxy/compare/v0.5.8...v0.5.9) - 2011-05-23 + +### Commits + +- [fix] Change sec-websocket-location header when proxying WSS --> WS. Added test coverage for this scenario [`028d204`](https://github.com/http-party/node-http-proxy/commit/028d2044e71d70b7bc21d339de29e2275c3be5c2) +- [dist] Version bump. 0.5.9 [`57ca62c`](https://github.com/http-party/node-http-proxy/commit/57ca62c878c9a953f2344719556e05492ece3435) + +## [v0.5.8](https://github.com/http-party/node-http-proxy/compare/v0.5.7...v0.5.8) - 2011-05-21 + +### Commits + +- [doc] Regenerate docco docs [`c5fd368`](https://github.com/http-party/node-http-proxy/commit/c5fd368a8d803b6ab47e32e744a6fd6a6ca5361f) +- [doc] Update docco docs [`74120d8`](https://github.com/http-party/node-http-proxy/commit/74120d8988627bb0686d3a26cb8ec1408cc41287) +- [doc] Update to v0.5.7 in code and README.md [`6fd272a`](https://github.com/http-party/node-http-proxy/commit/6fd272ac18240811d8a8a39c85ee483557c414b3) +- [dist] Version bump. 0.5.8. Forwards compatible with new versions of nodejs [`76ecb51`](https://github.com/http-party/node-http-proxy/commit/76ecb51e7b41a23288f922c9c5df3ce40f67bf80) +- [fix] Dont force `Connection: close` now that Keep-Alive is supported [`a86d18b`](https://github.com/http-party/node-http-proxy/commit/a86d18bc7f93d013df715d1f4d88e651846f645d) +- [test] Update to vows description for web-socket-proxy-test.js [`a865fe6`](https://github.com/http-party/node-http-proxy/commit/a865fe662ff04a4badcc90ce2af80d2380c40a85) + +## [v0.5.7](https://github.com/http-party/node-http-proxy/compare/v0.5.6...v0.5.7) - 2011-05-19 + +### Commits + +- [api] Add `x-forwarded-proto` and `x-forwarded-port` to proxied HTTP requests [`421895f`](https://github.com/http-party/node-http-proxy/commit/421895fa308d49628bbbb546d542efa96769c3f4) +- [dist] Version bump. v0.5.7. Only good on node v0.4.7. See issue #48. [`0911c17`](https://github.com/http-party/node-http-proxy/commit/0911c1719e641c6e4342027e8d5d82c47c6f310e) +- [fix] Set `x-forwarded-for` from req.connection.socket.remoteAddress if req.connection.remoteAddress is not defined [`e9b3ec9`](https://github.com/http-party/node-http-proxy/commit/e9b3ec9b1d0ebf427e138176b28af44f0f973670) + +## [v0.5.6](https://github.com/http-party/node-http-proxy/compare/v0.5.5...v0.5.6) - 2011-05-19 + +### Commits + +- [fix doc] Add `error` handler to reverseProxy request when proxying WebSockets to prevent unhandled ParseError. Rename some variables in proxyWebSocketRequest to make the code more readable [`76580c2`](https://github.com/http-party/node-http-proxy/commit/76580c292a152c0007352a9d383f59e48993cd03) +- [doc] Regenerate docco docs [`bd45216`](https://github.com/http-party/node-http-proxy/commit/bd45216bc9207e5016f394a4bfee2bdffcc669c7) +- [api minor] Small refactor to emit `webSocketProxyError` from a single helper function on any of the various `error` events in the proxy chain [`5d2192e`](https://github.com/http-party/node-http-proxy/commit/5d2192e654f23e1b76e0b66554debe1590a3af64) +- [api] Manual merge of #46: add custom `proxyError` event and enable production error handling. [`652cca3`](https://github.com/http-party/node-http-proxy/commit/652cca37ea321ec9d1d55125217df0214c8090b6) +- [dist] Version bump. v0.5.6 Only good on node v0.4.7. See issue #48. [`f1c0f64`](https://github.com/http-party/node-http-proxy/commit/f1c0f641aa14dc3c267de37370a7369c3131c636) + +## [v0.5.5](https://github.com/http-party/node-http-proxy/compare/v0.5.4...v0.5.5) - 2011-05-19 + +### Commits + +- [fix] Change variable references for Websockets, bugs found from using wsbench [`7bf0cae`](https://github.com/http-party/node-http-proxy/commit/7bf0caef9fae86a34719f04f7b9926095fb6a146) +- [dist] Version bump. 0.5.5. Only good on node v0.4.7. See issue #48. [`acacc05`](https://github.com/http-party/node-http-proxy/commit/acacc0561f2efabc0a7859b9a410e954f2dca6fd) + +## [v0.5.4](https://github.com/http-party/node-http-proxy/compare/v0.5.3...v0.5.4) - 2011-05-19 + +### Commits + +- [doc] Update docco docs [`faf2618`](https://github.com/http-party/node-http-proxy/commit/faf2618cf3b53a972779514842bc4264ec9541fa) +- [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabilities [`abc01bc`](https://github.com/http-party/node-http-proxy/commit/abc01bce293f7c1a88f9be08b0540407d2b0f4a1) +- [doc test api] Improve node-http-proxy API to allow for HTTPS to HTTP proxying scenarios. Update tests accordingly. [`895f577`](https://github.com/http-party/node-http-proxy/commit/895f577744e3cbcbb5f479c4aacec5323bb001f7) +- [doc] Update examples for HTTPS to HTTP proxying [`91737fa`](https://github.com/http-party/node-http-proxy/commit/91737fadb640f30d3cd959f29069537473207efd) +- [dist] Version bump. 0.5.4. Only good on node v0.4.7. See issue #48. [`c04eec1`](https://github.com/http-party/node-http-proxy/commit/c04eec1c370ca0eb212c96c0896c27b349f7ea97) +- [minor] Update README.md to conform to Github flavored markdown [`32a15dd`](https://github.com/http-party/node-http-proxy/commit/32a15dd79d860343453c38a7eef8339d7b99718b) +- [minor] Update README.md to conform to Github flavored markdown [`521fe27`](https://github.com/http-party/node-http-proxy/commit/521fe271853632563143fb4b76c032f7afa7831a) + +## [v0.5.3](https://github.com/http-party/node-http-proxy/compare/v0.5.2...v0.5.3) - 2011-05-18 + +### Commits + +- [test] Continued work around Origin mismatch tests [`44a8566`](https://github.com/http-party/node-http-proxy/commit/44a85664a80fd67e20bbc36d280816dbd1a796c5) +- [doc] Regenerate docco docs [`9e36d2d`](https://github.com/http-party/node-http-proxy/commit/9e36d2d2e619be322bb73092db2a9d72ef6709e8) +- [fix test api] Only change Origin headers in WebSocket requests when the `changeOrigin` option is set explicitly. Added tests to ensure Origin and sec-websocket-origin headers match when proxying websockets. [`9c6c4b9`](https://github.com/http-party/node-http-proxy/commit/9c6c4b908b7d6ce67144ba9d41702b5694254099) +- [test] Improve websocket tests to inspect outgoing and incoming HTTP headers to test origin mismatch bugs [`6e679c8`](https://github.com/http-party/node-http-proxy/commit/6e679c8019e1eb62b2b1da48628f89b8046203fd) +- [test] Refined tests to begin checking Origin == Sec-Websocket-Origin [`9ab54ab`](https://github.com/http-party/node-http-proxy/commit/9ab54ab47fc43d98f3182da9c41487f524933783) +- [doc minor] Update docs and code docs for v0.5.3 release [`03b9087`](https://github.com/http-party/node-http-proxy/commit/03b908744612faed82d9233f3b6d4af70368cf3c) +- [dist] Version bump. v0.5.3. Only good on node v0.4.7. See issue #48. [`d9fa261`](https://github.com/http-party/node-http-proxy/commit/d9fa261cdc97aee71279064e536a4a22edbe3b5b) + +## [v0.5.2](https://github.com/http-party/node-http-proxy/compare/v0.5.1...v0.5.2) - 2011-05-17 + +### Merged + +- Readme: fix syntax error, reformat code blocks [`#52`](https://github.com/http-party/node-http-proxy/pull/52) + +### Commits + +- format markdown for syntax highlighting on GitHub [`28f6dc1`](https://github.com/http-party/node-http-proxy/commit/28f6dc153a7d9fa9b6a08637c90765cf3a07fd3e) +- [doc] Regenerate docco docs [`a5e1e3e`](https://github.com/http-party/node-http-proxy/commit/a5e1e3e70d02f32ab86b711ec4b262df5955a1a9) +- [test] Fix tests in https mode [`1ee6bef`](https://github.com/http-party/node-http-proxy/commit/1ee6beff6aa3087e332701fd3cfda70b4e968ce8) +- [fix] Manage bookkeeping for incoming requests to the underlying sockets behind reverse proxied websocket events. Only use the appropriate variables in the closure scope of the `upgrade` event from this bookkeeping [`85223ea`](https://github.com/http-party/node-http-proxy/commit/85223ea0800ad63ea82783c9dc2dc4a0e3345ae8) +- [minor] Fix syntax in examples/ [`ff82946`](https://github.com/http-party/node-http-proxy/commit/ff829467d33d326c588861a46acc2bf9adbdddd2) +- add spacing around code blocks to fix README rendering [`ab8c264`](https://github.com/http-party/node-http-proxy/commit/ab8c264e6d729de81c93982f97875006e52240f0) +- [dist] Use devDependencies in package.json [`e6c52d4`](https://github.com/http-party/node-http-proxy/commit/e6c52d431f8a32e11cd347fbabeb7a03d0d40790) +- don't highlight non-javascript as javascript [`d5b9ba7`](https://github.com/http-party/node-http-proxy/commit/d5b9ba7180376b8a67b9cbfebe9acf7399cab3ed) +- fix syntax error in README example [`332d2d7`](https://github.com/http-party/node-http-proxy/commit/332d2d780ab62ccc996157dacd2498c568816ffc) +- [minor] Ignore npm modules and debug logs [`e90cbd6`](https://github.com/http-party/node-http-proxy/commit/e90cbd6f148633ef7d3e2de06aaabe1cc493cc37) +- [dist] Include docco module as a dev dependency [`d08c2bb`](https://github.com/http-party/node-http-proxy/commit/d08c2bb525ec661c0c8e6539e28605972b1ae9b8) +- [dist] Version bump. 0.5.2. Only good on node v0.4.7. See issue #48. [`360e79a`](https://github.com/http-party/node-http-proxy/commit/360e79a005d298f40f36ee0e25c34fe534311b09) + +## [v0.5.1](https://github.com/http-party/node-http-proxy/compare/v0.5.0...v0.5.1) - 2011-05-10 + +### Commits + +- [dist] Version bump. 0.5.1. Only good on node v0.4.7. See issue #48. [`6c80177`](https://github.com/http-party/node-http-proxy/commit/6c8017734053bc683f32a2b9f0ba18ba0c014855) +- Revert "Fixed "Invalid argument to getAgent" when proxying HTTP" [`40dc9de`](https://github.com/http-party/node-http-proxy/commit/40dc9dee2d1e617af7f85a056d281b4f220f2802) +- [fix] Fix typo in bin/node-http-proxy [`57127a3`](https://github.com/http-party/node-http-proxy/commit/57127a367193bcf12be2b367e1e01cbc57d685fe) +- Merged pull request #39 from timmattison/master. [`ac425d7`](https://github.com/http-party/node-http-proxy/commit/ac425d70ef63b847fe6eb17dbfc4b084d0dd2d20) +- Fixed "Invalid argument to getAgent" when proxying HTTP [`642e158`](https://github.com/http-party/node-http-proxy/commit/642e15805dbd572835bb4fee9527e4f2da658833) + +## [v0.5.0](https://github.com/http-party/node-http-proxy/compare/v0.4.2...v0.5.0) - 2011-04-17 + +### Commits + +- [doc] Breakout demo.js into files in example/. Add web-socket-proxy.js example [`6e4bf6a`](https://github.com/http-party/node-http-proxy/commit/6e4bf6a9cbc400fcd2be420649ce08936417dd83) +- [api test doc] Improve HTTPS support. Update minor documentation. Change tests accordingly. [`bf68dc3`](https://github.com/http-party/node-http-proxy/commit/bf68dc30a5c508bc8f533f52c083206b87963811) +- [api] Update WebSocket support to use http.Agent APIs [`b0b0183`](https://github.com/http-party/node-http-proxy/commit/b0b0183c2b54fa63bd2a6f9c92475c7f56d811a3) +- [api] Update `.proxyRequest()` and `.proxyWebSocketRequest()` APIs to take an options hash instead of a set of arguments. Add HTTPS support. [`cfddd12`](https://github.com/http-party/node-http-proxy/commit/cfddd12e821bd6b07ff2dbf0aa543ddfc3664dca) +- [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/node-http-proxy to read files specified in `config.https` [`212009d`](https://github.com/http-party/node-http-proxy/commit/212009df6b08de3c0c97a4e9ec43f60f6bf49ea6) +- [test] Add WebSocket tests [`4d18ac1`](https://github.com/http-party/node-http-proxy/commit/4d18ac1ae611f84e5e0cc599234124d183d81ffd) +- [doc] Regenerate docco docs [`c485c87`](https://github.com/http-party/node-http-proxy/commit/c485c8742c86b504823020d2cf6c1342a1bcce48) +- [doc test] Small updates to README.md. Update to try require socket.io [`12064d8`](https://github.com/http-party/node-http-proxy/commit/12064d8e5debf674cd5d367e563b699f10a4325e) +- [api] Remove winston logging in favor of custom events [`a89b397`](https://github.com/http-party/node-http-proxy/commit/a89b3976b25516db9b601c0327948f3d90fab006) +- [doc] Update README.md [`bd6a262`](https://github.com/http-party/node-http-proxy/commit/bd6a2622ad67b8c7ec15868037a48048207ce0df) +- [dist] Version bump. v0.5.0 [`ddf31b2`](https://github.com/http-party/node-http-proxy/commit/ddf31b22ec71ef9dacca9c178ee26b6314d9fdf4) +- [api] Update `request` event to be consistent by emitting both `req` and `res`. Add `x-forwarded-for` header. [`a3cb527`](https://github.com/http-party/node-http-proxy/commit/a3cb527be5e42d5192400933bf32a361b8c707c4) +- [api] Emit `end` event when done proxying [`5681fc1`](https://github.com/http-party/node-http-proxy/commit/5681fc1a28ff06dfa91d9bf5512c688235cafac4) +- [minor] Small update to README.md [`40c51a7`](https://github.com/http-party/node-http-proxy/commit/40c51a703baaf050b35f60131d3e78b42e7b0858) +- [dist] Move pgriess' websocket client into vendor/* [`7cbf447`](https://github.com/http-party/node-http-proxy/commit/7cbf44732068dc788d31432553b3bdfcfb39f743) + +## [v0.4.2](https://github.com/http-party/node-http-proxy/compare/v0.4.1...v0.4.2) - 2011-04-13 + +### Commits + +- [dist] Version bump. 0.4.2. Remove `eyes` dependency. [`a5d88aa`](https://github.com/http-party/node-http-proxy/commit/a5d88aaacc209bdceaf0799e99ff82bdce1bdc10) + +## [v0.4.1](https://github.com/http-party/node-http-proxy/compare/v0.4.0...v0.4.1) - 2011-03-20 + +### Commits + +- [dist] Version bump. 0.4.1. Fix package.json [`0d1a3fe`](https://github.com/http-party/node-http-proxy/commit/0d1a3fe99511dda1ac949536a9eb4a045db39979) + +## [v0.4.0](https://github.com/http-party/node-http-proxy/compare/v0.3.1...v0.4.0) - 2011-03-20 + +### Commits + +- [api] Further work on refactor for node 0.4.0 [`e39a9f9`](https://github.com/http-party/node-http-proxy/commit/e39a9f93d2f9ab6ea769fad5e9dda25d022d8a1a) +- [doc] Added docco generated literate coding documentation [`3bc7d16`](https://github.com/http-party/node-http-proxy/commit/3bc7d16adc48ad1aa1161bb02bd0c27d4fb20639) +- [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly routing to ProxyTable, add more documentation, fix edge-cases until they can be further investigated in node.js core [`5715318`](https://github.com/http-party/node-http-proxy/commit/571531820e2233b0d2f7268a1d4db8510fcabf91) +- [api] First pass at removing pool and working with node v0.4.0 [`9faa924`](https://github.com/http-party/node-http-proxy/commit/9faa924a29544cfd84c28cb1c45489f495e3806a) +- [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update documentation and tests accordingly [`4110448`](https://github.com/http-party/node-http-proxy/commit/4110448046dd945afe3e092968d9382d573a369a) +- [doc] Added more documentation [`973f19f`](https://github.com/http-party/node-http-proxy/commit/973f19fd5a14e3bfad5f67e54710a4076a469fe0) +- [doc] Regenerate docco docs [`6c42f04`](https://github.com/http-party/node-http-proxy/commit/6c42f045241194061c3786ba5827aebf88070201) +- [api] Force connection header to be `close` until keep-alive is replemented [`3fd3c96`](https://github.com/http-party/node-http-proxy/commit/3fd3c96fa05fda45c7ef9ff44594644ac54f4a1e) +- [dist] Version bump. 0.4.0 [`cbb5fbc`](https://github.com/http-party/node-http-proxy/commit/cbb5fbccd0e65c51eba14e75ef44184714cc8971) +- [api test] All tests are passing when run as individual files [`389159d`](https://github.com/http-party/node-http-proxy/commit/389159da1b91ab60b8de3c379d84e76c703e6b59) +- [minor doc] Update demo and small fix to node-http-proxy [`d8c5406`](https://github.com/http-party/node-http-proxy/commit/d8c54063dc5961fa619f7c04fa2d225da9aa1439) +- [fix] Fixed cli parsing issue when --argument=value is not used [`34cba38`](https://github.com/http-party/node-http-proxy/commit/34cba38c297d6dcb845e95b9e1ce0271da1631d2) +- [test] Small update to proxy-table-test.js [`3588687`](https://github.com/http-party/node-http-proxy/commit/3588687874eb691fe59407a207d38efa418211d0) +- [minor] Expose version on module [`1dd9b3b`](https://github.com/http-party/node-http-proxy/commit/1dd9b3b15088a3c4595faae64822969014a61d52) +- [doc] Update to v0.3.1 in README.md [`8ef2e1f`](https://github.com/http-party/node-http-proxy/commit/8ef2e1fe33e0fca2b80c0d6474dba994e625f094) +- [dist] Change package.json for npm version bump [`0e7f362`](https://github.com/http-party/node-http-proxy/commit/0e7f3626718ecf108f3cafa814b0f4ffb3e6faa2) + +## [v0.3.1](https://github.com/http-party/node-http-proxy/compare/v0.3.0...v0.3.1) - 2010-11-22 + +### Commits + +- [api test doc] Updated tests. Added ProxyTable functionality [`bedc7a3`](https://github.com/http-party/node-http-proxy/commit/bedc7a3ae57d5ec07b372a550fa69772f9fbc19e) +- [test] Simplified tests. Added tests for experimental websocket support [`8c3e993`](https://github.com/http-party/node-http-proxy/commit/8c3e993833e2a09376fdb5e7c847ff00b53e70d8) +- [test doc api] Added forward proxy functionality with tests [`c06f4bf`](https://github.com/http-party/node-http-proxy/commit/c06f4bf7fe50f29677dc5a5aad596193fc893018) +- [dist minor] Removed vendored pool. Changed all references of sys to util [`8251296`](https://github.com/http-party/node-http-proxy/commit/8251296d7f5c472ec523316e905d678042b043d3) +- WebSocket proxy support, fixed 304 code halting [`7249ef3`](https://github.com/http-party/node-http-proxy/commit/7249ef3ee776c66acc95036dc76a2d08dc3f6350) +- [api] pseduo-vendor pool until pull request is finalized [`7c2eb5d`](https://github.com/http-party/node-http-proxy/commit/7c2eb5de3531f20ea92c99dd8ab207d26be9dce8) +- No-server fix [`f84880f`](https://github.com/http-party/node-http-proxy/commit/f84880fcd946e55585d8e901e5bc32933f629837) +- [api test bin doc] Added bin script and simple logging [`00014d6`](https://github.com/http-party/node-http-proxy/commit/00014d624c052e7404ce96c7e06769440c4eae2a) +- [debug] Removed pool as a dependency for stress test [`73381cf`](https://github.com/http-party/node-http-proxy/commit/73381cf71ae92b9ed1c2da5986aa7ca31a7cf2e8) +- 'end' event becomes 'close', added more try-catch handling [`cd78af5`](https://github.com/http-party/node-http-proxy/commit/cd78af5feaa67c5005df921a8d1a61575a58fca2) +- Added support of automatic websocket tunneling, added test for it [`56003b5`](https://github.com/http-party/node-http-proxy/commit/56003b527625b2d83a191f3172005c87856aa87d) +- [debug] Better debug messages to try to determine if pool is slowly losing clients to forever busy [`dd1918d`](https://github.com/http-party/node-http-proxy/commit/dd1918dc360dc0f9553c35c82f3f0f93ac3bfb46) +- [doc dist] Version bump. Added CHANGELOG.md [`de53d5e`](https://github.com/http-party/node-http-proxy/commit/de53d5eb2c3d671be0ad0e736a6435c3bf5f55f4) +- Moved error handling to response.on('end'), fixed error handling in websocket's part [`7e61f0c`](https://github.com/http-party/node-http-proxy/commit/7e61f0cf5725dedf37b956545639c2d6129855d3) +- [minor] Pushing hot-fix from Mikeal for vendored pool repo [`60791f3`](https://github.com/http-party/node-http-proxy/commit/60791f361f8a11f9d1bad2c6366bf0ce72b40f66) +- [api] Integrated commits from donnerjack and worked on pool changes [`3bb458e`](https://github.com/http-party/node-http-proxy/commit/3bb458e115037bc27691705d255b0d2e2504a9f1) +- [doc] Updated Copyright ... added Fedor [`9128a8c`](https://github.com/http-party/node-http-proxy/commit/9128a8c5a15d0f64a0bae946f3e741ea708bc56f) +- [minor] Listen to error event on pool so we dont fail out unexpectedly anymore [`711258e`](https://github.com/http-party/node-http-proxy/commit/711258ef469d064cc0dbe0f0320ed1047ed0bd54) +- adding more debugging messages [`5d54ea5`](https://github.com/http-party/node-http-proxy/commit/5d54ea58c93c26635e0de96871e824baffea34dd) +- adding some debug messages for live testing [`4069a7e`](https://github.com/http-party/node-http-proxy/commit/4069a7e98c22a48bae7fd57ad5f315d0e5006dfc) +- [minor] Listen to error events re-emitted by pool into the ClientRequest [`f8bff4c`](https://github.com/http-party/node-http-proxy/commit/f8bff4c618ab2a6b6185ac973cd0e21cea19c23a) +- [minor] Updated max clients for pool [`32aaf74`](https://github.com/http-party/node-http-proxy/commit/32aaf74e95f8a39d847b352ca984145e7abe89a6) +- [debug] Trying to repair pool busy client growth [`7b0ea85`](https://github.com/http-party/node-http-proxy/commit/7b0ea85e2ac58d5f711f64b855f746fb2423a276) +- [debug] Roll back last commit ... connection = close was ineffective [`266e524`](https://github.com/http-party/node-http-proxy/commit/266e5246eacb4877bb6ab557e6e6b9b8434ad612) + +## [v0.3.0](https://github.com/http-party/node-http-proxy/compare/v0.2.0...v0.3.0) - 2010-09-10 + +### Commits + +- [api] Revert to old 0.1.x codebase for bug testing and performance comparison [`66afb2a`](https://github.com/http-party/node-http-proxy/commit/66afb2a2a35a479512ce2601c89b82f13596fc9f) +- [api test dist doc] Updated for 0.3.0 release [`a9084b9`](https://github.com/http-party/node-http-proxy/commit/a9084b923afa66c3004abec4951ff02e031631da) +- [api] Object creation is cheap for HttpProxy, so lets take advantage [`9f0aeac`](https://github.com/http-party/node-http-proxy/commit/9f0aeacab1a632136f5905a0d03ad04be9f93f51) +- [doc] Update contributors for 0.3.0 [`6d47d98`](https://github.com/http-party/node-http-proxy/commit/6d47d98f5345b7f335c3b93f8e4a31dd90235dda) + +## [v0.2.0](https://github.com/http-party/node-http-proxy/compare/v0.1.5...v0.2.0) - 2010-09-07 + +### Commits + +- [dist] Version bump and update to README + LICENCE. Word to Mikeal for coming thru for 0.2.0 [`69c162d`](https://github.com/http-party/node-http-proxy/commit/69c162dc3da334b2ece0a19be5ea4c8da7e0fe87) +- [api dist] Merge of branch 0.2.0 [`fd61828`](https://github.com/http-party/node-http-proxy/commit/fd618289338ca2d7595f695c0b8531b40145bbca) +- [api] Completely refactored node-http-proxy with help from Mikeal [`1221939`](https://github.com/http-party/node-http-proxy/commit/1221939accf00467adb25f8908e991e984043c85) +- [api minor debug] Remove debug code, set Connection header if not set [`6d08f24`](https://github.com/http-party/node-http-proxy/commit/6d08f24c863e071eb4a0d3ede15656e5e7c27c4b) +- [debug] Added some debugging to figure out why AB wont complete a test with v0.2.0 [`9715ebd`](https://github.com/http-party/node-http-proxy/commit/9715ebd40bdbbe883eb383676d5b0df24968dd72) +- [api] Integrated a little more from Mikeal to make our return headers consistent [`eb39018`](https://github.com/http-party/node-http-proxy/commit/eb39018fd0b5751dd90fabce905997e52f2ffecd) +- [doc] Updated README.md [`f291efb`](https://github.com/http-party/node-http-proxy/commit/f291efbaa4360d6e7ff4004cc11f8df0d737c1d0) + +## v0.1.5 - 2010-09-02 + +### Commits + +- [api] More changes for createServer api [`5d94ae2`](https://github.com/http-party/node-http-proxy/commit/5d94ae27bc2d56d1f817b0cf1dfdb01dcc376393) +- added colors and asciimo [`d490b50`](https://github.com/http-party/node-http-proxy/commit/d490b50ada8c1024cb785335966b71d69fae3407) +- [api] First commit of http-proxy [`30b68c1`](https://github.com/http-party/node-http-proxy/commit/30b68c153270619119ec36615bb54ee7a2816ecc) +- updating demo [`c4b7c0d`](https://github.com/http-party/node-http-proxy/commit/c4b7c0d8a0cc5fd7f43257594bd0a71c7bd12a63) +- initial release v0.1.0, sure to have many updates coming. [`85f7372`](https://github.com/http-party/node-http-proxy/commit/85f73723415ec54539721777e77d5d10de383469) +- fleshing out demo [`994f748`](https://github.com/http-party/node-http-proxy/commit/994f7481ce07c15afa5ab993b79d920b8220be44) +- [docs] added benchmarks [`bbed176`](https://github.com/http-party/node-http-proxy/commit/bbed17640f84e56aaea06c6d4eb7d04952957fce) +- updated paths to use npm [`972c8c0`](https://github.com/http-party/node-http-proxy/commit/972c8c05274c72c7320291389f88b0694ac290ca) +- added spark demo [`d0ad931`](https://github.com/http-party/node-http-proxy/commit/d0ad93176d8430301a8a42f8c2b817674ce7ba32) +- [test] Updated tests to include support for latent requests [`095e86a`](https://github.com/http-party/node-http-proxy/commit/095e86aa653c1c8e07cd1403697e0e4b638b8294) +- started to flesh out simple demo based on tests [`2fb5ffb`](https://github.com/http-party/node-http-proxy/commit/2fb5ffba7765462e95badd0f7243e65395a3fd2e) +- added createServer but hated it, gonna remove [`b1eb13e`](https://github.com/http-party/node-http-proxy/commit/b1eb13eb70b67ea76f5ab720d566894677a53ca2) +- [test] Updated node-http-proxy tests [`2f265a2`](https://github.com/http-party/node-http-proxy/commit/2f265a23e4a10971495d0bd7b324b7ba786e5065) +- [api] Updated request hashes to use a unique identifier [`c887a75`](https://github.com/http-party/node-http-proxy/commit/c887a757623f5a3d7d1e0fafeb00b96731c89872) +- [api] Updated http-proxy to work with vows [`ead7567`](https://github.com/http-party/node-http-proxy/commit/ead7567db8099264a2001fd876cded84bc4f111f) +- [dist] Renamed node-proxy to node-http-proxy, updated package.json [`2f49810`](https://github.com/http-party/node-http-proxy/commit/2f49810ef86f49927991f32ae42605f1118b0c25) +- updating docs, almost there [`6e651f4`](https://github.com/http-party/node-http-proxy/commit/6e651f420f4d1e15dbbf823a8e3b311e9533c805) +- changed api to better reflect nodes api. updated demos, tests, docs [`bde98f4`](https://github.com/http-party/node-http-proxy/commit/bde98f489234fe22f49468011b7e342cd108603f) +- updating docs [`341bbd4`](https://github.com/http-party/node-http-proxy/commit/341bbd404f3fd81e65197b3830c3fa9e544bc1e7) +- fixed npm package, i think. bumped version 0.1.1 [`fca40da`](https://github.com/http-party/node-http-proxy/commit/fca40da694d8df17ed6140265e374c0ceabd1167) +- updated demo [`b622702`](https://github.com/http-party/node-http-proxy/commit/b62270210e7ad3c54fd6b2c86bde9f9942328a67) +- added readme [`d6a2f8a`](https://github.com/http-party/node-http-proxy/commit/d6a2f8aa7dae3f6721b9607a702c68b1ad7fc692) +- [api] Corrected chain of argument passing [`da55777`](https://github.com/http-party/node-http-proxy/commit/da55777a92d100a5ddb7a8267e56ba26bd8c2270) +- updated demo [`e9511ea`](https://github.com/http-party/node-http-proxy/commit/e9511eafdf9ada6a0ce6defb3c5f2299411633b1) +- [deploy] Added package.json [`dce80b9`](https://github.com/http-party/node-http-proxy/commit/dce80b9b4546064da1943e0e396e19b41390588a) +- updated readme [`76d0649`](https://github.com/http-party/node-http-proxy/commit/76d0649abcafd80509af922503c5544e646bcebb) +- update to docs and package.json [`d15bba4`](https://github.com/http-party/node-http-proxy/commit/d15bba4c1d2cbdaf0af27f3adcaa1db9b534d968) +- [minor] Removed eyes dependency [`eaeed83`](https://github.com/http-party/node-http-proxy/commit/eaeed8306d6dc6e1b30223cf6d59cda6d5bb76de) +- merge [`93505a4`](https://github.com/http-party/node-http-proxy/commit/93505a422c688b7f41fdaf304270c893ef4cf09a) +- fixed additional port / server mismatches for new api [`15c18b6`](https://github.com/http-party/node-http-proxy/commit/15c18b612d6cd5a1f3ae46b5590dda1fc586fb35) +- [doc] added nodejitsu.com link to ReadMe. http-proxy is used in our front facing load-balancers. look for bugs...try to improve benchmarks.... ^_^ [`6661753`](https://github.com/http-party/node-http-proxy/commit/6661753f07dcf4e5ae684df4d1709f3c238346c9) +- removed extra self, updated colors requirement, bumped to version 0.1.3 [`9bc5b6f`](https://github.com/http-party/node-http-proxy/commit/9bc5b6f8621fb2a37e84524c3e5b91aab9b45675) +- fixed pathing issue, bumped version 0.1.3 [`ede6490`](https://github.com/http-party/node-http-proxy/commit/ede649037e08b615a8995179f46bc701550354d6) +- updated docs [`07d96bb`](https://github.com/http-party/node-http-proxy/commit/07d96bb8887a7880a21a739e0a8f495698e7e79e) +- updated docs [`1594367`](https://github.com/http-party/node-http-proxy/commit/15943675edef490d9b8732345a750bc5ab1f5d7e) +- updated readme [`fb8c5ab`](https://github.com/http-party/node-http-proxy/commit/fb8c5abd3c2a722c1c18046dcf2fffea4fa7d050) +- updated docs [`17b6c69`](https://github.com/http-party/node-http-proxy/commit/17b6c6998544572300fc9d4faa63af1aee4c3d88) +- updated docs [`c8dd8c4`](https://github.com/http-party/node-http-proxy/commit/c8dd8c4e28e09f25c161980316b259d81d5a4e91) +- updated package.json again [`ddba155`](https://github.com/http-party/node-http-proxy/commit/ddba155377942259554842f37de98c508130fe11) +- initial release v0.1.0, sure to have many updates coming. [`6a1baa2`](https://github.com/http-party/node-http-proxy/commit/6a1baa25ccf9fc3a3fc4d1a4764c968993e48cab) +- bumped to version 0.1.5 [`b195a16`](https://github.com/http-party/node-http-proxy/commit/b195a16406534912161671448a53d6633a1f2458) +- updated readme [`9aa2216`](https://github.com/http-party/node-http-proxy/commit/9aa22162f139ab2fa6df6b11e2a96336ee1d2612) +- added spark demo [`d408e39`](https://github.com/http-party/node-http-proxy/commit/d408e39ed6dbd44709d0164a95ad9bc67f76ba13) +- bumped to version 0.1.4. improved on api [`82b8228`](https://github.com/http-party/node-http-proxy/commit/82b822827d35a54501068f9880111473e19c72f9) +- initial release v0.1.0, sure to have many updates coming. [`1e04552`](https://github.com/http-party/node-http-proxy/commit/1e04552bd8f39e3dcba36bbf7fb36674e5c0c9ff) +- updated readme [`0a2eaaa`](https://github.com/http-party/node-http-proxy/commit/0a2eaaa7db690f86aca8c0b952f745e806ad818c) +- updating docs [`198000f`](https://github.com/http-party/node-http-proxy/commit/198000feefd525125a2031557b3556978a057bde) +- [api] Added createServer api to node-http-proxy [`2e2b55f`](https://github.com/http-party/node-http-proxy/commit/2e2b55f113eb3bc81c43717c0db5de695fb694c1) diff --git a/tools/ui/node_modules/http-proxy/CODE_OF_CONDUCT.md b/tools/ui/node_modules/http-proxy/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..29238b798d7d372d9e62518038d9cc6d8ae9e63e --- /dev/null +++ b/tools/ui/node_modules/http-proxy/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at . All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/tools/ui/node_modules/http-proxy/LICENSE b/tools/ui/node_modules/http-proxy/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..84820c000caadc2dcb0ff8d32e5b7cd43eb57645 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/LICENSE @@ -0,0 +1,23 @@ + + node-http-proxy + + Copyright (c) 2010-2016 Charlie Robbins, Jarrett Cruger & the Contributors. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/http-proxy/README.md b/tools/ui/node_modules/http-proxy/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5b2d0b3a21543e2939273db3d71338229a5a26b6 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/README.md @@ -0,0 +1,568 @@ +

+ +

+ +# node-http-proxy [![Build Status](https://travis-ci.org/http-party/node-http-proxy.svg?branch=master)](https://travis-ci.org/http-party/node-http-proxy) [![codecov](https://codecov.io/gh/http-party/node-http-proxy/branch/master/graph/badge.svg)](https://codecov.io/gh/http-party/node-http-proxy) + +`node-http-proxy` is an HTTP programmable proxying library that supports +websockets. It is suitable for implementing components such as reverse +proxies and load balancers. + +### Table of Contents + * [Installation](#installation) + * [Upgrading from 0.8.x ?](#upgrading-from-08x-) + * [Core Concept](#core-concept) + * [Use Cases](#use-cases) + * [Setup a basic stand-alone proxy server](#setup-a-basic-stand-alone-proxy-server) + * [Setup a stand-alone proxy server with custom server logic](#setup-a-stand-alone-proxy-server-with-custom-server-logic) + * [Setup a stand-alone proxy server with proxy request header re-writing](#setup-a-stand-alone-proxy-server-with-proxy-request-header-re-writing) + * [Modify a response from a proxied server](#modify-a-response-from-a-proxied-server) + * [Setup a stand-alone proxy server with latency](#setup-a-stand-alone-proxy-server-with-latency) + * [Using HTTPS](#using-https) + * [Proxying WebSockets](#proxying-websockets) + * [Options](#options) + * [Listening for proxy events](#listening-for-proxy-events) + * [Shutdown](#shutdown) + * [Miscellaneous](#miscellaneous) + * [Test](#test) + * [ProxyTable API](#proxytable-api) + * [Logo](#logo) + * [Contributing and Issues](#contributing-and-issues) + * [License](#license) + +### Installation + +`npm install http-proxy --save` + +**[Back to top](#table-of-contents)** + +### Upgrading from 0.8.x ? + +Click [here](UPGRADING.md) + +**[Back to top](#table-of-contents)** + +### Core Concept + +A new proxy is created by calling `createProxyServer` and passing +an `options` object as argument ([valid properties are available here](lib/http-proxy.js#L26-L42)) + +```javascript +var httpProxy = require('http-proxy'); + +var proxy = httpProxy.createProxyServer(options); // See (†) +``` +†Unless listen(..) is invoked on the object, this does not create a webserver. See below. + +An object will be returned with four methods: + +* web `req, res, [options]` (used for proxying regular HTTP(S) requests) +* ws `req, socket, head, [options]` (used for proxying WS(S) requests) +* listen `port` (a function that wraps the object in a webserver, for your convenience) +* close `[callback]` (a function that closes the inner webserver and stops listening on given port) + +It is then possible to proxy requests by calling these functions + +```javascript +http.createServer(function(req, res) { + proxy.web(req, res, { target: 'http://mytarget.com:8080' }); +}); +``` + +Errors can be listened on either using the Event Emitter API + +```javascript +proxy.on('error', function(e) { + ... +}); +``` + +or using the callback API + +```javascript +proxy.web(req, res, { target: 'http://mytarget.com:8080' }, function(e) { ... }); +``` + +When a request is proxied it follows two different pipelines ([available here](lib/http-proxy/passes)) +which apply transformations to both the `req` and `res` object. +The first pipeline (incoming) is responsible for the creation and manipulation of the stream that connects your client to the target. +The second pipeline (outgoing) is responsible for the creation and manipulation of the stream that, from your target, returns data +to the client. + +**[Back to top](#table-of-contents)** + +### Use Cases + +#### Setup a basic stand-alone proxy server + +```js +var http = require('http'), + httpProxy = require('http-proxy'); +// +// Create your proxy server and set the target in the options. +// +httpProxy.createProxyServer({target:'http://localhost:9000'}).listen(8000); // See (†) + +// +// Create your target server +// +http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2)); + res.end(); +}).listen(9000); +``` +†Invoking listen(..) triggers the creation of a web server. Otherwise, just the proxy instance is created. + +**[Back to top](#table-of-contents)** + +#### Setup a stand-alone proxy server with custom server logic +This example shows how you can proxy a request using your own HTTP server +and also you can put your own logic to handle the request. + +```js +var http = require('http'), + httpProxy = require('http-proxy'); + +// +// Create a proxy server with custom application logic +// +var proxy = httpProxy.createProxyServer({}); + +// +// Create your custom server and just call `proxy.web()` to proxy +// a web request to the target passed in the options +// also you can use `proxy.ws()` to proxy a websockets request +// +var server = http.createServer(function(req, res) { + // You can define here your custom logic to handle the request + // and then proxy the request. + proxy.web(req, res, { target: 'http://127.0.0.1:5050' }); +}); + +console.log("listening on port 5050") +server.listen(5050); +``` + +**[Back to top](#table-of-contents)** + +#### Setup a stand-alone proxy server with proxy request header re-writing +This example shows how you can proxy a request using your own HTTP server that +modifies the outgoing proxy request by adding a special header. + +```js +var http = require('http'), + httpProxy = require('http-proxy'); + +// +// Create a proxy server with custom application logic +// +var proxy = httpProxy.createProxyServer({}); + +// To modify the proxy connection before data is sent, you can listen +// for the 'proxyReq' event. When the event is fired, you will receive +// the following arguments: +// (http.ClientRequest proxyReq, http.IncomingMessage req, +// http.ServerResponse res, Object options). This mechanism is useful when +// you need to modify the proxy request before the proxy connection +// is made to the target. +// +proxy.on('proxyReq', function(proxyReq, req, res, options) { + proxyReq.setHeader('X-Special-Proxy-Header', 'foobar'); +}); + +var server = http.createServer(function(req, res) { + // You can define here your custom logic to handle the request + // and then proxy the request. + proxy.web(req, res, { + target: 'http://127.0.0.1:5050' + }); +}); + +console.log("listening on port 5050") +server.listen(5050); +``` + +**[Back to top](#table-of-contents)** + +#### Modify a response from a proxied server +Sometimes when you have received a HTML/XML document from the server of origin you would like to modify it before forwarding it on. + +[Harmon](https://github.com/No9/harmon) allows you to do this in a streaming style so as to keep the pressure on the proxy to a minimum. + +**[Back to top](#table-of-contents)** + +#### Setup a stand-alone proxy server with latency + +```js +var http = require('http'), + httpProxy = require('http-proxy'); + +// +// Create a proxy server with latency +// +var proxy = httpProxy.createProxyServer(); + +// +// Create your server that makes an operation that waits a while +// and then proxies the request +// +http.createServer(function (req, res) { + // This simulates an operation that takes 500ms to execute + setTimeout(function () { + proxy.web(req, res, { + target: 'http://localhost:9008' + }); + }, 500); +}).listen(8008); + +// +// Create your target server +// +http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); + res.end(); +}).listen(9008); +``` + +**[Back to top](#table-of-contents)** + +#### Using HTTPS +You can activate the validation of a secure SSL certificate to the target connection (avoid self-signed certs), just set `secure: true` in the options. + +##### HTTPS -> HTTP + +```js +// +// Create the HTTPS proxy server in front of a HTTP server +// +httpProxy.createServer({ + target: { + host: 'localhost', + port: 9009 + }, + ssl: { + key: fs.readFileSync('valid-ssl-key.pem', 'utf8'), + cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8') + } +}).listen(8009); +``` + +##### HTTPS -> HTTPS + +```js +// +// Create the proxy server listening on port 443 +// +httpProxy.createServer({ + ssl: { + key: fs.readFileSync('valid-ssl-key.pem', 'utf8'), + cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8') + }, + target: 'https://localhost:9010', + secure: true // Depends on your needs, could be false. +}).listen(443); +``` + +##### HTTP -> HTTPS (using a PKCS12 client certificate) + +```js +// +// Create an HTTP proxy server with an HTTPS target +// +httpProxy.createProxyServer({ + target: { + protocol: 'https:', + host: 'my-domain-name', + port: 443, + pfx: fs.readFileSync('path/to/certificate.p12'), + passphrase: 'password', + }, + changeOrigin: true, +}).listen(8000); +``` + +**[Back to top](#table-of-contents)** + +#### Proxying WebSockets +You can activate the websocket support for the proxy using `ws:true` in the options. + +```js +// +// Create a proxy server for websockets +// +httpProxy.createServer({ + target: 'ws://localhost:9014', + ws: true +}).listen(8014); +``` + +Also you can proxy the websocket requests just calling the `ws(req, socket, head)` method. + +```js +// +// Setup our server to proxy standard HTTP requests +// +var proxy = new httpProxy.createProxyServer({ + target: { + host: 'localhost', + port: 9015 + } +}); +var proxyServer = http.createServer(function (req, res) { + proxy.web(req, res); +}); + +// +// Listen to the `upgrade` event and proxy the +// WebSocket requests as well. +// +proxyServer.on('upgrade', function (req, socket, head) { + proxy.ws(req, socket, head); +}); + +proxyServer.listen(8015); +``` + +**[Back to top](#table-of-contents)** + +### Options + +`httpProxy.createProxyServer` supports the following options: + +* **target**: url string to be parsed with the url module +* **forward**: url string to be parsed with the url module +* **agent**: object to be passed to http(s).request (see Node's [https agent](http://nodejs.org/api/https.html#https_class_https_agent) and [http agent](http://nodejs.org/api/http.html#http_class_http_agent) objects) +* **ssl**: object to be passed to https.createServer() +* **ws**: true/false, if you want to proxy websockets +* **xfwd**: true/false, adds x-forward headers +* **secure**: true/false, if you want to verify the SSL Certs +* **toProxy**: true/false, passes the absolute URL as the `path` (useful for proxying to proxies) +* **prependPath**: true/false, Default: true - specify whether you want to prepend the target's path to the proxy path +* **ignorePath**: true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request (note: you will have to append / manually if required). +* **localAddress**: Local interface string to bind for outgoing connections +* **changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL +* **preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key +* **auth**: Basic authentication i.e. 'user:password' to compute an Authorization header. +* **hostRewrite**: rewrites the location hostname on (201/301/302/307/308) redirects. +* **autoRewrite**: rewrites the location host/port on (201/301/302/307/308) redirects based on requested host/port. Default: false. +* **protocolRewrite**: rewrites the location protocol on (201/301/302/307/308) redirects to 'http' or 'https'. Default: null. +* **cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values: + * `false` (default): disable cookie rewriting + * String: new domain, for example `cookieDomainRewrite: "new.domain"`. To remove the domain, use `cookieDomainRewrite: ""`. + * Object: mapping of domains to new domains, use `"*"` to match all domains. + For example keep one domain unchanged, rewrite one domain and remove other domains: + ``` + cookieDomainRewrite: { + "unchanged.domain": "unchanged.domain", + "old.domain": "new.domain", + "*": "" + } + ``` +* **cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values: + * `false` (default): disable cookie rewriting + * String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`. + * Object: mapping of paths to new paths, use `"*"` to match all paths. + For example, to keep one path unchanged, rewrite one path and remove other paths: + ``` + cookiePathRewrite: { + "/unchanged.path/": "/unchanged.path/", + "/old.path/": "/new.path/", + "*": "" + } + ``` +* **headers**: object with extra headers to be added to target requests. +* **proxyTimeout**: timeout (in millis) for outgoing proxy requests +* **timeout**: timeout (in millis) for incoming requests +* **followRedirects**: true/false, Default: false - specify whether you want to follow redirects +* **selfHandleResponse** true/false, if set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the `proxyRes` event +* **buffer**: stream of data to send as the request body. Maybe you have some middleware that consumes the request stream before proxying it on e.g. If you read the body of a request into a field called 'req.rawbody' you could restream this field in the buffer option: + + ``` + 'use strict'; + + const streamify = require('stream-array'); + const HttpProxy = require('http-proxy'); + const proxy = new HttpProxy(); + + module.exports = (req, res, next) => { + + proxy.web(req, res, { + target: 'http://localhost:4003/', + buffer: streamify(req.rawBody) + }, next); + + }; + ``` + +**NOTE:** +`options.ws` and `options.ssl` are optional. +`options.target` and `options.forward` cannot both be missing + +If you are using the `proxyServer.listen` method, the following options are also applicable: + + * **ssl**: object to be passed to https.createServer() + * **ws**: true/false, if you want to proxy websockets + + +**[Back to top](#table-of-contents)** + +### Listening for proxy events + +* `error`: The error event is emitted if the request to the target fail. **We do not do any error handling of messages passed between client and proxy, and messages passed between proxy and target, so it is recommended that you listen on errors and handle them.** +* `proxyReq`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "web" connections +* `proxyReqWs`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "websocket" connections +* `proxyRes`: This event is emitted if the request to the target got a response. +* `open`: This event is emitted once the proxy websocket was created and piped into the target websocket. +* `close`: This event is emitted once the proxy websocket was closed. +* (DEPRECATED) `proxySocket`: Deprecated in favor of `open`. + +```js +var httpProxy = require('http-proxy'); +// Error example +// +// Http Proxy Server with bad target +// +var proxy = httpProxy.createServer({ + target:'http://localhost:9005' +}); + +proxy.listen(8005); + +// +// Listen for the `error` event on `proxy`. +proxy.on('error', function (err, req, res) { + res.writeHead(500, { + 'Content-Type': 'text/plain' + }); + + res.end('Something went wrong. And we are reporting a custom error message.'); +}); + +// +// Listen for the `proxyRes` event on `proxy`. +// +proxy.on('proxyRes', function (proxyRes, req, res) { + console.log('RAW Response from the target', JSON.stringify(proxyRes.headers, true, 2)); +}); + +// +// Listen for the `open` event on `proxy`. +// +proxy.on('open', function (proxySocket) { + // listen for messages coming FROM the target here + proxySocket.on('data', hybiParseAndLogMessage); +}); + +// +// Listen for the `close` event on `proxy`. +// +proxy.on('close', function (res, socket, head) { + // view disconnected websocket connections + console.log('Client disconnected'); +}); +``` + +**[Back to top](#table-of-contents)** + +### Shutdown + +* When testing or running server within another program it may be necessary to close the proxy. +* This will stop the proxy from accepting new connections. + +```js +var proxy = new httpProxy.createProxyServer({ + target: { + host: 'localhost', + port: 1337 + } +}); + +proxy.close(); +``` + +**[Back to top](#table-of-contents)** + +### Miscellaneous + +If you want to handle your own response after receiving the `proxyRes`, you can do +so with `selfHandleResponse`. As you can see below, if you use this option, you +are able to intercept and read the `proxyRes` but you must also make sure to +reply to the `res` itself otherwise the original client will never receive any +data. + +### Modify response + +```js + + var option = { + target: target, + selfHandleResponse : true + }; + proxy.on('proxyRes', function (proxyRes, req, res) { + var body = []; + proxyRes.on('data', function (chunk) { + body.push(chunk); + }); + proxyRes.on('end', function () { + body = Buffer.concat(body).toString(); + console.log("res from proxied server:", body); + res.end("my response to cli"); + }); + }); + proxy.web(req, res, option); + + +``` + +#### ProxyTable API + +A proxy table API is available through this add-on [module](https://github.com/donasaur/http-proxy-rules), which lets you define a set of rules to translate matching routes to target routes that the reverse proxy will talk to. + +#### Test + +``` +$ npm test +``` + +#### Logo + +Logo created by [Diego Pasquali](http://dribbble.com/diegopq) + +**[Back to top](#table-of-contents)** + +### Contributing and Issues + +* Read carefully our [Code Of Conduct](https://github.com/http-party/node-http-proxy/blob/master/CODE_OF_CONDUCT.md) +* Search on Google/Github +* If you can't find anything, open an issue +* If you feel comfortable about fixing the issue, fork the repo +* Commit to your local branch (which must be different from `master`) +* Submit your Pull Request (be sure to include tests and update documentation) + +**[Back to top](#table-of-contents)** + +### License + +>The MIT License (MIT) +> +>Copyright (c) 2010 - 2016 Charlie Robbins, Jarrett Cruger & the Contributors. +> +>Permission is hereby granted, free of charge, to any person obtaining a copy +>of this software and associated documentation files (the "Software"), to deal +>in the Software without restriction, including without limitation the rights +>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +>copies of the Software, and to permit persons to whom the Software is +>furnished to do so, subject to the following conditions: +> +>The above copyright notice and this permission notice shall be included in +>all copies or substantial portions of the Software. +> +>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +>THE SOFTWARE. diff --git a/tools/ui/node_modules/http-proxy/codecov.yml b/tools/ui/node_modules/http-proxy/codecov.yml new file mode 100644 index 0000000000000000000000000000000000000000..cafdd1ced36d9def1623f5291bd60d4a544faf07 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/codecov.yml @@ -0,0 +1,10 @@ +coverage: + parsers: + javascript: + enable_partials: yes + status: + project: + default: + target: "70%" + patch: + enabled: false diff --git a/tools/ui/node_modules/http-proxy/index.js b/tools/ui/node_modules/http-proxy/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e6fac85844eed4be4905f21068ad8fcdf22c9944 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/index.js @@ -0,0 +1,13 @@ +/*! + * Caron dimonio, con occhi di bragia + * loro accennando, tutte le raccoglie; + * batte col remo qualunque s’adagia + * + * Charon the demon, with the eyes of glede, + * Beckoning to them, collects them all together, + * Beats with his oar whoever lags behind + * + * Dante - The Divine Comedy (Canto III) + */ + +module.exports = require('./lib/http-proxy'); \ No newline at end of file diff --git a/tools/ui/node_modules/http-proxy/lib/http-proxy.js b/tools/ui/node_modules/http-proxy/lib/http-proxy.js new file mode 100644 index 0000000000000000000000000000000000000000..8ea278938f7e1dd18b1935f82237ccfa9bfae1ec --- /dev/null +++ b/tools/ui/node_modules/http-proxy/lib/http-proxy.js @@ -0,0 +1,66 @@ + // Use explicit /index.js to help browserify negociation in require '/lib/http-proxy' (!) +var ProxyServer = require('./http-proxy/index.js').Server; + + +/** + * Creates the proxy server. + * + * Examples: + * + * httpProxy.createProxyServer({ .. }, 8000) + * // => '{ web: [Function], ws: [Function] ... }' + * + * @param {Object} Options Config object passed to the proxy + * + * @return {Object} Proxy Proxy object with handlers for `ws` and `web` requests + * + * @api public + */ + + +function createProxyServer(options) { + /* + * `options` is needed and it must have the following layout: + * + * { + * target : + * forward: + * agent : + * ssl : + * ws : + * xfwd : + * secure : + * toProxy: + * prependPath: + * ignorePath: + * localAddress : + * changeOrigin: + * preserveHeaderKeyCase: + * auth : Basic authentication i.e. 'user:password' to compute an Authorization header. + * hostRewrite: rewrites the location hostname on (201/301/302/307/308) redirects, Default: null. + * autoRewrite: rewrites the location host/port on (201/301/302/307/308) redirects based on requested host/port. Default: false. + * protocolRewrite: rewrites the location protocol on (201/301/302/307/308) redirects to 'http' or 'https'. Default: null. + * } + * + * NOTE: `options.ws` and `options.ssl` are optional. + * `options.target and `options.forward` cannot be + * both missing + * } + */ + + return new ProxyServer(options); +} + + +ProxyServer.createProxyServer = createProxyServer; +ProxyServer.createServer = createProxyServer; +ProxyServer.createProxy = createProxyServer; + + + + +/** + * Export the proxy "Server" as the main export. + */ +module.exports = ProxyServer; + diff --git a/tools/ui/node_modules/http-proxy/lib/http-proxy/common.js b/tools/ui/node_modules/http-proxy/lib/http-proxy/common.js new file mode 100644 index 0000000000000000000000000000000000000000..6513e81d80d5250ea249ea833f819ece67897c7e --- /dev/null +++ b/tools/ui/node_modules/http-proxy/lib/http-proxy/common.js @@ -0,0 +1,248 @@ +var common = exports, + url = require('url'), + extend = require('util')._extend, + required = require('requires-port'); + +var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i, + isSSL = /^https|wss/; + +/** + * Simple Regex for testing if protocol is https + */ +common.isSSL = isSSL; +/** + * Copies the right headers from `options` and `req` to + * `outgoing` which is then used to fire the proxied + * request. + * + * Examples: + * + * common.setupOutgoing(outgoing, options, req) + * // => { host: ..., hostname: ...} + * + * @param {Object} Outgoing Base object to be filled with required properties + * @param {Object} Options Config object passed to the proxy + * @param {ClientRequest} Req Request Object + * @param {String} Forward String to select forward or target + *  + * @return {Object} Outgoing Object with all required properties set + * + * @api private + */ + +common.setupOutgoing = function(outgoing, options, req, forward) { + outgoing.port = options[forward || 'target'].port || + (isSSL.test(options[forward || 'target'].protocol) ? 443 : 80); + + ['host', 'hostname', 'socketPath', 'pfx', 'key', + 'passphrase', 'cert', 'ca', 'ciphers', 'secureProtocol'].forEach( + function(e) { outgoing[e] = options[forward || 'target'][e]; } + ); + + outgoing.method = options.method || req.method; + outgoing.headers = extend({}, req.headers); + + if (options.headers){ + extend(outgoing.headers, options.headers); + } + + if (options.auth) { + outgoing.auth = options.auth; + } + + if (options.ca) { + outgoing.ca = options.ca; + } + + if (isSSL.test(options[forward || 'target'].protocol)) { + outgoing.rejectUnauthorized = (typeof options.secure === "undefined") ? true : options.secure; + } + + + outgoing.agent = options.agent || false; + outgoing.localAddress = options.localAddress; + + // + // Remark: If we are false and not upgrading, set the connection: close. This is the right thing to do + // as node core doesn't handle this COMPLETELY properly yet. + // + if (!outgoing.agent) { + outgoing.headers = outgoing.headers || {}; + if (typeof outgoing.headers.connection !== 'string' + || !upgradeHeader.test(outgoing.headers.connection) + ) { outgoing.headers.connection = 'close'; } + } + + + // the final path is target path + relative path requested by user: + var target = options[forward || 'target']; + var targetPath = target && options.prependPath !== false + ? (target.path || '') + : ''; + + // + // Remark: Can we somehow not use url.parse as a perf optimization? + // + var outgoingPath = !options.toProxy + ? (url.parse(req.url).path || '') + : req.url; + + // + // Remark: ignorePath will just straight up ignore whatever the request's + // path is. This can be labeled as FOOT-GUN material if you do not know what + // you are doing and are using conflicting options. + // + outgoingPath = !options.ignorePath ? outgoingPath : ''; + + outgoing.path = common.urlJoin(targetPath, outgoingPath); + + if (options.changeOrigin) { + outgoing.headers.host = + required(outgoing.port, options[forward || 'target'].protocol) && !hasPort(outgoing.host) + ? outgoing.host + ':' + outgoing.port + : outgoing.host; + } + return outgoing; +}; + +/** + * Set the proper configuration for sockets, + * set no delay and set keep alive, also set + * the timeout to 0. + * + * Examples: + * + * common.setupSocket(socket) + * // => Socket + * + * @param {Socket} Socket instance to setup + *  + * @return {Socket} Return the configured socket. + * + * @api private + */ + +common.setupSocket = function(socket) { + socket.setTimeout(0); + socket.setNoDelay(true); + + socket.setKeepAlive(true, 0); + + return socket; +}; + +/** + * Get the port number from the host. Or guess it based on the connection type. + * + * @param {Request} req Incoming HTTP request. + * + * @return {String} The port number. + * + * @api private + */ +common.getPort = function(req) { + var res = req.headers.host ? req.headers.host.match(/:(\d+)/) : ''; + + return res ? + res[1] : + common.hasEncryptedConnection(req) ? '443' : '80'; +}; + +/** + * Check if the request has an encrypted connection. + * + * @param {Request} req Incoming HTTP request. + * + * @return {Boolean} Whether the connection is encrypted or not. + * + * @api private + */ +common.hasEncryptedConnection = function(req) { + return Boolean(req.connection.encrypted || req.connection.pair); +}; + +/** + * OS-agnostic join (doesn't break on URLs like path.join does on Windows)> + * + * @return {String} The generated path. + * + * @api private + */ + +common.urlJoin = function() { + // + // We do not want to mess with the query string. All we want to touch is the path. + // + var args = Array.prototype.slice.call(arguments), + lastIndex = args.length - 1, + last = args[lastIndex], + lastSegs = last.split('?'), + retSegs; + + args[lastIndex] = lastSegs.shift(); + + // + // Join all strings, but remove empty strings so we don't get extra slashes from + // joining e.g. ['', 'am'] + // + retSegs = [ + args.filter(Boolean).join('/') + .replace(/\/+/g, '/') + .replace('http:/', 'http://') + .replace('https:/', 'https://') + ]; + + // Only join the query string if it exists so we don't have trailing a '?' + // on every request + + // Handle case where there could be multiple ? in the URL. + retSegs.push.apply(retSegs, lastSegs); + + return retSegs.join('?') +}; + +/** + * Rewrites or removes the domain of a cookie header + * + * @param {String|Array} Header + * @param {Object} Config, mapping of domain to rewritten domain. + * '*' key to match any domain, null value to remove the domain. + * + * @api private + */ +common.rewriteCookieProperty = function rewriteCookieProperty(header, config, property) { + if (Array.isArray(header)) { + return header.map(function (headerElement) { + return rewriteCookieProperty(headerElement, config, property); + }); + } + return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", 'i'), function(match, prefix, previousValue) { + var newValue; + if (previousValue in config) { + newValue = config[previousValue]; + } else if ('*' in config) { + newValue = config['*']; + } else { + //no match, return previous value + return match; + } + if (newValue) { + //replace value + return prefix + newValue; + } else { + //remove value + return ''; + } + }); +}; + +/** + * Check the host and see if it potentially has a port in it (keep it simple) + * + * @returns {Boolean} Whether we have one or not + * + * @api private + */ +function hasPort(host) { + return !!~host.indexOf(':'); +}; diff --git a/tools/ui/node_modules/http-proxy/lib/http-proxy/index.js b/tools/ui/node_modules/http-proxy/lib/http-proxy/index.js new file mode 100644 index 0000000000000000000000000000000000000000..977a4b3622b9eaac27689f06347ea4c5173a96cd --- /dev/null +++ b/tools/ui/node_modules/http-proxy/lib/http-proxy/index.js @@ -0,0 +1,185 @@ +var httpProxy = module.exports, + extend = require('util')._extend, + parse_url = require('url').parse, + EE3 = require('eventemitter3'), + http = require('http'), + https = require('https'), + web = require('./passes/web-incoming'), + ws = require('./passes/ws-incoming'); + +httpProxy.Server = ProxyServer; + +/** + * Returns a function that creates the loader for + * either `ws` or `web`'s passes. + * + * Examples: + * + * httpProxy.createRightProxy('ws') + * // => [Function] + * + * @param {String} Type Either 'ws' or 'web' + *  + * @return {Function} Loader Function that when called returns an iterator for the right passes + * + * @api private + */ + +function createRightProxy(type) { + + return function(options) { + return function(req, res /*, [head], [opts] */) { + var passes = (type === 'ws') ? this.wsPasses : this.webPasses, + args = [].slice.call(arguments), + cntr = args.length - 1, + head, cbl; + + /* optional args parse begin */ + if(typeof args[cntr] === 'function') { + cbl = args[cntr]; + + cntr--; + } + + var requestOptions = options; + if( + !(args[cntr] instanceof Buffer) && + args[cntr] !== res + ) { + //Copy global options + requestOptions = extend({}, options); + //Overwrite with request options + extend(requestOptions, args[cntr]); + + cntr--; + } + + if(args[cntr] instanceof Buffer) { + head = args[cntr]; + } + + /* optional args parse end */ + + ['target', 'forward'].forEach(function(e) { + if (typeof requestOptions[e] === 'string') + requestOptions[e] = parse_url(requestOptions[e]); + }); + + if (!requestOptions.target && !requestOptions.forward) { + return this.emit('error', new Error('Must provide a proper URL as target')); + } + + for(var i=0; i < passes.length; i++) { + /** + * Call of passes functions + * pass(req, res, options, head) + * + * In WebSockets case the `res` variable + * refer to the connection socket + * pass(req, socket, options, head) + */ + if(passes[i](req, res, requestOptions, head, this, cbl)) { // passes can return a truthy value to halt the loop + break; + } + } + }; + }; +} +httpProxy.createRightProxy = createRightProxy; + +function ProxyServer(options) { + EE3.call(this); + + options = options || {}; + options.prependPath = options.prependPath === false ? false : true; + + this.web = this.proxyRequest = createRightProxy('web')(options); + this.ws = this.proxyWebsocketRequest = createRightProxy('ws')(options); + this.options = options; + + this.webPasses = Object.keys(web).map(function(pass) { + return web[pass]; + }); + + this.wsPasses = Object.keys(ws).map(function(pass) { + return ws[pass]; + }); + + this.on('error', this.onError, this); + +} + +require('util').inherits(ProxyServer, EE3); + +ProxyServer.prototype.onError = function (err) { + // + // Remark: Replicate node core behavior using EE3 + // so we force people to handle their own errors + // + if(this.listeners('error').length === 1) { + throw err; + } +}; + +ProxyServer.prototype.listen = function(port, hostname) { + var self = this, + closure = function(req, res) { self.web(req, res); }; + + this._server = this.options.ssl ? + https.createServer(this.options.ssl, closure) : + http.createServer(closure); + + if(this.options.ws) { + this._server.on('upgrade', function(req, socket, head) { self.ws(req, socket, head); }); + } + + this._server.listen(port, hostname); + + return this; +}; + +ProxyServer.prototype.close = function(callback) { + var self = this; + if (this._server) { + this._server.close(done); + } + + // Wrap callback to nullify server after all open connections are closed. + function done() { + self._server = null; + if (callback) { + callback.apply(null, arguments); + } + }; +}; + +ProxyServer.prototype.before = function(type, passName, callback) { + if (type !== 'ws' && type !== 'web') { + throw new Error('type must be `web` or `ws`'); + } + var passes = (type === 'ws') ? this.wsPasses : this.webPasses, + i = false; + + passes.forEach(function(v, idx) { + if(v.name === passName) i = idx; + }) + + if(i === false) throw new Error('No such pass'); + + passes.splice(i, 0, callback); +}; +ProxyServer.prototype.after = function(type, passName, callback) { + if (type !== 'ws' && type !== 'web') { + throw new Error('type must be `web` or `ws`'); + } + var passes = (type === 'ws') ? this.wsPasses : this.webPasses, + i = false; + + passes.forEach(function(v, idx) { + if(v.name === passName) i = idx; + }) + + if(i === false) throw new Error('No such pass'); + + passes.splice(i++, 0, callback); +}; diff --git a/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js b/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js new file mode 100644 index 0000000000000000000000000000000000000000..7ae735514190eea569c605fff7d27c045fe8d601 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js @@ -0,0 +1,194 @@ +var httpNative = require('http'), + httpsNative = require('https'), + web_o = require('./web-outgoing'), + common = require('../common'), + followRedirects = require('follow-redirects'); + +web_o = Object.keys(web_o).map(function(pass) { + return web_o[pass]; +}); + +var nativeAgents = { http: httpNative, https: httpsNative }; + +/*! + * Array of passes. + * + * A `pass` is just a function that is executed on `req, res, options` + * so that you can easily add new checks while still keeping the base + * flexible. + */ + + +module.exports = { + + /** + * Sets `content-length` to '0' if request is of DELETE type. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + deleteLength: function deleteLength(req, res, options) { + if((req.method === 'DELETE' || req.method === 'OPTIONS') + && !req.headers['content-length']) { + req.headers['content-length'] = '0'; + delete req.headers['transfer-encoding']; + } + }, + + /** + * Sets timeout in request socket if it was specified in options. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + timeout: function timeout(req, res, options) { + if(options.timeout) { + req.socket.setTimeout(options.timeout); + } + }, + + /** + * Sets `x-forwarded-*` headers if specified in config. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + XHeaders: function XHeaders(req, res, options) { + if(!options.xfwd) return; + + var encrypted = req.isSpdy || common.hasEncryptedConnection(req); + var values = { + for : req.connection.remoteAddress || req.socket.remoteAddress, + port : common.getPort(req), + proto: encrypted ? 'https' : 'http' + }; + + ['for', 'port', 'proto'].forEach(function(header) { + req.headers['x-forwarded-' + header] = + (req.headers['x-forwarded-' + header] || '') + + (req.headers['x-forwarded-' + header] ? ',' : '') + + values[header]; + }); + + req.headers['x-forwarded-host'] = req.headers['x-forwarded-host'] || req.headers['host'] || ''; + }, + + /** + * Does the actual proxying. If `forward` is enabled fires up + * a ForwardStream, same happens for ProxyStream. The request + * just dies otherwise. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + stream: function stream(req, res, options, _, server, clb) { + + // And we begin! + server.emit('start', req, res, options.target || options.forward); + + var agents = options.followRedirects ? followRedirects : nativeAgents; + var http = agents.http; + var https = agents.https; + + if(options.forward) { + // If forward enable, so just pipe the request + var forwardReq = (options.forward.protocol === 'https:' ? https : http).request( + common.setupOutgoing(options.ssl || {}, options, req, 'forward') + ); + + // error handler (e.g. ECONNRESET, ECONNREFUSED) + // Handle errors on incoming request as well as it makes sense to + var forwardError = createErrorHandler(forwardReq, options.forward); + req.on('error', forwardError); + forwardReq.on('error', forwardError); + + (options.buffer || req).pipe(forwardReq); + if(!options.target) { return res.end(); } + } + + // Request initalization + var proxyReq = (options.target.protocol === 'https:' ? https : http).request( + common.setupOutgoing(options.ssl || {}, options, req) + ); + + // Enable developers to modify the proxyReq before headers are sent + proxyReq.on('socket', function(socket) { + if(server && !proxyReq.getHeader('expect')) { + server.emit('proxyReq', proxyReq, req, res, options); + } + }); + + // allow outgoing socket to timeout so that we could + // show an error page at the initial request + if(options.proxyTimeout) { + proxyReq.setTimeout(options.proxyTimeout, function() { + proxyReq.abort(); + }); + } + + // Ensure we abort proxy if request is aborted + req.on('aborted', function () { + proxyReq.abort(); + }); + + // handle errors in proxy and incoming request, just like for forward proxy + var proxyError = createErrorHandler(proxyReq, options.target); + req.on('error', proxyError); + proxyReq.on('error', proxyError); + + function createErrorHandler(proxyReq, url) { + return function proxyError(err) { + if (req.socket.destroyed && err.code === 'ECONNRESET') { + server.emit('econnreset', err, req, res, url); + return proxyReq.abort(); + } + + if (clb) { + clb(err, req, res, url); + } else { + server.emit('error', err, req, res, url); + } + } + } + + (options.buffer || req).pipe(proxyReq); + + proxyReq.on('response', function(proxyRes) { + if(server) { server.emit('proxyRes', proxyRes, req, res); } + + if(!res.headersSent && !options.selfHandleResponse) { + for(var i=0; i < web_o.length; i++) { + if(web_o[i](req, res, proxyRes, options)) { break; } + } + } + + if (!res.finished) { + // Allow us to listen when the proxy has completed + proxyRes.on('end', function () { + if (server) server.emit('end', req, res, proxyRes); + }); + // We pipe to the response unless its expected to be handled by the user + if (!options.selfHandleResponse) proxyRes.pipe(res); + } else { + if (server) server.emit('end', req, res, proxyRes); + } + }); + } + +}; diff --git a/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js b/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js new file mode 100644 index 0000000000000000000000000000000000000000..46352f6e377affc701773328d528bd7e4352f242 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js @@ -0,0 +1,147 @@ +var url = require('url'), + common = require('../common'); + + +var redirectRegex = /^201|30(1|2|7|8)$/; + +/*! + * Array of passes. + * + * A `pass` is just a function that is executed on `req, res, options` + * so that you can easily add new checks while still keeping the base + * flexible. + */ + +module.exports = { // <-- + + /** + * If is a HTTP 1.0 request, remove chunk headers + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * + * @api private + */ + removeChunked: function removeChunked(req, res, proxyRes) { + if (req.httpVersion === '1.0') { + delete proxyRes.headers['transfer-encoding']; + } + }, + + /** + * If is a HTTP 1.0 request, set the correct connection header + * or if connection header not present, then use `keep-alive` + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * + * @api private + */ + setConnection: function setConnection(req, res, proxyRes) { + if (req.httpVersion === '1.0') { + proxyRes.headers.connection = req.headers.connection || 'close'; + } else if (req.httpVersion !== '2.0' && !proxyRes.headers.connection) { + proxyRes.headers.connection = req.headers.connection || 'keep-alive'; + } + }, + + setRedirectHostRewrite: function setRedirectHostRewrite(req, res, proxyRes, options) { + if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) + && proxyRes.headers['location'] + && redirectRegex.test(proxyRes.statusCode)) { + var target = url.parse(options.target); + var u = url.parse(proxyRes.headers['location']); + + // make sure the redirected host matches the target host before rewriting + if (target.host != u.host) { + return; + } + + if (options.hostRewrite) { + u.host = options.hostRewrite; + } else if (options.autoRewrite) { + u.host = req.headers['host']; + } + if (options.protocolRewrite) { + u.protocol = options.protocolRewrite; + } + + proxyRes.headers['location'] = u.format(); + } + }, + /** + * Copy headers from proxyResponse to response + * set each header in response object. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * @param {Object} Options options.cookieDomainRewrite: Config to rewrite cookie domain + * + * @api private + */ + writeHeaders: function writeHeaders(req, res, proxyRes, options) { + var rewriteCookieDomainConfig = options.cookieDomainRewrite, + rewriteCookiePathConfig = options.cookiePathRewrite, + preserveHeaderKeyCase = options.preserveHeaderKeyCase, + rawHeaderKeyMap, + setHeader = function(key, header) { + if (header == undefined) return; + if (rewriteCookieDomainConfig && key.toLowerCase() === 'set-cookie') { + header = common.rewriteCookieProperty(header, rewriteCookieDomainConfig, 'domain'); + } + if (rewriteCookiePathConfig && key.toLowerCase() === 'set-cookie') { + header = common.rewriteCookieProperty(header, rewriteCookiePathConfig, 'path'); + } + res.setHeader(String(key).trim(), header); + }; + + if (typeof rewriteCookieDomainConfig === 'string') { //also test for '' + rewriteCookieDomainConfig = { '*': rewriteCookieDomainConfig }; + } + + if (typeof rewriteCookiePathConfig === 'string') { //also test for '' + rewriteCookiePathConfig = { '*': rewriteCookiePathConfig }; + } + + // message.rawHeaders is added in: v0.11.6 + // https://nodejs.org/api/http.html#http_message_rawheaders + if (preserveHeaderKeyCase && proxyRes.rawHeaders != undefined) { + rawHeaderKeyMap = {}; + for (var i = 0; i < proxyRes.rawHeaders.length; i += 2) { + var key = proxyRes.rawHeaders[i]; + rawHeaderKeyMap[key.toLowerCase()] = key; + } + } + + Object.keys(proxyRes.headers).forEach(function(key) { + var header = proxyRes.headers[key]; + if (preserveHeaderKeyCase && rawHeaderKeyMap) { + key = rawHeaderKeyMap[key] || key; + } + setHeader(key, header); + }); + }, + + /** + * Set the statusCode from the proxyResponse + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * + * @api private + */ + writeStatusCode: function writeStatusCode(req, res, proxyRes) { + // From Node.js docs: response.writeHead(statusCode[, statusMessage][, headers]) + if(proxyRes.statusMessage) { + res.statusCode = proxyRes.statusCode; + res.statusMessage = proxyRes.statusMessage; + } else { + res.statusCode = proxyRes.statusCode; + } + } + +}; diff --git a/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js b/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js new file mode 100644 index 0000000000000000000000000000000000000000..270f23f45db2b417a23d1d4331d2ecdf0d599a35 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js @@ -0,0 +1,162 @@ +var http = require('http'), + https = require('https'), + common = require('../common'); + +/*! + * Array of passes. + * + * A `pass` is just a function that is executed on `req, socket, options` + * so that you can easily add new checks while still keeping the base + * flexible. + */ + +/* + * Websockets Passes + * + */ + + +module.exports = { + /** + * WebSocket requests must have the `GET` method and + * the `upgrade:websocket` header + * + * @param {ClientRequest} Req Request object + * @param {Socket} Websocket + * + * @api private + */ + + checkMethodAndHeader : function checkMethodAndHeader(req, socket) { + if (req.method !== 'GET' || !req.headers.upgrade) { + socket.destroy(); + return true; + } + + if (req.headers.upgrade.toLowerCase() !== 'websocket') { + socket.destroy(); + return true; + } + }, + + /** + * Sets `x-forwarded-*` headers if specified in config. + * + * @param {ClientRequest} Req Request object + * @param {Socket} Websocket + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + XHeaders : function XHeaders(req, socket, options) { + if(!options.xfwd) return; + + var values = { + for : req.connection.remoteAddress || req.socket.remoteAddress, + port : common.getPort(req), + proto: common.hasEncryptedConnection(req) ? 'wss' : 'ws' + }; + + ['for', 'port', 'proto'].forEach(function(header) { + req.headers['x-forwarded-' + header] = + (req.headers['x-forwarded-' + header] || '') + + (req.headers['x-forwarded-' + header] ? ',' : '') + + values[header]; + }); + }, + + /** + * Does the actual proxying. Make the request and upgrade it + * send the Switching Protocols request and pipe the sockets. + * + * @param {ClientRequest} Req Request object + * @param {Socket} Websocket + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + stream : function stream(req, socket, options, head, server, clb) { + + var createHttpHeader = function(line, headers) { + return Object.keys(headers).reduce(function (head, key) { + var value = headers[key]; + + if (!Array.isArray(value)) { + head.push(key + ': ' + value); + return head; + } + + for (var i = 0; i < value.length; i++) { + head.push(key + ': ' + value[i]); + } + return head; + }, [line]) + .join('\r\n') + '\r\n\r\n'; + } + + common.setupSocket(socket); + + if (head && head.length) socket.unshift(head); + + + var proxyReq = (common.isSSL.test(options.target.protocol) ? https : http).request( + common.setupOutgoing(options.ssl || {}, options, req) + ); + + // Enable developers to modify the proxyReq before headers are sent + if (server) { server.emit('proxyReqWs', proxyReq, req, socket, options, head); } + + // Error Handler + proxyReq.on('error', onOutgoingError); + proxyReq.on('response', function (res) { + // if upgrade event isn't going to happen, close the socket + if (!res.upgrade) { + socket.write(createHttpHeader('HTTP/' + res.httpVersion + ' ' + res.statusCode + ' ' + res.statusMessage, res.headers)); + res.pipe(socket); + } + }); + + proxyReq.on('upgrade', function(proxyRes, proxySocket, proxyHead) { + proxySocket.on('error', onOutgoingError); + + // Allow us to listen when the websocket has completed + proxySocket.on('end', function () { + server.emit('close', proxyRes, proxySocket, proxyHead); + }); + + // The pipe below will end proxySocket if socket closes cleanly, but not + // if it errors (eg, vanishes from the net and starts returning + // EHOSTUNREACH). We need to do that explicitly. + socket.on('error', function () { + proxySocket.end(); + }); + + common.setupSocket(proxySocket); + + if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead); + + // + // Remark: Handle writing the headers to the socket when switching protocols + // Also handles when a header is an array + // + socket.write(createHttpHeader('HTTP/1.1 101 Switching Protocols', proxyRes.headers)); + + proxySocket.pipe(socket).pipe(proxySocket); + + server.emit('open', proxySocket); + server.emit('proxySocket', proxySocket); //DEPRECATED. + }); + + return proxyReq.end(); // XXX: CHECK IF THIS IS THIS CORRECT + + function onOutgoingError(err) { + if (clb) { + clb(err, req, socket); + } else { + server.emit('error', err, req, socket); + } + socket.end(); + } + } +}; diff --git a/tools/ui/node_modules/http-proxy/package.json b/tools/ui/node_modules/http-proxy/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9fe81a26d6ae34771be1c39c10bf29a3d3332bad --- /dev/null +++ b/tools/ui/node_modules/http-proxy/package.json @@ -0,0 +1,41 @@ +{ + "name": "http-proxy", + "version": "1.18.1", + "repository": { + "type": "git", + "url": "https://github.com/http-party/node-http-proxy.git" + }, + "description": "HTTP proxying for the masses", + "author": "Charlie Robbins ", + "maintainers": [ + "jcrugzz " + ], + "main": "index.js", + "dependencies": { + "eventemitter3": "^4.0.0", + "requires-port": "^1.0.0", + "follow-redirects": "^1.0.0" + }, + "devDependencies": { + "async": "^3.0.0", + "auto-changelog": "^1.15.0", + "concat-stream": "^2.0.0", + "expect.js": "~0.3.1", + "mocha": "^3.5.3", + "nyc": "^14.0.0", + "semver": "^5.0.3", + "socket.io": "^2.1.0", + "socket.io-client": "^2.1.0", + "sse": "0.0.8", + "ws": "^3.0.0" + }, + "scripts": { + "mocha": "mocha test/*-test.js", + "test": "nyc --reporter=text --reporter=lcov npm run mocha", + "version": "auto-changelog -p && git add CHANGELOG.md" + }, + "engines": { + "node": ">=8.0.0" + }, + "license": "MIT" +} diff --git a/tools/ui/node_modules/http-proxy/renovate.json b/tools/ui/node_modules/http-proxy/renovate.json new file mode 100644 index 0000000000000000000000000000000000000000..fc1d2aa3a079e46750d308044764497a5e604333 --- /dev/null +++ b/tools/ui/node_modules/http-proxy/renovate.json @@ -0,0 +1,19 @@ +{ + "platform": "github", + "autodiscover": false, + "requireConfig": true, + "ignoreNpmrcFile": true, + "rangeStrategy": "replace", + "packageRules": [ + { + "packagePatterns": [ + "*" + ], + "minor": { + "groupName": "all non-major dependencies", + "groupSlug": "all-minor-patch" + } + } + ], + "commitMessagePrefix": "[dist]" +} diff --git a/tools/ui/node_modules/http-server/LICENSE b/tools/ui/node_modules/http-server/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d918093bae06aa7d5bc4481b4ada8b9b21d6a3fb --- /dev/null +++ b/tools/ui/node_modules/http-server/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2011-2022 Charlie Robbins, Marak Squires, Jade Michael Thornton and the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/http-server/README.md b/tools/ui/node_modules/http-server/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0ffbbc1f0ef8eccb0d1d83d61d28749a152b03f3 --- /dev/null +++ b/tools/ui/node_modules/http-server/README.md @@ -0,0 +1,149 @@ +[![GitHub Workflow Status (master)](https://img.shields.io/github/workflow/status/http-party/http-server/Node.js%20CI/master?style=flat-square)](https://github.com/http-party/http-server/actions) +[![npm](https://img.shields.io/npm/v/http-server.svg?style=flat-square)](https://www.npmjs.com/package/http-server) [![homebrew](https://img.shields.io/homebrew/v/http-server?style=flat-square)](https://formulae.brew.sh/formula/http-server) [![npm downloads](https://img.shields.io/npm/dm/http-server?color=blue&label=npm%20downloads&style=flat-square)](https://www.npmjs.com/package/http-server) +[![license](https://img.shields.io/github/license/http-party/http-server.svg?style=flat-square)](https://github.com/http-party/http-server) + +# http-server: a simple static HTTP server + +`http-server` is a simple, zero-configuration command-line static HTTP server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development and learning. + +![Example of running http-server](https://github.com/http-party/http-server/raw/master/screenshots/public.png) + +## Installation: + +#### Running on-demand: + +Using `npx` you can run the script without installing it first: + + npx http-server [path] [options] + +#### Globally via `npm` + + npm install --global http-server + +This will install `http-server` globally so that it may be run from the command line anywhere. + +#### Globally via Homebrew + + brew install http-server + +#### As a dependency in your `npm` package: + + npm install http-server + +## Usage: + + http-server [path] [options] + +`[path]` defaults to `./public` if the folder exists, and `./` otherwise. + +*Now you can visit http://localhost:8080 to view your server* + +**Note:** Caching is on by default. Add `-c-1` as an option to disable caching. + +## Available Options: + +| Command | Description | Defaults | +| ------------- |-------------|-------------| +|`-p` or `--port` |Port to use. Use `-p 0` to look for an open port, starting at 8080. It will also read from `process.env.PORT`. |8080 | +|`-a` |Address to use |0.0.0.0| +|`-d` |Show directory listings |`true` | +|`-i` | Display autoIndex | `true` | +|`-g` or `--gzip` |When enabled it will serve `./public/some-file.js.gz` in place of `./public/some-file.js` when a gzipped version of the file exists and the request accepts gzip encoding. If brotli is also enabled, it will try to serve brotli first.|`false`| +|`-b` or `--brotli`|When enabled it will serve `./public/some-file.js.br` in place of `./public/some-file.js` when a brotli compressed version of the file exists and the request accepts `br` encoding. If gzip is also enabled, it will try to serve brotli first. |`false`| +|`-e` or `--ext` |Default file extension if none supplied |`html` | +|`-s` or `--silent` |Suppress log messages from output | | +|`--cors` |Enable CORS via the `Access-Control-Allow-Origin` header | | +|`-o [path]` |Open browser window after starting the server. Optionally provide a URL path to open. e.g.: -o /other/dir/ | | +|`-c` |Set cache time (in seconds) for cache-control max-age header, e.g. `-c10` for 10 seconds. To disable caching, use `-c-1`.|`3600` | +|`-U` or `--utc` |Use UTC time format in log messages.| | +|`--log-ip` |Enable logging of the client's IP address |`false` | +|`-P` or `--proxy` |Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com | | +|`--proxy-options` |Pass proxy [options](https://github.com/http-party/node-http-proxy#options) using nested dotted objects. e.g.: --proxy-options.secure false | +|`--username` |Username for basic authentication | | +|`--password` |Password for basic authentication | | +|`-S`, `--tls` or `--ssl` |Enable secure request serving with TLS/SSL (HTTPS)|`false`| +|`-C` or `--cert` |Path to ssl cert file |`cert.pem` | +|`-K` or `--key` |Path to ssl key file |`key.pem` | +|`-r` or `--robots` | Automatically provide a /robots.txt (The content of which defaults to `User-agent: *\nDisallow: /`) | `false` | +|`--no-dotfiles` |Do not show dotfiles| | +|`--mimetypes` |Path to a .types file for custom mimetype definition| | +|`-h` or `--help` |Print this list and exit. | | +|`-v` or `--version`|Print the version and exit. | | + +## Magic Files + +- `index.html` will be served as the default file to any directory requests. +- `404.html` will be served if a file is not found. This can be used for Single-Page App (SPA) hosting to serve the entry page. + +## Catch-all redirect + +To implement a catch-all redirect, use the index page itself as the proxy with: + +``` +http-server --proxy http://localhost:8080? +``` + +Note the `?` at the end of the proxy URL. Thanks to [@houston3](https://github.com/houston3) for this clever hack! + +## TLS/SSL + +First, you need to make sure that [openssl](https://github.com/openssl/openssl) is installed correctly, and you have `key.pem` and `cert.pem` files. You can generate them using this command: + +``` sh +openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem +``` + +You will be prompted with a few questions after entering the command. Use `127.0.0.1` as value for `Common name` if you want to be able to install the certificate in your OS's root certificate store or browser so that it is trusted. + +This generates a cert-key pair and it will be valid for 3650 days (about 10 years). + +Then you need to run the server with `-S` for enabling SSL and `-C` for your certificate file. + +``` sh +http-server -S -C cert.pem +``` + +If you wish to use a passphrase with your private key you can include one in the openssl command via the -passout parameter (using password of foobar) + + +e.g. +`openssl req -newkey rsa:2048 -passout pass:foobar -keyout key.pem -x509 -days 365 -out cert.pem` + +For security reasons, the passphrase will only be read from the `NODE_HTTP_SERVER_SSL_PASSPHRASE` environment variable. + + +This is what should be output if successful: + +``` sh +Starting up http-server, serving ./ through https + +http-server settings: +CORS: disabled +Cache: 3600 seconds +Connection Timeout: 120 seconds +Directory Listings: visible +AutoIndex: visible +Serve GZIP Files: false +Serve Brotli Files: false +Default File Extension: none + +Available on: + https://127.0.0.1:8080 + https://192.168.1.101:8080 + https://192.168.1.104:8080 +Hit CTRL-C to stop the server +``` + +# Development + +Checkout this repository locally, then: + +```sh +$ npm i +$ npm start +``` + +*Now you can visit http://localhost:8080 to view your server* + +You should see the turtle image in the screenshot above hosted at that URL. See +the `./public` folder for demo content. diff --git a/tools/ui/node_modules/http-server/bin/http-server b/tools/ui/node_modules/http-server/bin/http-server new file mode 100644 index 0000000000000000000000000000000000000000..7c597fa8ab82f173661ca1d6bbbc94b910d5d4e1 --- /dev/null +++ b/tools/ui/node_modules/http-server/bin/http-server @@ -0,0 +1,278 @@ +#!/usr/bin/env node + +'use strict'; + +var chalk = require('chalk'), + os = require('os'), + httpServer = require('../lib/http-server'), + portfinder = require('portfinder'), + opener = require('opener'), + + fs = require('fs'), + url = require('url'); +var argv = require('minimist')(process.argv.slice(2), { + alias: { + tls: 'ssl' + } +}); +var ifaces = os.networkInterfaces(); + +process.title = 'http-server'; + +if (argv.h || argv.help) { + console.log([ + 'usage: http-server [path] [options]', + '', + 'options:', + ' -p --port Port to use. If 0, look for open port. [8080]', + ' -a Address to use [0.0.0.0]', + ' -d Show directory listings [true]', + ' -i Display autoIndex [true]', + ' -g --gzip Serve gzip files when possible [false]', + ' -b --brotli Serve brotli files when possible [false]', + ' If both brotli and gzip are enabled, brotli takes precedence', + ' -e --ext Default file extension if none supplied [none]', + ' -s --silent Suppress log messages from output', + ' --cors[=headers] Enable CORS via the "Access-Control-Allow-Origin" header', + ' Optionally provide CORS headers list separated by commas', + ' -o [path] Open browser window after starting the server.', + ' Optionally provide a URL path to open the browser window to.', + ' -c Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.', + ' To disable caching, use -c-1.', + ' -t Connections timeout in seconds [120], e.g. -t60 for 1 minute.', + ' To disable timeout, use -t0', + ' -U --utc Use UTC time format in log messages.', + ' --log-ip Enable logging of the client\'s IP address', + '', + ' -P --proxy Fallback proxy if the request cannot be resolved. e.g.: http://someurl.com', + ' --proxy-options Pass options to proxy using nested dotted objects. e.g.: --proxy-options.secure false', + '', + ' --username Username for basic authentication [none]', + ' Can also be specified with the env variable NODE_HTTP_SERVER_USERNAME', + ' --password Password for basic authentication [none]', + ' Can also be specified with the env variable NODE_HTTP_SERVER_PASSWORD', + '', + ' -S --tls --ssl Enable secure request serving with TLS/SSL (HTTPS)', + ' -C --cert Path to TLS cert file (default: cert.pem)', + ' -K --key Path to TLS key file (default: key.pem)', + '', + ' -r --robots Respond to /robots.txt [User-agent: *\\nDisallow: /]', + ' --no-dotfiles Do not show dotfiles', + ' --mimetypes Path to a .types file for custom mimetype definition', + ' -h --help Print this list and exit.', + ' -v --version Print the version and exit.' + ].join('\n')); + process.exit(); +} + +var port = argv.p || argv.port || parseInt(process.env.PORT, 10), + host = argv.a || '0.0.0.0', + tls = argv.S || argv.tls, + sslPassphrase = process.env.NODE_HTTP_SERVER_SSL_PASSPHRASE, + proxy = argv.P || argv.proxy, + proxyOptions = argv['proxy-options'], + utc = argv.U || argv.utc, + version = argv.v || argv.version, + logger; + +var proxyOptionsBooleanProps = [ + 'ws', 'xfwd', 'secure', 'toProxy', 'prependPath', 'ignorePath', 'changeOrigin', + 'preserveHeaderKeyCase', 'followRedirects', 'selfHandleResponse' +]; + +if (proxyOptions) { + Object.keys(proxyOptions).forEach(function (key) { + if (proxyOptionsBooleanProps.indexOf(key) > -1) { + proxyOptions[key] = proxyOptions[key].toLowerCase() === 'true'; + } + }); +} + +if (!argv.s && !argv.silent) { + logger = { + info: console.log, + request: function (req, res, error) { + var date = utc ? new Date().toUTCString() : new Date(); + var ip = argv['log-ip'] + ? req.headers['x-forwarded-for'] || '' + req.connection.remoteAddress + : ''; + if (error) { + logger.info( + '[%s] %s "%s %s" Error (%s): "%s"', + date, ip, chalk.red(req.method), chalk.red(req.url), + chalk.red(error.status.toString()), chalk.red(error.message) + ); + } + else { + logger.info( + '[%s] %s "%s %s" "%s"', + date, ip, chalk.cyan(req.method), chalk.cyan(req.url), + req.headers['user-agent'] + ); + } + } + }; +} +else if (chalk) { + logger = { + info: function () {}, + request: function () {} + }; +} + +if (version) { + logger.info('v' + require('../package.json').version); + process.exit(); +} + +if (!port) { + portfinder.basePort = 8080; + portfinder.getPort(function (err, port) { + if (err) { throw err; } + listen(port); + }); +} +else { + listen(port); +} + +function listen(port) { + var options = { + root: argv._[0], + cache: argv.c, + timeout: argv.t, + showDir: argv.d, + autoIndex: argv.i, + gzip: argv.g || argv.gzip, + brotli: argv.b || argv.brotli, + robots: argv.r || argv.robots, + ext: argv.e || argv.ext, + logFn: logger.request, + proxy: proxy, + proxyOptions: proxyOptions, + showDotfiles: argv.dotfiles, + mimetypes: argv.mimetypes, + username: argv.username || process.env.NODE_HTTP_SERVER_USERNAME, + password: argv.password || process.env.NODE_HTTP_SERVER_PASSWORD + }; + + if (argv.cors) { + options.cors = true; + if (typeof argv.cors === 'string') { + options.corsHeaders = argv.cors; + } + } + + if (proxy) { + try { + new url.URL(proxy) + } + catch (err) { + logger.info(chalk.red('Error: Invalid proxy url')); + process.exit(1); + } + } + + if (tls) { + options.https = { + cert: argv.C || argv.cert || 'cert.pem', + key: argv.K || argv.key || 'key.pem', + passphrase: sslPassphrase, + }; + try { + fs.lstatSync(options.https.cert); + } + catch (err) { + logger.info(chalk.red('Error: Could not find certificate ' + options.https.cert)); + process.exit(1); + } + try { + fs.lstatSync(options.https.key); + } + catch (err) { + logger.info(chalk.red('Error: Could not find private key ' + options.https.key)); + process.exit(1); + } + } + + var server = httpServer.createServer(options); + server.listen(port, host, function () { + var protocol = tls ? 'https://' : 'http://'; + + logger.info([ + chalk.yellow('Starting up http-server, serving '), + chalk.cyan(server.root), + tls ? (chalk.yellow(' through') + chalk.cyan(' https')) : '' + ].join('')); + + logger.info([chalk.yellow('\nhttp-server version: '), chalk.cyan(require('../package.json').version)].join('')); + + logger.info([ + chalk.yellow('\nhttp-server settings: '), + ([chalk.yellow('CORS: '), argv.cors ? chalk.cyan(argv.cors) : chalk.red('disabled')].join('')), + ([chalk.yellow('Cache: '), argv.c ? (argv.c === '-1' ? chalk.red('disabled') : chalk.cyan(argv.c + ' seconds')) : chalk.cyan('3600 seconds')].join('')), + ([chalk.yellow('Connection Timeout: '), argv.t === '0' ? chalk.red('disabled') : (argv.t ? chalk.cyan(argv.t + ' seconds') : chalk.cyan('120 seconds'))].join('')), + ([chalk.yellow('Directory Listings: '), argv.d ? chalk.red('not visible') : chalk.cyan('visible')].join('')), + ([chalk.yellow('AutoIndex: '), argv.i ? chalk.red('not visible') : chalk.cyan('visible')].join('')), + ([chalk.yellow('Serve GZIP Files: '), argv.g || argv.gzip ? chalk.cyan('true') : chalk.red('false')].join('')), + ([chalk.yellow('Serve Brotli Files: '), argv.b || argv.brotli ? chalk.cyan('true') : chalk.red('false')].join('')), + ([chalk.yellow('Default File Extension: '), argv.e ? chalk.cyan(argv.e) : (argv.ext ? chalk.cyan(argv.ext) : chalk.red('none'))].join('')) + ].join('\n')); + + logger.info(chalk.yellow('\nAvailable on:')); + + if (argv.a && host !== '0.0.0.0') { + logger.info(` ${protocol}${host}:${chalk.green(port.toString())}`); + } else { + Object.keys(ifaces).forEach(function (dev) { + ifaces[dev].forEach(function (details) { + if (details.family === 'IPv4') { + logger.info((' ' + protocol + details.address + ':' + chalk.green(port.toString()))); + } + }); + }); + } + + if (typeof proxy === 'string') { + if (proxyOptions) { + logger.info('Unhandled requests will be served from: ' + proxy + '. Options: ' + JSON.stringify(proxyOptions)); + } + else { + logger.info('Unhandled requests will be served from: ' + proxy); + } + } + + logger.info('Hit CTRL-C to stop the server'); + if (argv.o) { + const openHost = host === '0.0.0.0' ? '127.0.0.1' : host; + let openUrl = `${protocol}${openHost}:${port}`; + if (typeof argv.o === 'string') { + openUrl += argv.o[0] === '/' ? argv.o : '/' + argv.o; + } + logger.info('Open: ' + openUrl); + opener(openUrl); + } + + // Spacing before logs + if (!argv.s) logger.info(); + }); +} + +if (process.platform === 'win32') { + require('readline').createInterface({ + input: process.stdin, + output: process.stdout + }).on('SIGINT', function () { + process.emit('SIGINT'); + }); +} + +process.on('SIGINT', function () { + logger.info(chalk.red('http-server stopped.')); + process.exit(); +}); + +process.on('SIGTERM', function () { + logger.info(chalk.red('http-server stopped.')); + process.exit(); +}); diff --git a/tools/ui/node_modules/http-server/doc/http-server.1 b/tools/ui/node_modules/http-server/doc/http-server.1 new file mode 100644 index 0000000000000000000000000000000000000000..8e2796e6e326d0587dd2dc40848c8173bed9e287 --- /dev/null +++ b/tools/ui/node_modules/http-server/doc/http-server.1 @@ -0,0 +1,165 @@ +.TH http-server 1 "April 2020" GNU "http-server man page" + +.SH NAME +http-server \- a simple zero-configuration command-line http server + +.SH SYNOPSIS +.B http-server +[\fIPATH\fR] +[\fIOPTIONS\fR] + +.SH DESCRIPTION +\fBhttp-server\fR is a simple, zero-configuration command-line http server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning. + +.SH OPTIONS + +.TP +.BI [\fIPATH\fR] +The directory to serve. +Defaults to ./public if it exists, and ./ otherwise. + +.TP +.BI \-p ", " \-\-port " " \fIPORT\fR +Port to use. If 0, look for the first available port, starting at 8080. +Default is 8080. + +.TP +.BI \-a " " \fIADDRESS\fR +Address to use. +Default is 0.0.0.0. + +.TP +.BI \-d +Show directory listings. +Default is true. + +.TP +.BI \-i +Display autoIndex. +Default is true. + +.TP +.BI \-g ", " \-\-gzip +Serve gzip files when possible. +Default is false. + +.TP +.BI \-b ", " \-\-brotli +Serve brotli files when possible. +If both brotli and gzip are enabled, brotli takes precedence. +Default is false. + +.TP +.BI \-e ", " \-\-ext " " \fIEXTENSION\fR +Default file extension is none is provided. + +.TP +.BI \-s ", " \-\-silent +Suppress log messages from output. + +.TP +.BI \-\-cors " " [\fIHEADERS\fR] +Enable CORS via the "Access-Control-Allow-Origin" header. +Optionally provide CORS headers list separated by commas. + +.TP +.BI \-o " " [\fIPATH\fR] +Open default browser window after starting the server. +Optionally provide a URL path to open the browser window to. + +.TP +.BI \-c " " \fITIME\fR +Cache time (max-age) in seconds. +To disable caching, use \-c \-1. +Default is 3600. + +.TP +.BI \-U ", " \-\-utc +Use UTC time format in log messages. + +.TP +.BI \-\-log\-ip +Enable logging of the client IP address. + +.TP +.BI \-P ", " \-\-proxy +Fallback proxy if the request cannot be resolved. + +.TP +.BI \-\-proxy\-options +Pass proxy options using nested dotted objects. + +.TP +.BI \-\-username " " \fIUSERNAME\fR +Username for basic authentication. +Can also be specified with the environment variable NODE_HTTP_SERVER_USERNAME. +Defaults to none. + +.TP +.BI \-\-password " " \fIPASSWORD\fR +Password for basic authentication. +Can also be specified with the environment variable NODE_HTTP_SERVER_PASSWORD. +Defaults to none. + +.TP +.BI \-S ", " \-\-tls ", " \-\-ssl +Enable https. + +.TP +.BI \-C ", " \-\-cert " " [\fIFILE\fR] +Path to SSL certificate file. +If not specified, uses cert.pem. + +.TP +.BI \-K ", " \-\-key " " [\fIFILE\fR] +Path to SSL key file. +If not specified, uses key.pem. +Passphrase will be read from NODE_HTTP_SERVER_SSL_PASSPHRASE (if set) + +.TP +.BI \-r ", " \-\-robots " " [\fIUSER\-AGENT\fR] +Respond to /robots.txt request. +If not specified, uses "User-agent: *\\nDisallow: /]" + +.TP +.BI \-\-no\-dotfiles +Do not show dotfiles. + +.TP +.BI \-h ", " \-\-help +Print usage and exit. + +.TP +.BI \-v ", " \-\-version +Print version and exit. + +.SH FILES +.B index.html +will be served as the default file to any directory requests. + +.B 404.html +will be served if a file is not found. This can be used for SPA hosting to serve the entry page. + +.SH COPYING +Copyright (c) 2011-2022 Charlie Robbins, Marak Squires, and the Contributors. +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +.SH VERSION +Version 0.12.2 diff --git a/tools/ui/node_modules/http-server/lib/core/aliases.json b/tools/ui/node_modules/http-server/lib/core/aliases.json new file mode 100644 index 0000000000000000000000000000000000000000..53a22a5693b6d49e87065233091836b3250cfaa5 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/aliases.json @@ -0,0 +1,34 @@ +{ + "autoIndex": [ "autoIndex", "autoindex" ], + "showDir": [ "showDir", "showdir" ], + "showDotfiles": ["showDotfiles", "showdotfiles"], + "humanReadable": [ "humanReadable", "humanreadable", "human-readable" ], + "hidePermissions": ["hidePermissions", "hidepermissions", "hide-permissions"], + "si": [ "si", "index" ], + "handleError": [ "handleError", "handleerror" ], + "cors": [ "cors", "CORS" ], + "headers": [ "H", "header", "headers" ], + "contentType": [ "contentType", "contenttype", "content-type" ], + "mimeType": [ + "mimetype", + "mimetypes", + "mimeType", + "mimeTypes", + "mime-type", + "mime-types", + "mime-Type", + "mime-Types" + ], + "weakEtags": [ "weakEtags", "weaketags", "weak-etags" ], + "weakCompare": [ + "weakcompare", + "weakCompare", + "weak-compare", + "weak-Compare" + ], + "handleOptionsMethod": [ + "handleOptionsMethod", + "handleoptionsmethod", + "handle-options-method" + ] +} diff --git a/tools/ui/node_modules/http-server/lib/core/defaults.json b/tools/ui/node_modules/http-server/lib/core/defaults.json new file mode 100644 index 0000000000000000000000000000000000000000..d919f2920fd0d50ef3a17033b2c9a1389ac7fcec --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/defaults.json @@ -0,0 +1,18 @@ +{ + "autoIndex": true, + "showDir": true, + "showDotfiles": true, + "humanReadable": true, + "hidePermissions": false, + "si": false, + "cache": "max-age=3600", + "cors": false, + "gzip": true, + "brotli": false, + "defaultExt": ".html", + "handleError": true, + "contentType": "application/octet-stream", + "weakEtags": true, + "weakCompare": true, + "handleOptionsMethod": false +} diff --git a/tools/ui/node_modules/http-server/lib/core/etag.js b/tools/ui/node_modules/http-server/lib/core/etag.js new file mode 100644 index 0000000000000000000000000000000000000000..d3cddedfc59757f2586210945356879e1c09cd66 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/etag.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = (stat, weakEtag) => { + let etag = `"${[stat.ino, stat.size, stat.mtime.toISOString()].join('-')}"`; + if (weakEtag) { + etag = `W/${etag}`; + } + return etag; +}; diff --git a/tools/ui/node_modules/http-server/lib/core/index.js b/tools/ui/node_modules/http-server/lib/core/index.js new file mode 100644 index 0000000000000000000000000000000000000000..920e55b9c01222c280b7f629ab4c8aaac8a987f7 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/index.js @@ -0,0 +1,487 @@ +#! /usr/bin/env node + +'use strict'; + +const path = require('path'); +const fs = require('fs'); +const url = require('url'); +const { Readable } = require('stream'); +const buffer = require('buffer'); +const mime = require('mime'); +const urlJoin = require('url-join'); +const showDir = require('./show-dir'); +const version = require('../../package.json').version; +const status = require('./status-handlers'); +const generateEtag = require('./etag'); +const optsParser = require('./opts'); +const htmlEncodingSniffer = require('html-encoding-sniffer'); + +let httpServerCore = null; + +function decodePathname(pathname) { + const pieces = pathname.replace(/\\/g, '/').split('/'); + + const normalized = path.normalize(pieces.map((rawPiece) => { + const piece = decodeURIComponent(rawPiece); + + if (process.platform === 'win32' && /\\/.test(piece)) { + throw new Error('Invalid forward slash character'); + } + + return piece; + }).join('/')); + return process.platform === 'win32' + ? normalized.replace(/\\/g, '/') : normalized; +} + +const nonUrlSafeCharsRgx = /[\x00-\x1F\x20\x7F-\uFFFF]+/g; +function ensureUriEncoded(text) { + return text + return String(text).replace(nonUrlSafeCharsRgx, encodeURIComponent); +} + +// Check to see if we should try to compress a file with gzip. +function shouldCompressGzip(req) { + const headers = req.headers; + + return headers && headers['accept-encoding'] && + headers['accept-encoding'] + .split(',') + .some(el => ['*', 'compress', 'gzip', 'deflate'].indexOf(el.trim()) !== -1) + ; +} + +function shouldCompressBrotli(req) { + const headers = req.headers; + + return headers && headers['accept-encoding'] && + headers['accept-encoding'] + .split(',') + .some(el => ['*', 'br'].indexOf(el.trim()) !== -1) + ; +} + +function hasGzipId12(gzipped, cb) { + const stream = fs.createReadStream(gzipped, { start: 0, end: 1 }); + let buffer = Buffer.from(''); + let hasBeenCalled = false; + + stream.on('data', (chunk) => { + buffer = Buffer.concat([buffer, chunk], 2); + }); + + stream.on('error', (err) => { + if (hasBeenCalled) { + throw err; + } + + hasBeenCalled = true; + cb(err); + }); + + stream.on('close', () => { + if (hasBeenCalled) { + return; + } + + hasBeenCalled = true; + cb(null, buffer[0] === 31 && buffer[1] === 139); + }); +} + + +module.exports = function createMiddleware(_dir, _options) { + let dir; + let options; + if (typeof _dir === 'string') { + dir = _dir; + options = _options; + } else { + options = _dir; + dir = options.root; + } + + const root = path.join(path.resolve(dir), '/'); + const opts = optsParser(options); + const cache = opts.cache; + const autoIndex = opts.autoIndex; + const baseDir = opts.baseDir; + let defaultExt = opts.defaultExt; + const handleError = opts.handleError; + const headers = opts.headers; + const weakEtags = opts.weakEtags; + const handleOptionsMethod = opts.handleOptionsMethod; + + opts.root = dir; + if (defaultExt && /^\./.test(defaultExt)) { + defaultExt = defaultExt.replace(/^\./, ''); + } + + // Support hashes and .types files in mimeTypes @since 0.8 + if (opts.mimeTypes) { + try { + // You can pass a JSON blob here---useful for CLI use + opts.mimeTypes = JSON.parse(opts.mimeTypes); + } catch (e) { + // swallow parse errors, treat this as a string mimetype input + } + if (typeof opts.mimeTypes === 'string') { + mime.load(opts.mimeTypes); + } else if (typeof opts.mimeTypes === 'object') { + mime.define(opts.mimeTypes); + } + } + + function shouldReturn304(req, serverLastModified, serverEtag) { + if (!req || !req.headers) { + return false; + } + + const clientModifiedSince = req.headers['if-modified-since']; + const clientEtag = req.headers['if-none-match']; + let clientModifiedDate; + + if (!clientModifiedSince && !clientEtag) { + // Client did not provide any conditional caching headers + return false; + } + + if (clientModifiedSince) { + // Catch "illegal access" dates that will crash v8 + try { + clientModifiedDate = new Date(Date.parse(clientModifiedSince)); + } catch (err) { + return false; + } + + if (clientModifiedDate.toString() === 'Invalid Date') { + return false; + } + // If the client's copy is older than the server's, don't return 304 + if (clientModifiedDate < new Date(serverLastModified)) { + return false; + } + } + + if (clientEtag) { + // Do a strong or weak etag comparison based on setting + // https://www.ietf.org/rfc/rfc2616.txt Section 13.3.3 + if (opts.weakCompare && clientEtag !== serverEtag + && clientEtag !== `W/${serverEtag}` && `W/${clientEtag}` !== serverEtag) { + return false; + } + if (!opts.weakCompare && (clientEtag !== serverEtag || clientEtag.indexOf('W/') === 0)) { + return false; + } + } + + return true; + } + + return function middleware(req, res, next) { + // Figure out the path for the file from the given url + const parsed = url.parse(req.url); + let pathname = null; + let file = null; + let gzippedFile = null; + let brotliFile = null; + + try { + decodeURIComponent(req.url); // check validity of url + pathname = decodePathname(parsed.pathname); + } catch (err) { + status[400](res, next, { error: err }); + return; + } + + file = path.normalize( + path.join( + root, + path.relative(path.join('/', baseDir), pathname) + ) + ); + // determine compressed forms if they were to exist + gzippedFile = `${file}.gz`; + brotliFile = `${file}.br`; + + Object.keys(headers).forEach((key) => { + res.setHeader(key, headers[key]); + }); + + if (req.method === 'OPTIONS' && handleOptionsMethod) { + res.end(); + return; + } + + // TODO: This check is broken, which causes the 403 on the + // expected 404. + if (file.slice(0, root.length) !== root) { + status[403](res, next); + return; + } + + if (req.method && (req.method !== 'GET' && req.method !== 'HEAD')) { + status[405](res, next); + return; + } + + + function serve(stat) { + // Do a MIME lookup, fall back to octet-stream and handle gzip + // and brotli special case. + const defaultType = opts.contentType || 'application/octet-stream'; + let contentType = mime.lookup(file, defaultType); + const range = (req.headers && req.headers.range); + const lastModified = (new Date(stat.mtime)).toUTCString(); + const etag = generateEtag(stat, weakEtags); + let cacheControl = cache; + let stream = null; + if (contentType && isTextFile(contentType)) { + if (stat.size < buffer.constants.MAX_LENGTH) { + const bytes = fs.readFileSync(file); + const sniffedEncoding = htmlEncodingSniffer(bytes, { + defaultEncoding: 'UTF-8' + }); + contentType += `; charset=${sniffedEncoding}`; + stream = Readable.from(bytes) + } else { + // Assume text types are utf8 + contentType += '; charset=UTF-8'; + } + } + + if (file === gzippedFile) { // is .gz picked up + res.setHeader('Content-Encoding', 'gzip'); + // strip gz ending and lookup mime type + contentType = mime.lookup(path.basename(file, '.gz'), defaultType); + } else if (file === brotliFile) { // is .br picked up + res.setHeader('Content-Encoding', 'br'); + // strip br ending and lookup mime type + contentType = mime.lookup(path.basename(file, '.br'), defaultType); + } + + if (typeof cacheControl === 'function') { + cacheControl = cache(pathname); + } + if (typeof cacheControl === 'number') { + cacheControl = `max-age=${cacheControl}`; + } + + if (range) { + const total = stat.size; + const parts = range.trim().replace(/bytes=/, '').split('-'); + const partialstart = parts[0]; + const partialend = parts[1]; + const start = parseInt(partialstart, 10); + const end = Math.min( + total - 1, + partialend ? parseInt(partialend, 10) : total - 1 + ); + const chunksize = (end - start) + 1; + let fstream = null; + + if (start > end || isNaN(start) || isNaN(end)) { + status['416'](res, next); + return; + } + + fstream = fs.createReadStream(file, { start, end }); + fstream.on('error', (err) => { + status['500'](res, next, { error: err }); + }); + res.on('close', () => { + fstream.destroy(); + }); + res.writeHead(206, { + 'Content-Range': `bytes ${start}-${end}/${total}`, + 'Accept-Ranges': 'bytes', + 'Content-Length': chunksize, + 'Content-Type': contentType, + 'cache-control': cacheControl, + 'last-modified': lastModified, + etag, + }); + fstream.pipe(res); + return; + } + + // TODO: Helper for this, with default headers. + res.setHeader('cache-control', cacheControl); + res.setHeader('last-modified', lastModified); + res.setHeader('etag', etag); + + // Return a 304 if necessary + if (shouldReturn304(req, lastModified, etag)) { + status[304](res, next); + return; + } + + res.setHeader('content-length', stat.size); + res.setHeader('content-type', contentType); + + // set the response statusCode if we have a request statusCode. + // This only can happen if we have a 404 with some kind of 404.html + // In all other cases where we have a file we serve the 200 + res.statusCode = req.statusCode || 200; + + if (req.method === 'HEAD') { + res.end(); + return; + } + + // stream may already have been assigned during encoding sniffing. + if (stream === null) { + stream = fs.createReadStream(file); + } + + stream.pipe(res); + stream.on('error', (err) => { + status['500'](res, next, { error: err }); + }); + stream.on('close', () => { + stream.destroy(); + }) + } + + + function statFile() { + try { + fs.stat(file, (err, stat) => { + if (err && (err.code === 'ENOENT' || err.code === 'ENOTDIR')) { + if (req.statusCode === 404) { + // This means we're already trying ./404.html and can not find it. + // So send plain text response with 404 status code + status[404](res, next); + } else if (!path.extname(parsed.pathname).length && defaultExt) { + // If there is no file extension in the path and we have a default + // extension try filename and default extension combination before rendering 404.html. + middleware({ + url: `${parsed.pathname}.${defaultExt}${(parsed.search) ? parsed.search : ''}`, + headers: req.headers, + }, res, next); + } else { + // Try to serve default ./404.html + const rawUrl = (handleError ? `/${path.join(baseDir, `404.${defaultExt}`)}` : req.url); + const encodedUrl = ensureUriEncoded(rawUrl); + middleware({ + url: encodedUrl, + headers: req.headers, + statusCode: 404, + }, res, next); + } + } else if (err) { + status[500](res, next, { error: err }); + } else if (stat.isDirectory()) { + if (!autoIndex && !opts.showDir) { + status[404](res, next); + return; + } + + + // 302 to / if necessary + if (!pathname.match(/\/$/)) { + res.statusCode = 302; + const q = parsed.query ? `?${parsed.query}` : ''; + res.setHeader( + 'location', + ensureUriEncoded(`${parsed.pathname}/${q}`) + ); + res.end(); + return; + } + + if (autoIndex) { + middleware({ + url: urlJoin( + encodeURIComponent(pathname), + `/index.${defaultExt}` + ), + headers: req.headers, + }, res, (autoIndexError) => { + if (autoIndexError) { + status[500](res, next, { error: autoIndexError }); + return; + } + if (opts.showDir) { + showDir(opts, stat)(req, res); + return; + } + + status[403](res, next); + }); + return; + } + + if (opts.showDir) { + showDir(opts, stat)(req, res); + } + } else { + serve(stat); + } + }); + } catch (err) { + status[500](res, next, { error: err.message }); + } + } + + function isTextFile(mimeType) { + return (/^text\/|^application\/(javascript|json)/).test(mimeType); + } + + // serve gzip file if exists and is valid + function tryServeWithGzip() { + try { + fs.stat(gzippedFile, (err, stat) => { + if (!err && stat.isFile()) { + hasGzipId12(gzippedFile, (gzipErr, isGzip) => { + if (!gzipErr && isGzip) { + file = gzippedFile; + serve(stat); + } else { + statFile(); + } + }); + } else { + statFile(); + } + }); + } catch (err) { + status[500](res, next, { error: err.message }); + } + } + + // serve brotli file if exists, otherwise try gzip + function tryServeWithBrotli(shouldTryGzip) { + try { + fs.stat(brotliFile, (err, stat) => { + if (!err && stat.isFile()) { + file = brotliFile; + serve(stat); + } else if (shouldTryGzip) { + tryServeWithGzip(); + } else { + statFile(); + } + }); + } catch (err) { + status[500](res, next, { error: err.message }); + } + } + + const shouldTryBrotli = opts.brotli && shouldCompressBrotli(req); + const shouldTryGzip = opts.gzip && shouldCompressGzip(req); + // always try brotli first, next try gzip, finally serve without compression + if (shouldTryBrotli) { + tryServeWithBrotli(shouldTryGzip); + } else if (shouldTryGzip) { + tryServeWithGzip(); + } else { + statFile(); + } + }; +}; + + +httpServerCore = module.exports; +httpServerCore.version = version; +httpServerCore.showDir = showDir; diff --git a/tools/ui/node_modules/http-server/lib/core/opts.js b/tools/ui/node_modules/http-server/lib/core/opts.js new file mode 100644 index 0000000000000000000000000000000000000000..ec1b2cbc45814a2ad9c3a7f7d153cbebf94019cd --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/opts.js @@ -0,0 +1,203 @@ +'use strict'; + +// This is so you can have options aliasing and defaults in one place. + +const defaults = require('./defaults.json'); +const aliases = require('./aliases.json'); + +module.exports = (opts) => { + let autoIndex = defaults.autoIndex; + let showDir = defaults.showDir; + let showDotfiles = defaults.showDotfiles; + let humanReadable = defaults.humanReadable; + let hidePermissions = defaults.hidePermissions; + let si = defaults.si; + let cache = defaults.cache; + let gzip = defaults.gzip; + let brotli = defaults.brotli; + let defaultExt = defaults.defaultExt; + let handleError = defaults.handleError; + const headers = {}; + let contentType = defaults.contentType; + let mimeTypes; + let weakEtags = defaults.weakEtags; + let weakCompare = defaults.weakCompare; + let handleOptionsMethod = defaults.handleOptionsMethod; + + function isDeclared(k) { + return typeof opts[k] !== 'undefined' && opts[k] !== null; + } + + function setHeader(str) { + const m = /^(.+?)\s*:\s*(.*)$/.exec(str); + if (!m) { + headers[str] = true; + } else { + headers[m[1]] = m[2]; + } + } + + + if (opts) { + aliases.autoIndex.some((k) => { + if (isDeclared(k)) { + autoIndex = opts[k]; + return true; + } + return false; + }); + + aliases.showDir.some((k) => { + if (isDeclared(k)) { + showDir = opts[k]; + return true; + } + return false; + }); + + aliases.showDotfiles.some((k) => { + if (isDeclared(k)) { + showDotfiles = opts[k]; + return true; + } + return false; + }); + + aliases.humanReadable.some((k) => { + if (isDeclared(k)) { + humanReadable = opts[k]; + return true; + } + return false; + }); + + aliases.hidePermissions.some((k) => { + if (isDeclared(k)) { + hidePermissions = opts[k]; + return true; + } + return false; + }); + + aliases.si.some((k) => { + if (isDeclared(k)) { + si = opts[k]; + return true; + } + return false; + }); + + if (opts.defaultExt && typeof opts.defaultExt === 'string') { + defaultExt = opts.defaultExt; + } + + if (typeof opts.cache !== 'undefined' && opts.cache !== null) { + if (typeof opts.cache === 'string') { + cache = opts.cache; + } else if (typeof opts.cache === 'number') { + cache = `max-age=${opts.cache}`; + } else if (typeof opts.cache === 'function') { + cache = opts.cache; + } + } + + if (typeof opts.gzip !== 'undefined' && opts.gzip !== null) { + gzip = opts.gzip; + } + + if (typeof opts.brotli !== 'undefined' && opts.brotli !== null) { + brotli = opts.brotli; + } + + aliases.handleError.some((k) => { + if (isDeclared(k)) { + handleError = opts[k]; + return true; + } + return false; + }); + + aliases.cors.forEach((k) => { + if (isDeclared(k) && opts[k]) { + handleOptionsMethod = true; + headers['Access-Control-Allow-Origin'] = '*'; + headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since'; + } + }); + + aliases.headers.forEach((k) => { + if (isDeclared(k)) { + if (Array.isArray(opts[k])) { + opts[k].forEach(setHeader); + } else if (opts[k] && typeof opts[k] === 'object') { + Object.keys(opts[k]).forEach((key) => { + headers[key] = opts[k][key]; + }); + } else { + setHeader(opts[k]); + } + } + }); + + aliases.contentType.some((k) => { + if (isDeclared(k)) { + contentType = opts[k]; + return true; + } + return false; + }); + + aliases.mimeType.some((k) => { + if (isDeclared(k)) { + mimeTypes = opts[k]; + return true; + } + return false; + }); + + aliases.weakEtags.some((k) => { + if (isDeclared(k)) { + weakEtags = opts[k]; + return true; + } + return false; + }); + + aliases.weakCompare.some((k) => { + if (isDeclared(k)) { + weakCompare = opts[k]; + return true; + } + return false; + }); + + aliases.handleOptionsMethod.some((k) => { + if (isDeclared(k)) { + handleOptionsMethod = handleOptionsMethod || opts[k]; + return true; + } + return false; + }); + } + + return { + cache, + autoIndex, + showDir, + showDotfiles, + humanReadable, + hidePermissions, + si, + defaultExt, + baseDir: (opts && opts.baseDir) || '/', + gzip, + brotli, + handleError, + headers, + contentType, + mimeTypes, + weakEtags, + weakCompare, + handleOptionsMethod, + }; +}; diff --git a/tools/ui/node_modules/http-server/lib/core/show-dir/icons.json b/tools/ui/node_modules/http-server/lib/core/show-dir/icons.json new file mode 100644 index 0000000000000000000000000000000000000000..afac0a0872c1ad7f9b677871d58583833b157977 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/show-dir/icons.json @@ -0,0 +1,65 @@ +{ + "_blank": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNqEUj1LxEAQnd1MVA4lyIEWx6UIKEGUExGsbC3tLfwJ/hT/g7VlCnubqxXBwg/Q4hQP/LhKL5nZuBsvuGfW5MGyuzM7jzdvVuR5DgYnZ+f99ai7Vt5t9K9unu4HLweI3qWYxI6PDosdy0fhcntxO44CcOBzPA7mfEyuHwf7ntQk4jcnywOxIlfxOCNYaLVgb6cXbkTdhJXq2SIlNMC0xIqhHczDbi8OVzpLSUa0WebRfmigLHqj1EcPZnwf7gbDIrYVRyEinurj6jTBHyI7pqVrFQqEbt6TEmZ9v1NRAJNC1xTYxIQh/MmRUlmFQE3qWOW1nqB2TWk1/3tgJV0waVvkFIEeZbHq4ElyKzAmEXOx6gnEVJuWBzmkRJBRPYGZBDsVaOlpSgVJE2yVaAe/0kx/3azBRO0VsbMFZE3CDSZKweZfYIVg+DZ6v7h9GDVOwZPw/PoxKu/fAgwALbDAXf7DdQkAAAAASUVORK5CYII=", + "_page": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmhJREFUeNpsUztv01AYPfdhOy/XTZ80VV1VoCqlA2zQqUgwMEErWBALv4GJDfEDmOEHsFTqVCTExAiiSI2QEKJKESVFFBWo04TESRzfy2c7LY/kLtf2d8+555zvM9NaI1ora5svby9OnbUEBxgDlIKiWjXQeLy19/X17sEtcPY2rtHS96/Hu0RvXXLz+cUzM87zShsI29DpHCYt4E6Box4IZzTnbDx7V74GjhOSfwgE0H2638K9h08A3iHGVbjTw7g6YmAyw/BgecHNGGJjvfQhIfmfIFDAXJpjuugi7djIFVI4P0plctgJQ0xnFe5eOO02OwEp2VkhSCnC8WOCdqgwnzFx4/IyppwRVN+XYXsecqZA1pB48ekAnw9/4GZx3L04N/GoTwEjX4cNH5vlPfjtAIYp8cWrQutxrC5Mod3VsXVTMFSqtaE+gl9dhaUxE2tXZiF7nYiiatJ3v5s8R/1yOCNLOuwjkELiTbmC9dJHpIaGASsDkoFQGJQwHWMcHWJYOmUj1OjvQotuytt5nHMLEGkCyx6QU384jwkUAd2sxJbS/QShZtg/8rHzzQOzSaFhxQrA6YgQMQHojCUlgnCAAvKFBoXXaHfArSCZDE0gyWJgFIKmvUFKO4MUNIk2a4+hODtDUVuJ/J732AKS6ZtImdTyAQQB3bZN8l9t75IFh0JMUdVKsohsUPqRgnka0tYgggYpCHkKGTsHI5NOMojB4iTICCepvX53AIEfQta1iUCmoTiBmdEri2RgddKFhuJoqb/af/yw/d3zTNM6UkaOfis62aUgddAbnz+rXuPY+Vnzjt9/CzAAbmLjCrfBiRgAAAAASUVORK5CYII=", + "aac": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnhJREFUeNp0Uk1PE0EYftruVlvAUkhVEPoBcsEoLRJBY01MPHjCs3cvogcT/4qJJN5NvHhoohcOnPw4YEGIkCh+oLGBKm3Z7nZ3dme2vjOhTcjiJJvZzPvOM8/HG2q325Dr3kLp7Y1ibpIxjs4KhQBZfvV6s7K5Vb0bjeof5ZlcGysP1a51mifODybvzE8mzCbrAoTDIThMoGXZiZ4YSiurf+Z1XeuCqJ7Oj+sK3jQcNAmg8xkGQ71mYejcAB49vpmeuzJccl0+dUj6KIAvfHCPg3N+uAv4vg9BOxcCmfEzuP/genpmeqhEMgude10Jwm+DuUIyUdTlqu2byoMfX/dRermBeExHsTiWNi3+lMpzRwDki8zxCIATmzbevfmClukiP5NFhJgwkjeRTeLShdOoVJqnAgwkgCAZ6+UdLC9twjQZ8pdzioFkZBHY3q6B3l4dJEEEPOCeD4cYVH7Xsf15F+FImC775INAJBJSkVoWo0QY9YqgiR4ZZzRaGBkdwK3bFxGLRZUfB3Rm2x4x9CGtsUxH9QYkKICDFuLxKAozGZwdTqBRs2FbLlXbiPdECMCHadj/AaDXZNFqedCIvnRcS4UpRo7+hC5zUmw8Ope9wUFinvpmZ7NKt2RTmB4hKZo6n8qP4Oq1HBkKlVYAQBrUlziB0XQSif4YmQhksgNIJk9iaLhPaV9b/Um+uJSCdzyDbGZQRSkvjo+n4JNxubGUSsCj+ZCpODYjkGMAND2k7exUsfhkCd+29yguB88Wl7FW/o6tT7/gcXqAgGv7hhx1LWBireHVn79YP6ChQ3njb/eFlfWqGqT3H3ZlGIhGI2i2UO/U/wkwAAmoalcxlNA1AAAAAElFTkSuQmCC", + "ai": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAk5JREFUeNpsU01vElEUPTPzZqBAQaSFQiJYUmlKYhoTF41L3Tbu/Q/+AvsX3Bp/gPsuWLrqyqQ7TUxMtAvF1tYGoXwNw7wv7zwYgtKX3Lw379575p5z77O01ohW+/DVh8zj7aYKhflGdG9ZsGwLNydffgVfr19YHvsEa+Zu/nxndob5StQK+dyzvZzyw/gKlmMj7IygFM+xvNcanp4/t5dAomXHBy2UUBOO2MAl/B9/cPb6PULuoHx0WM0e3GvpUOxD3wZAJWutZqYUYmqpSg5OMgH3YQObL59W0/ullpryR3HegkKEqiWBSGV4R3vQ7sIhScTZFTpHx3A215B5sluVY/WWMg7+ATB/lcLsKpTonHzD+OMFEuTz8ikkt9Kwt9YJZB38cpBdoQAZJdLvCGByfoPB6Xdk90pYy6Xg3c/DaWwArg09DaG5lCsUFN0pckZAojdC8m4auBqaALuSgez7VB1RtDSUWOQvUaBLFUzJBMJ2DwmPgd1Jwm0WoSgJfjDvrTKxtwAIyEkAOQ5hU//Zdg5uowDlUNMnwZLW0sSuUuACYhwQRwFvJxupCjEYUUccOkoaKmdOlZnY1TkgAcXAhxhOwLsDsHoN3u4O5JTDfVCH6I9nfjId3gIgSUATFJk/hVevGtOMwS0XwQ3AzB/FrlKg8Q27I2javVoZrFgwD4qVipAEyMlnaFArzaj/D0DiMXlJAFQyK2r8fnMMRZp4lQ1MaSL5tU/1kqAkMCh2tYI+7+kh70cjPbr4bEZ51jZr8TJnB9PJXpz3V4ABAPOQVJn2Q60GAAAAAElFTkSuQmCC", + "aiff": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAohJREFUeNpkU9tqE1EUXZmZpE3aTBLbJFPTtFURtSCthr7UCyKKFJ/9An3og6Ag/oXfoUj7og9asCBYKT6UIPHaWtpq7NU2aZK5z5wZ9xxMpMwZDuewz9prr32ZiO/7CNaDx3OLt6fOjBqGg/aKRCIInp8+KzfKH7fudnVF58nE16el+/yU2mBFSWZKpWJKVc0OgUBo02K4NDmU6o75Mx+Wdu9IUXFeiOA/pn1xHeYaugVDdzpbp91qGlAKGTx8dC19/Wpxhjnsxj/RRwk85hGJC9d1O6fneWAuoztDYSSLe9OT6SuXB2ccx73Z9uukwDwfls1g0xZIY/Ad/Gnyt/XVfbyYrSDRE8PExHB6/8B6QuaxIwRBFMt0iIAiMx+LCys8jfGJEUik2WpZOD2SQf9oDtVqQwopCAiY66FS/om3b75CVS2MlU7AJ2WiJBCZjZ2dJuRkDJZFwFAR7UCBja3fNfxY2YEoCtRCj9em3Tpds6FpJseGCBxS0GgYGBzqw62p84gnYnAI2CSbSbPhEpFAaE2zODaUAlWWwDoS5DheGqbWpVE/0CmqCY9qkEyINBceb2uADRNQ8bSWAVVzIFKomCQim+0luS4yKYlsHlRyZo7EsSEC23K5vAsXh/H92zZkuRvxeBS5nEx2yp2KqhxPoV5TYS/8CtdApylM9sZQKKSQzyeRTseRV2QoAzIYY8jme5DN9fI0dQoUIjANGydP9VM7PZw9p/AiBpNYrdbw/t0yTJqRtdU9UrfJCUMpSJIgbWzsYe51BcViHzLHeqCRqhZ1YX1tFwNfZBxS9O3NWkAcHqR606k/n/3coKAoV/Y7vQ/OYCZevlrmv3c0GsFh06u3/f4KMABvSWfDHmbK2gAAAABJRU5ErkJggg==", + "avi": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAm1JREFUeNpsU8tu00AUPXZcN0nzTpq2KQ3pAwkIAnWHqCoeexBb+AQ+ABZ8A2s+AIkdm266QUJIFWKBkHg1KpRHi5omJGkbJ3bGHj+4M1EQrTvSyGPPueeec++1EgQBxHp+/9mbyuriRZdxjJaiKBD3W+u1+p9a856max+gDO8ebT+WT20Ezi9NZi/crqadvn2MQBAGfpCOpqNru2937vxPIpY6Onjccx3Twck9MBiSU0ncfHirXFmZX3Md9wqCUwiEVN/zaQfHt0vfbBe5uQyuPVgpl5Zn11ybL4/i/lkICOw5niQRGQShoiqI6Bo43W2ub8n3hRtLZT7gTynk6gkCX9gAOxpAnxhHZDwC1/aI1EViJolu/QhKRMHZ1UX0Gr1USIEn5FPWHy+/wTokkrQOq2vBaHZBN4hmY9Jwfr4An/teiEB45ZZDwDiMhoExT0N+sYDCuUkkplLIlXP4/XEXdo+RUhdhBSSfUwtVTUG8MIHK9QVqI7D/uY6vr2pwmCPrkz+Tk9gwARWQ9WxppbXZhNnpw+ya4A5HZi6L4lIR8WyCcL6sTZiAWjWgAmpxkn5+kqTamK6WkCwmERmLDLvjB0ML9ikWXPLFuozYOap3L8HYN6DHdbS/d5CeTVBndBz87FCBLYkNTyIjBQemnIEsSY5lYrK1+UoWcToLMjEHAyIQ2BCBSx/NVh+ZUhrqmEqBebS3WyhdLg0zt/ugAaIklsSGLHCLa6zDMGhZ2HjyGsnpFPqNHnY2fmHv3R5SMymYbROszSQ2ROAY9qHiofvlxSc5xsKKqqnY3diRE9h4X5d/pzg7lnM4ivsrwADe9Wg/CQJgFAAAAABJRU5ErkJggg==", + "bmp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmZJREFUeNp0U+1rUlEY/13v9YV0vq2wttI5CdpL9aEGBZUDv0df668I6n+or0UQ/RuuD0EgVDAZrsKF4AR1a6COKW5qXvXec27PuVeda3bgcF6e8/ye5/d7niMZhgExnK9fbTrm5pbBGMZDkgCyq+VyhTUaT6Eo2ZHJePPWXJXRhez3B1yxmM/QdctXUSCgtV4Py4CvY3cky4e1x5DlLCaGbbzjXDcousG5OQe5HPRSCQPK4PpsEM/XH4WvhS4noeu3JwHGGRiULhsMoKZS4I0GtEIB9mgULJGA0+9DPBpBT7sffvf1W/Lg6OgJufw8C0CRGEXWazUwiiyFQjA8bsjVKjaJzovMD/Q5gxyJhG2cvyeXe2cAuADQNGBmBvLaGuTFRaDfh31lBTWi9pumjbK0B4JQul3vOQpM8JdskOLrdCvDcDjAsjtg5TIkoiKLaokMNR2cnZbqNAMycqG7XbHKR2fMzwO/dsxSwu0BiBJsNsv2LwAJAJCI5ux2gXYbqNetcz5PoORI1cDS0n8AxGW7A+zvEYBKZ2ZlcsEtJLbedMjePBaCTQMghx45ulyWkzxMVUQ2RMQhLfFO16YAqCrixPnm6iqKrRb2W23EfF4cUNSrHg90cr7hDyB33MTnSmUKALVs4uIlROjxg+AsPhGVl3fuIl2tIOB0Ya91gkOi9mxhAal0ekork1ic/kGLBORMxy2K1qS9V1ZQbNThIj2EGh+2tsyOnSai8r1UxMNIBB+LRTTULr4Uds0K1tU/uOLxIrmbNz8XXSrnASSpubG9fbKRyVh1n/zSw29t9oC1b47MfwUYAAUsLiWr4QUJAAAAAElFTkSuQmCC", + "c": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAcxJREFUeNqEUk1rE0EYfmZnkgoJCaGNCehuJTalhJZSUZB66a0HwXsP/Qn+FM+9+hty0LNYCr2I7UVLIW0Fc0hpQpSS7O7MrO9MspuvVV8YMnk/nn2e5x0WRRFMvP/w6WSz5jbi/9NxfP693Wp3DrJCnMW5d28P7a+IE15lufR8o1ZEStwPhkWHsWbrZ+eNEPxsuubEF6m0TBv2Q4liPofXuzveulttSqW2UwH+GjqC0horpSL2njU89+FyMwjlTlxOJMTa9ZQHzDQIjgwdom9zLzfXPc75kbnOAswBJTlC2XrqQRMLxhi442DgB4UFBhgPpm3B5pgBHNUUxQKAHs8pHf3TEuFMetM9IKr/i2mWMwC0SnuSFTG2YKyppwKYVdGO7TFhzBqGIenVeLCUtfURgErucx5ECKREKBU4d3B718PHz6cICGT/1Qs8qpQtGOdyhtGEARWDQFqQJSeDL98u4VbLaKw9IRAJPwjtoJGlVAoDQ800+fRFTTYXcjlcXN2g++s36p5Lzzlve1iEROa8BGH1EbrSAeqrjxEqicHQt8/YSDHMpaNs7wJAp9vvfb287idboAVkRAa5fBYXP9rxO4Mgf0xvPPdHgAEA8OoGd40i1j0AAAAASUVORK5CYII=", + "cpp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfJJREFUeNqEUs9PE0EU/mZ2WgqpXX+QIDFdalVslh8NlAOQaOKFAwfvHvwT/FM8e/U/MOnBmwcj8WD0ACEGghIkbU0baaEthe3OTJ0ZWV26q37JZt68ee/b9733yGAwgMbL12/fz+azbnAPY2Nrt7Zfqz9JMrYZ+J4/e2pOFjiciRvXlgp5GzHonXk2o6S8V6k/TjBrM/xGA4MLyeOSPZ8jkx7D+uqCU3Amy1yIYizB36AlCSkwfjWDR4uu40yMl/s+XwjeWThQQ4Z6QNSnSkYykcDXasP4lmfvOZTSF9q8TDBEFPbN5bOqCglCCCxK0TvvZyIV4CIxbgpC+4gm/PUmFCIE8iJPyME/e8Lon9j4HvyHYLjKSwRCSEUgf9+15mFbx8QS6CZJMzJ9SlBCwX3fJDLG4PX7ykcwkmQmJtpEhWa7g1dvNlSwjwelebz7tAXLolh0p/Fxe9fErK2WDFGEgKjxfNjegX0lDTc/heNuF99/HGEslcKXwyoazWNDdlCr6+DoJgrBzdI0T9rYO6yg2zszMlaKM3Dv5OBzbuyZuzm1B16U4Nzz2f3cFOx0Gq12F9cztpExncsqYoaHpSIKtx0zJdVIFpHQ6py29muNk1uTN829o/6SHEnh80HFaE6NjmLnWxUJy1LyTltB3k8BBgBeEeQTiWRskAAAAABJRU5ErkJggg==", + "css": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAk1JREFUeNpsUktvUlEQ/u5DoCLl/RAKKKUvWmIxjYntQtcu3LvwJ/hTXLt16coFC2PsojEaMKZtCqFaTdGmjbS0CG3By+vei3OOBSGXSU7uzNyZ78z3zRF6vR6YvXzzPrMUCyf68bB9zO+VfpROn5hkOdfPPX/2lH/lfiLidztX5mN2jLGG0rKLENIE8liWpdzwP7HvqJqujmvudFU4bFY8Wk1FZsOBtKppd8YCDNu77CZevd3gflfTUFcUhP0ePLibiIR9rjSBpgwAfe4dVcV6dhtep4PH5msylGYLrzeybErcT85FYiH/CyPAf74gObC2vMhzsiRhPhpC6eQUM+EA1pJzILEnjRSuJsju7MJqsUCSRei6Dp3yXqcdGlHZ/rLPazQWGCn8+6YW4pAkEW0SjzUzanWlCa/LgcR0lNfovTEi6lcIkzesnM/R8RlN0INGp3h4DHoDsE5YRvQyiKiRSMzikRAOS2WoqoZWu41K7RwzlOOAVDMMMHhIGvFlRxJFrKYW0ep0IYgC3SDh4b1lTJjNfENsrazOAMAw680mPuW+8lFno1P4XDigRhOiwQAyJK7TbsNS/PaA7giAIAhYz2yRgBIfsVA8wIetPG6FAqhdNrC5u0f+TUyHgyMTDDToEt/ftQsEvW4EPG5OZcrvw0mlimarTXkPfpXPcNlQoGtjACgpryQXsPNtH/nvRXqBJpoKHMzGNkNB0Odls7LNyAYKpUq1dt1iuvB7fRDp9kr9D1xOFwkpoksXusmXaZWFn0coV89r/b6/AgwAkUENaQaRxswAAAAASUVORK5CYII=", + "dat": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfVJREFUeNqMU01PE1EUPe/Na0uptmlASg3MoiZgCA3hQ8PHAjbqwsS9C3+CP8W1W/+BSReyYUPwI4QAVkAgUEgIbVIg1FZb2pl5b3zv2cHBjsaTTOa+e989OffcGeK6LhTevFv+OJoZHPHOfrz/sl86KpWfhxnLe7lXL1/oN/MSZqonOXU/k0AA6lfNhEFIrlAsP2PMyPtr1AscLpyg5pbtIHErhqez4+awmc45nI8FEvwNaiQuBHqTcSxMjJhmX0/Osp1xr878FxWEzwMinxAzEA4xFIpnOjedHTKpYbxW4U2CP4j8uWxmUKsghMCgFI2mFe9QgHZj0Ba4yhFF+KvGJToIRLuPC/efnjD6+26wB1Lq/xgbSCBXKeWJG/OTdky8cWTdT3C9RmWSGk2XCLlWo4xTNbfN5qh7PpXM72GjZeHt0gpq9QbmH4whGb+NpU/reDQ7hcWVVXxvXOHxzCQopQEKXKEbL6o1ZIcy+LC5g62DY2zsHeC0fA4zndIrHOjvg2XbAQRSfsuy9XxC2qzi/H5B6/68W0AsGkW0KyJPBLbDO0fg3JX/CUM81i0bD6WKe6j9qOPJ3EMcF0tSNsFA6g6alqW+VtZBUL78Vtk+Oqne7U9rs5qOQCjSheJFBeFIFOfVujSUYu3rIc4uqxWv76cAAwCwbvRb3SgYxQAAAABJRU5ErkJggg==", + "dmg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAn9JREFUeNpsU01rE1EUPe9lkk47yWTStCmtNhFSWxos2EXVhSsRcasuxYV05V8Qf4DgD/AvCK5EV1oFI7iUBqmCNdDvppq2mWSSzEzy3vPOpFFq+uDNfR/3nnvueXeYUgrBWH1/9/NE7k5BKRnuRcfF2qdnmJq9DeF9tQ+2isuMsxXGWHh/a1mEVsPJSI5fSU3OPEj291IIlN49RXz0KqzEQjIeZS/L5Y/3wPGhDxIM/i/A7fZWgVG0t5EaG0ZUa0JGM8gvPrZmLt58QYwv91mfAqCIE0sAqgumBFITGQzpUYhuF0KfRa7waDyXXXolpVrsh/0tgSLDr5I+wUZo1UHCSkAficPzY6juFSmbRPrC/azjq+fkcO00gAqoU7B0ETKkfWbuCTjTYeq5oESAauexcTScX+ZACWFm0YQSLZKhHdr67+/wW0e0dgjYo3sCEXXybYtBDVSHLp2es3IpsILS24c42lkBg6DzRjgRzCDZ/xr0GNRJwwYiWgzt+hYMawleu0V3wbkT+kUirOc7IGJAz68R/Qak1BAlx3hqASPGBJRXpXOv58dkz3eAgQoOm4hyj57NgZm0MHvpBmK6QdUdg/DAg9cRkhicBSDaKJdeo1bdxmR2DtWDDUxl51HZ+QHTysD3XdQO95Gfv06aeGcAdBrY3Chi8lwO3768QWX7J5q1XWyVSxgajiOXLyBG2hzurRKV9lmt7ISNkkjo6HhNyjoK+2gXRsKE57ZIE2ot10Z1fz0Ue4ABVw3NMjnW14rInh8jTYywoTg3EOFpOM4mXNfH9PQUfGlrAwBOs3I8ljbtuMWhRWzIIPrkn+GcYcgIWEowbZ+0qB334/4IMADESjqbnHbH0gAAAABJRU5ErkJggg==", + "doc": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAppJREFUeNpsU79PFEEU/mZ39vZu77g7DokcP04BBSUmiEKCSCxs7Ei00JAYO2NlTKyMrX+CJhaGwopSQ0dMtFEsbDRBgiZEQIF4IHcg+2t2Z8eZ5QDlnM1mZ9+8973vfe8NEUJArfSNhzPG0VIfeIiDRSDkw1cWVt3N8rhG6SdSO2Gvn8dfuueqZwuNZqk3Jxg7iNcIfBbgXD6ZC8u5qffzX8eoYeyDxC77uygKhcouovgVUQj1H4YB2ovNuD9+tTTU0zMVBmG/+C8AIYh8F361DL/yE5HnADKYlVdg6MDAmW7cuz5WGuw+PsWDYGAvbL8ECFUt4K7/AHd/I9c7BLaxinD2Ld5Zo7g78RLuRhlBS2cpWbGfStfhfwCEpK0nUjCbWuGsLciSOELPhkq/YgdY3l6HsLfRcLYf+pHNbH0JigEPkLAyMsiEJ7NrqQzM1i7wyhoMZqOhvQs6Z0ovXgdAJACRoulEg5HOwrOroKk0zOY2BDtVpTF0CU6kLkQJXa+BNEoG0lMSsBBKQXWNQktmoGcaYeSaQCIVWOvUYQAiWZFQtk5mSMoSzEILtBrTfEcviC5bwVwQmoh96wA0ic5dB57ngeoaTIPCdb34zDITYNLOOIeVSsW+dQC+7+NSWx6jJ4tY/rWNV7PfcGv0tBoPTM7M4eKJVgx2FTE9u4QPS6x+kHzfw/mOAjarW2hJG3hy8zIceweuY+PRtREMdzbjzcd5WBqPB6xeRGUMGRzHjWvMmxQ7tiOF1JBN6FiTd6Sy9RuFbHpX7MMMqOD088Ii+op5OUAO7jyeRGfBwrF8Cg8mXuDL4neMXzgFwhwZz+hf7a9d5yu3Z6DTPjVQIY9k7erO7Y63Lvc8ErEeyq6JaM6efjai4v4IMABI0DEPqPKkigAAAABJRU5ErkJggg==", + "dotx": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAndJREFUeNpsU01rE1EUPTPzJk0y+WhMStW2qdVWxUVEQUF0I+4ELQiC7lz4N9z0T+hG9wrdZKUgLqulhrbSag1CKpT0g7RpYjqZmffle5NEKdMHlzfvvXvPPffcO4aUEno9f3Vt4dTp+BXOe+fB0u/NbVpv7h89NU1j1TCM8H7+xY9wJwPHZMbOjRadLAvE/2gToJTiTPx89k+OlVd/LT+0TPIPpO/SzyQk40xCMxBSZ9Z3CoAx5DOjeHT7SbE0XSpzwa8OWB9jINELolQg8AR0EgUKn1PIlIWpkUt4cPNxkTOU12trs8p95RiAXpqaztqou8q6SKQJJmZSqGwsodFsIJk1kcyLYv7IeafcLx4HUNkFF4jFTExMZ0B9DrfD4HUEusYhWs4GPEJg5wly/tBYRIOeDhpEwlS34xcyajdQr3UwOT2MlJOEBRuGNHWp9AQRVXDfQiFV/U5GBSiQ5p6ngBEa5z3fiIhC6g6IMDBwOdoHPkYnHPVyhN0tF7E4QSpr94CEOKELffq+y9Bq+DCJ7rWBoQQBVbPR2O6G4OlsLASJMtCZfQqm0NP5IVWnamdAkUxbyuIYtD7wWegb0YAzAVMkkI6NwPM9xEwHloyDGAmk7AKS9rAS0FKOdugbYeAHPu7OPEM+MY7q3hIKqTFQHmC3XcONc/fxdfMDrk/ew/edzyhvvTmBAddocVRqH3Frahau56qpZDho7+PnTgXffi/gbHYmLEvPSIQBp5JU62sYz13G609zKBXvoOMdYn2zgm7Xg2MVML/4Eu3uPgxhk2gXmNl8v/i2pcXTP8tKdTEcbWLZqDQXwu/l6pfwbEnSGsT9FWAA4mdHv2/9YJ4AAAAASUVORK5CYII=", + "dwg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAoFJREFUeNpsU0tPE2EUPfOg006hD4rQh8WgbCSwkKgbF2owujaCiQsXxpX+D6MmbtXEsHCLmIAbE6NLo8YlGIxREIshIqVl+mQ6j8/zFVCb4UtuZua795577rl3FCEE5Bl79vPd5LHYiOP7cH1AUWi85ytmvlas1bJ9E5ryBntH3BpuP/X9i7ovkluuiE8N9SDepaLpCcRCCqa/VDCaMuIjSWP25Upl6n+QDoCz6Yh7KKzh3sI2LuUimPtRRyaqodj0MDloYiITSTi+mH29Wu0AUf9CsZPJoW5czJl48LmCc5kIKo5Al67B9gUGYxrun+5NnMlFZ+GKiQADj2a7AquseLIvjMv5KMaSBu4sWVir+3i8VIVKYSby0UTdFU8Znu8AYBHQgVOJEN5uOXi4UsdawwU0FSf6TaSoyw6DRvukPkgGWpDKy4F8a3jImCrqFDFn6rhKPR4VGnhvOTAY3WLcjifcQAsqRfhUc/Gq1MKNbBh9nIAMDjEppocxs9HCMktfGTCwP/oOBkUKNk/qF3pDYC6Ktk8RfWzyaaoKrqdDaBDwya8W1m0/CPCR3kFy7CcnmWQRUJqcRJFUKtTnPCeR71LwoeYF92CYyVnCFZpCTrRtCv5to2St8SOrKxiPqEEA4fkYT+mI0rdoeUiH1XZVuQPpsIKqw2QmfifTsnOABiWySlH9uU0Hh2MqjsZV5LtpPSoGeN9rKnhBX7ehoOSLIIPfnGONXGMMWN7xUfVldYDbjM3mrh5HCDgS17DhHgDQcIU+XbBxnDTn1x1UuQcJ9iv7l5Q5e1zLGri92EDJFnoAgHtcfr6wbbVXUqq193+0z97n3UJt1+d51n7aHwEGAAHXJoAuZNlzAAAAAElFTkSuQmCC", + "dxf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAo5JREFUeNpsU0trE1EYPfNMmtdoH2kDNmJbaVFcaBVFpAsREQpFwY0bu3HjQnTj1mVd+ANcuC3qQixmry6E0kWFVIQ+bKy2tbFJm3emyXTujGca+4DkwsedfLnn3POd77uS67rw1vC79ek7fZEzpu3AYUqS9tKQGZPLpa3VXP0uFCmJ/8t9OLC3q/uJbcs5bkIybvdHoMsSbLKENRmvU2WcNnTjRFD7ML1WGSPJHI6sA4KRWMAWVDPxLYex3iCmfpuIh1QsFSyMxQO4GvXHHwOJ6XWSyIck8v6HQsnjAxFc7vTj2VwBg4aG78VdBHQFCk+dbVcxMdwev9gTSEC455sIBOu2KLsoJFzqasP9vjCeDBlYqzn4VXXwarGKZN7Crd5QfLDT/7KpBM84c9fFUFjFp2wdk6smflRsKKqMa7EgfJJ3Ac2OKlit2pEmBTQfngdpnupoU7BUtRGiiTe7fXiRqmK+KuDn6TpvYogmBRJcrOwIJLIWxmM+dOsyLKryQAaJpjJ1/AxrGO3SqdZt7kKZJrzJWBg5piHENuY8vV6e0UOye1TyftvC5l+gZB8SHJTwpSx4q4JeTUKaxhXoR57h7Rn+3iFolJ3xvPhab6HgJG/pJ7jsNP4sUX+jZiCgEsWd/DjH5IrSYpBUAr0yHpzSoXKOP25a6OBhndh0zcX1qIYM2RIbu6i0KiHD5B/GTMHG03kTGpEL7H80wHFOWwhqDZ+SpkBOtCDYJDhZE4gRcKNbYynAqbCMbXpwpVPFbEng0aKJGbYzK1p4wIegLlcEPmdt+DjXbzcsxFlCynRwwVAwW6hjqeg0Zt521SYCWCJvbe0Un29UDx7Hgrs3IEitHXkw3jOv2fl92D8BBgAJeyqBh90ENQAAAABJRU5ErkJggg==", + "eps": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNp0U01vElEUPfMFCEVArdoSqEA0KV246UJdUJM2Lo2JK/9FjXu3utJqTNz4D9worrsQExbFpAFT0TYp0CZ8pIAiyMfMvBnvm2Foa9uX3Lw7c98979x77hNM0wRf7ufPsq7Z2SQYw2QJAkDxQalUZa3WI8hy3gmZr15bu+z8kILBkCeRCJi6bufKMji0NhwiCQR6iitdatTvQ5LyOLLEiWcYukm3m4Zhmbq1BX13FyoxuH7xAlbvpqKRK1fT0PWbRwEmDEyiy1QVg/V1GO02tO1tKLEY2PIy3KEAlmJRDLXb0TeZL+n9g4MHlLJ5HIBuYnSzXq+DlcsQLk/D9Hoh1WrIUjlPcpsYGQzS3LWoaBhvKeXWMQCDA1D9pt8PaXERUjwOjEZQFhZQp9L2yERiqYRCkPt/z58ogTGqHQLE1BLgUmC6XGD5AlipBIFKkbhanKHGYLBDqQ4ZED0OAbfLlo8OIxwGvhVgyTHlA3xkomjH/gegBgDURMv6faDbBZpN+/tHkUApkdTA/PwZAPxntwdUyjYA/+ZMqJHjLgM9iv/6zRt2GgMaIE21aVIjnSm0DGPfmhzyde0UAE2Dj+p7urKCPvkZku9eJILOSMUnkvVhIo7GYIB3xSKYdhoA1erXGVKXpvFxZwdBonnD68PQ7YEwM4O4xwMPxc8RYE87g4FIcz+kvfmnA0YzIJIy77/m0OCqsTkkCTysKPjJG3viLei63Gm3kCO6UWqcMejjxecMPmxsoFKtYop6UNirYL9Wtc5OHqzznIXHq1na7OfMJROcK8a6O7MjW7nfzZdrd7jzT4ABACh3NGsh3GcdAAAAAElFTkSuQmCC", + "exe": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAo1JREFUeNp0k8tPE1EUxr+ZzvRJO62lUAQaKIQ0FVJFjBBdoIkrDDHuXJi4NnHtX+HCjW408Q/QmHTRaCRRohIJifgiiBICTQu29mHfnc7MHc+MlECKdxZz595zf+c737nD6boOYzxJLC6Nhwej7e/24HkO779s7G6mMjcEwfKZ21+/d+em+RbagaFev28qEpZwzKg3ZckqCPH1nfS8hScIdyhBe6JqTG3PfyTTeLrwFhvbKdy9/xi5QglXL0yGJsKDccZY7LDIAwWHpSferWBh+RN8ni4UylVER8MY6PHj0uSpUK0hxzfTmWsUtnoEwO3rer64jEyxim6/Hy67DXaHExvJX3jw7CX8XjfORUdDlOohhU4fAVjILCPbm9V1yIqK2FgYt+ZmsZcv4lH8Nb5upXD7+hVMjIRQa8qeDg8UTYPU5cTcxSk4nS709XTD53ZhpD+IYMAPj+TBz93fZiz5oHV4AP1fGdlyHZIkIZkrI7GyhnK9CZXy+Aig6p1+HQAY003AcF8AVtGGfLWG9XTO4MLZ5cL0WAixoT4zVmPHADSiMo3hzHA/xgeDWFjbNg8H3A7kKnX0koEcPdTu/ylgRGZgOjNv38zoSXC8BZJDRKOlwGEV0VJVGM0y4joAPO1spXbx6sNHeD1uRIYGUCxVSRlDt1fC8rfvcDnsmJ+dOaLgoAs6AVLZPJJ7WdhEkUyT8GJpBflSBcVKDTvpDBw2GzQqQT1OgaZqUOhtFQUTUKnVTVWNpgy51YLVKph7sqKYkA4A1ScEfT66vm5kC3+ofh6Xz59FQ5bpkvE4QW3M5Apoyorhl9ABIKnFgNdTOh2NkJG6WSf9eRBJtmFwLDJmriUzeaOkYvvcXwEGAIVNH6cDA1DkAAAAAElFTkSuQmCC", + "flv": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmtJREFUeNpsUl1PE0EUPbssLYUCXdpaC9gWoSTgAyFigiRGY+KjvuuTr/4A44MP/gx/gMYfwIsan0RjIjGiJIZgSIGFIoXSD0t3Z3dnd70zpITazuZmJzP3nnvumaMEQQCx3jx69SV3a3KWMxetpSgKxP3m242Do43SQy2k/YRydvds67n8a63k+FRSn7l/bdg5tdsAuM3he/5weDC8vLdqPLgIIpba2niux52mg//DqlsYSg3iztO7mczN3DJ3+ByCLgCBH4hOFEF7cDpzPCRyOpaeLGXSc2PL3HbnW3XaRQCPEgWI2MsRVAVqrwbX9bHxbhOKpiJ/bzpDOr2k68V2BtRNzMtqDEqPejY/4zSGjb54BM0mQ8k4xsDoIMauXxnqYOD7PmwScP31d0SS/eAuh1lrolFpIBQNQw2pqJdqsAlIceB1AJCIkkE/FZskXDQVRXw6IYHiE0nBEcaPXSSvJnGwWkQXAE4acAhbxPMJpOdHweoMhc9b2F8zwKizbdlyPLVH7QLg+JKBYzoorxzjz3oRzUoToaEw9KyO8XQW5AE5jrFT6AbAYVVNxCZ0Ka3So+DSTAoDiej5ywTySbls1OEDobhFlMcXxrHw+AbINEjNXgb7y6BndLhk8cRkHHbD7g4gEhiJFxsdhrDqaamBaDKKerGGSKwPI9kR9EZCaNA5ubE7A5s8IFhsrxQkgJhZoa/06xC5xRz2v+3BOjFlbqcGlquxsondT9vY+2pAJdeZR6fI355CgQCN2A4O1w7gkQ7cdLUOAKdhV6uFSv3kd/n8mT68eC8dKWLnY4FsfeZQh7nVVt0/AQYAsf5g+SvepeQAAAAASUVORK5CYII=", + "gif": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmVJREFUeNp0U0tPE1EU/trplAqlL0laiw40xASByEJIZFGVnSvj1j+gWxNXJq7VrbrwF7h10cSNhMRHojEuACVBKmH6SJQyJeXRxzzv9dyZPiCtN5lMe8853znf953xcc4hztDzZ1+C6fQMHAfd4/MBFG+p6h/n4OAeAoGNToi/eOm+A50LKRaLh6amoty2vVpZdotNXccMEK3LwZxa2bsDSdrAqePv/mLM5tSdMwYBYqyvw9zdhUn/L59P4OGtG8qlZCoH254/DdCdQBCxqZu+ugqnWoW9swN5ehp2NotgIo6bGQWGtaS8+vQ5V9a0u5S+1gfABEilAqdUgm98HDwUQkDT8JXoPPq+BoM5kCYmFT9jryn1+hkAt7heBx8dhbSwACmTAUwTgdlZ/CVKJaLnI1GD8TikZiPSR8Gxib8chH95mZTxgwWHwH7+gFMswqcokIRbjMO2HDCnZ1VvArpjEmnKZc8+cZJJYGsLsMiZ8AgwEqaY6Mb6RQR33JFhGECzCRyfAFXNu9v+RVNRZWIMuDJNuYMAaDycUFGhCOgtuAtFVDA83G5A8TrFDw+F5QMAxAKJJxz2xnW3RPJGbm+rCyjotZetH4DGzaSSeDA3h4Zl4R0JOEZWTpIzF4n/m995bNdqZwB6m0gFft3Ak6vz+KYWwFsGlqIxXItEcDt1ARMEtKdVgZb+fwA0G2C2hXM0ZTZNRcSf0b1pmXi7uYnjI+Lfanm5fRQsK8BIxKcrK7i/uIgP+Tw+FlREqHN5fx/vyU4uHBE6UO4gDWqk/JFaLuMxcXeFk6TuJ90V0HOk1in7J8AAjmgkPfjU+isAAAAASUVORK5CYII=", + "h": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAbRJREFUeNqMUk1Lw0AQnf0woK0ttVqp0hwqVCl+UBERT94F7x78Cf4Uz179DT14F8WbYHtRkBYRLNqDtdaPZLObuLs1NGlXcWDJZGbey+x7QUEQgIqT07PL5WKhHL5H46J+22q22vsWpbWwdnR4oJ80LNiz2czGUjENhvj4ctIE4Wrj8XmPUlKL9nCYcOFzE9j1OKSTCdjdrtiLdr7KhVgzEvwW6krC92E6k4Kd9bJt57JV5vFK2KfRQRV+RAMkzxglYI1RaDy2dW1rpWRjQo5VGicYIorWVooFvQVCCAjG8Omw1MgG8AM0uSBUDSnCfk/IGCHwf3DCD/7UhOLBrFkDuep/hDUSSCv1iYo4rIfqGwmUSNJjfYbBcQKhZw0aBMA4B48LwBhBt/cON80HmM9NQ6fXg/Wlku4TwmNWDzaQqzHG+0PSKod5cH5Vh2RiAhYKc8DlV1UPSyuFMGygVlMg1/P6BC6DqXQK8jNZDXAYA1f21V34wMXYFaiyVw0rJyzLgs3VMkxOjGtix/V0XWChZ0cI2i/dzvXdfTd0Qf91BMPrhyNzgKfOmxaWypqaDXHfAgwAtCL8XOfF47gAAAAASUVORK5CYII=", + "hpp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAehJREFUeNqEUk1v00AUHK/XKf1yZdESVRBXjRSRFqMQVBA5Ic5I3DnwE/gpnLnyG3LgXglx4UDDLZS0RWkDLiRxSusk9u6GXSembmLgWZbX7+2bnZl92mg0goo3b3ffO/ncdvyfjHef6q2Dlvs8Q2ktzr16+SL60jhhZ69bO8X8ClLC7w9XdKJVG8fuM0r1WrJG4gXjgqU1D0MGc2kBTytl+7a9XmWcl1IB/hZKEhccq5aJJ/e3bTu7Wg1CVo7rNLlRhUh4oMnXoDoyhoHGyWmUe+QUbELIa7W8CjAFlMzdzeckCwFN06ATAn8QmDMMMGlMuwWucpoCHNe4jBkAMenjYvRPTyi53JvuwX8AplleAeBcRFrH6rXIxLim9I/pi3QA1RhKaYxdjkN8IwalCMIwWs9ljMkh0wzk+9M7w179C3LZNXxve2h+c3Hu91HeKmD/6zHOLnw83ilB1/V0CeqU3Q81LC/O41b2Btx2N2JVP2riR8eTUxmi0TzBwrKZMsqMoz8MsDh/DWuWhUBKURLKxQIeOMWoptYPnS1c+INZBkwISomOSsmBZS7B+3WOzZvrKGzkMAiGqNy7g+LmRkRfekBnANy2163PZXrSbrQ6vch19Xz8fPDHyL39QzkHBKedXjfu+y3AAGU37INBJto1AAAAAElFTkSuQmCC", + "html": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmBJREFUeNqEUktPE1EU/mY605a+hhZTBNKRDApNrWIRA4nEBUZdmCgLNi4MK5f+FNdu3bFv1J1EXODCR1JJSMTwpqUP6NiCpe10Zjz3hj5Mm3iSybl37jnf+c53jmDbNpi9eb+6Ftcisea909bWNzNb6dwzSXKkhIt/r14+515qBqmDA8HpqKagh53XaopblpIbe+knDpFAhPab2Dw0TKvRK7lmNODzePBgZlK9oUWSpmVNdpIU8T+jaMsyMaD4MDcZVa+NhJMN00w0n6V2nN3yQgdHWZag+LzYPTomIAtT0THVtPGanmb/BbjwLFkvn2IttYGYplKyDzsHh7gdmyAWfh5zVq0Guhg4RAHFUhmfvq3j134aXo8bd+ITnMFOOovU5jbGRoZwNxFn1cxuAIcDW/sZDjA/c4u+BNxOJyxqaenpI3z88gMfPn9Hv98HQZS6RazW6kjExvFi8TGdDSy/W0Emf4LS6R8sv11BmfzSwkPcm74Jo9Ei0GZgmkw8QCOao8OXcaz/5vSZnPdnp3ApqBBLkWJE0Ci7ASzbIhCLLQ1E0iOkBDh9NpUgiUejo8oNuJwyn0YPABtn51UYFFivG3yBGCNZkuDtc/MW+ZQI3OrYpBaARCKufk3B5XIiWyhiL5ODp8+FfFHH+KiKSqWKUL8fC/NznGlPBmz+24dZjKnD0CJDcMoyW0SqXuMtHBFw7rhIAD1ErNUNafxKBNevapwu65NpEQ4FqXIA+RMd6VwBP3cPSERb6gLIFIq61+UqGWaFdcrVt/lmAuWjAi2aiMFwmOYuIJ/N6M28vwIMAMoNDyg4rcU9AAAAAElFTkSuQmCC", + "ics": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAhRJREFUeNqEUkFPE0EU/mZ2dra7bLNpi2AxQFKalkJrohICiYkXPagXrx78Df4K48GDBzmQePLMhUODNxQ5ciEkJVqDtJGmMWrCATRbd2ecoS5u3aovmezsvu9973vfPiKlhI4XL7c2r5YL81LIELEghLA3u/udxmHnPmfGW/Wuv+LpwwdneRYBx7PeWK0wOYYhcXxyckGV1fdbnbuMsXcklqPRJQxFMKz4RxDCtVO4s3xlRjWoB0FYjlQPEEBieChwKCRGMx5uLtaKs1P5ei8IKlGa/YkXMXYtlTEDlsnw/mMXhBJcqxSK6vlcpa4PEpCooUyIqs5M6hG1o2CUwqA091cFcYLf/sjzcX75EiQIojI9779CTYR4jwTBf+r7GAwh0AxCiL6JMT/04vQ79u8aI2O/7Jzg69o6Go8ewycUahtBpADhHKLnK/eVbkMdtROWIv80NQ2sPhncA9Htwn+9hZG0rY6DzFwJl+7dhs0ZstUy8rduwPS/wd/ehmi3kwq4zTHiWUgXp+EuL8FvNvFl5Rn4xAS86iyI2kY3n0Mv48ByrOQmancdi8I0Kcj3U5iuA29xAelKCUHrEIayzltagG2E4IwkFaQgSC6lYI09iN0d8It5uNV5nG5sgJdKYC0G8WoTOZvBISFNEBxnsuzD3GX4vfDsszzqAu0jkJQDedCGbB6AWg54pYbPo+NGVPdTgAEAqQq70PytIL0AAAAASUVORK5CYII=", + "iso": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjlJREFUeNp0kstrU0EUxr/k5qbJzdPYpGkpsUJoA2q1oLjTdiGiIC5cuXHlxv9BEOrStTvBnQvRrSAIsejCrlqpsURq2hCJNQ+TNLm5uc/x3MmzJh34mDNnvvnNzOE4GGOwx8+t9XQkfn0VE0Y5/7Z+kHm+dvOhtd3P9c/xwNZh7nWaMYtNUmX/Fct/vlN7/8J5aRRgyzm8xzpRDjGE2aVH4VTqdnoUYg/XkEhmy+Cx3DhA5tMzdFolvg5Mx3Fx9SmH0JIg79Zo3j4GADMIokJTKtjbfAKXU4Y/2NvSfyH75TFOxa9Cmr0XnlPFl5ReOQ6wNMDsoFX6AElqQlNV1KsOuNwS/AGFjEUIDhmn5+/DMM16/9igBowAzFKIswPJr6MjlxFP3sV04gaP7RzMPe6xvWM1gNUBM2UKYlBau3QghGphg29J3gDlLLilWNdD3gkvIIDRhD9yGe2mCV0V4HFXuCxT5Dlv8Dz3sIkAs03FalDxBMQSt9BRBMhNncuO7dyU28c9tnf8C/Q0ZtR4GImeQSj8APLRH772BWcgiFODffCv/t8H9tO0v3RjV7VqkeeXLlzDfvYjj88uXhl4JwIsrYxmLY/M1gYclIvGE9jZfNPrSCD3/QgLyeWTADV6wW9AryIcCkB0u1Aq/oCPumlufoF72vIheaLDr4wCLIOqrYnULA14PSoqpSJEAUilZrD77Sv3LK+cI0+Be8cAbbmAOrob0agtD491LYfkoqvnyZLsWRkA/gkwABL4S3L78XYyAAAAAElFTkSuQmCC", + "java": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjxJREFUeNp8U01v00AUnNiOEyepQyhQobRBSlVIoRCBEPTAjQsSEneE+An8FM5cuXLNoQduIAE3qopKNJAIIppA2jrOR93aa6/N8yZuUxyxkrXr3ffmzczbTQRBgHC83nj3ca28dD36nx6fvnzrNNrdp4oibyUmey9fPBezEgWVFuYLdyvlPGaMY4fl1aRS+9pqP5ElAkmcnknRwuO+Nyt5u/ETYfyj9WrpZnmpxn2/Ok1Swn/GvtnH5k4TLue4kNfxoFoprRQv1TzOb8cAIu3+ZD7oD/Hm7XuxzqRUNDtdkuLiTmW5tFxceBXlnXgQTAORSMt2oGezUJJJrK9dFWdEH7Ik4dB29LiESeUEJXd7/dAT3L+1ivlCHr8NEzutXTBvbJPPSdO/AH5wysChwM/1HzCGlmAzOrKxu2eCud6Z2Jke2MwThpUXL6Nn2ZAVFTlNw70bK0iRnGAq9qwHtOmTRpsx1NsHyKRVnNPnoMoK9kc2BjbD4vk5JGV5NkBoEPM4FFnCteJFWOS4ntHEfphQyKaFTWFLw704AJ26ZFx/ZEEi3YyY0O1Dmr4EKTUHA8hUnS6siI0DEHLYog+b28RCRuNXR/iQUpPUEQ+NVht6Lodnjx+GXYgDSFRnq97Ed2pXSlXhUSeGhxYc5sKlNXM5DGLR2TMwfZVPAIi+otGNWy1fEZUKeo4qc4ysI+F8VksLIJfYcD9QYgB/DNPMptWBlsnBIS86xmDMTBo/PWd0LB6VZfdEbJT3V4ABAA5HIzlv9dtdAAAAAElFTkSuQmCC", + "jpg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU8luUlEY/s4dmMpkWxRopGJNNbiwhk1tItbGtXHr0hcwmvgOdWld6Bu4coXumtREE3ZKu8FgOlC1kIoXtC3jPfdc/8PUIpzkBM7wf+f/hsts24YczuerGUc0moBlYTAYA+i8sbdXtAzjITRtq39kr73s/Gr9DTUYPOeamwvYnHdrdR0SnDebuCbswJGqpX+Uf92Hqm7hzFAG/4TgNr1uCwEJ0trcBC8U0Kb1/PQkHt9JxSLnL6TB+Y2zAIMOJBGLXmtsbEAYBsx8HnqCGKVScAX8uHf5EpqmGXv18VO6VDEe0PXsKABN8+AAgiabmYFNNJTDQ2RUFc8+Z9G0OPR4PKYwvKari0MAgiY/OQGCAajhMNR4nDZMaInrKBGl70SPMScck1NQG3X/CAWLE3/dAWV5hRRVIJxOWNksrP19sFgMqqAebUGYHMI6teq0A9oTVAhqu2sfbYYjsL7lCZ3683gA70T3TK7/B4BNoO020GwB9TpwfAz8LgMtWn/NkV8EHgoB81c7nYwCyBZlEVkHcqMTKFnkmehJTOPvEfCnKi0fAyADJKfXC/h83TaZTJjaa5lANLpOFqAXtlEAorAwO9u5syT5UxLfU0e3o1FMu1x4u7ODYq02BKAMAVSrSNLrK1MhLPj8mNF0vFm+C1ZvwKBwXXE4AGn1WAASazESwUW3BzUSMeJ2o1Aq4sPurvQYSRLwlhRR6mSaYyi0WlpAJrFRx3ouh5/lMt5lv8BLwXp0M4lSpYL17e2uK5wP6lj/c2ZPn2RI+YT8fDvqoyegVLyfG5kBKaQQOfvF2pLc+ifAABiQH3PEc1i/AAAAAElFTkSuQmCC", + "js": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RUQ5ODY5Q0NGMTE4MTFFMTlDRjlDN0VBQTY3QTk0MTEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RUQ5ODY5Q0RGMTE4MTFFMTlDRjlDN0VBQTY3QTk0MTEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFRDk4NjlDQUYxMTgxMUUxOUNGOUM3RUFBNjdBOTQxMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFRDk4NjlDQkYxMTgxMUUxOUNGOUM3RUFBNjdBOTQxMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoT8zQ8AAAJdSURBVHjadFNbTxNREP52t7S0bktbKFAvTUVaw60YqkExUTD6oD74qC/yD/wp/gh885XEEI0RAyYQUiMpIBGMkYR6o23abi+73e2uc04v1LROMtnZPTPffvPNHMGyLDB7sbJ2ciUSli3U35smkK9t7x9v7n2dD/g8KUkUwWqeP3vKz23NxJGzgwOx0RC6mSgIo+WKuvP56MeUzy2nJEk8PWsGJVVTuhWbpgmHw47FB7d98Wg4mVWK52o1sxOg3Va3PmFp+Q2PdUquaFUM9/vw+O6cP3bxwm46Xwh1ALR3/vL1e+hGjcc9koScUsTSq3coVDQsXJ3wzo5HEs3clgZNMTVdx1T0Ep7cn6//QRQwMhzA6uZHLD5cIFEFSKIU+G8LK+tb0KsGZKcTJoEyP08AbpcLy6sbPKdQrigdAGaDwWxsDH1uGbliCYIgcM8WFPg8Mq5Pjzdyu4jYbCE44EepXMHuwXe+A8x3KKYxYsjvbUzmlPGpBmYdgI1oYjSMbL4Ao1YXMkcM2Dd2xnbAamPQAqg1GORLZdycmYTdJqFKk2DPR3fmwI4zBDrg9RADqxPAbPBif2WTSB584/3/TGegEOit+DRcvQ4OZJi1LgwIQKVCg2i6nb1I7H3Br3QWqT9pBAP9uDY5xjdSM3RqxeoUkfVnEOW8UkLykERTNXjkM7h3Iw6NNvHw6JjuhAhVrba0+QeALozcI9nQR0VvNxJc/ZmxCNGvIBQcpDG6udA22kyW29HC72wu8yG579ZoiSYuR/ly2+y9CA4NceWLmo717T1i5ULqJNtapL8CDACskxPFZRxLwQAAAABJRU5ErkJggg==", + "key": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlZJREFUeNpsU11PE0EUPbM7u/2AtJUWU6qiiSYYo5EmmPDCD9AH46sx8cEnja/+CB989z+Y+MKPgMiDsYQACcbaWBBogYD92t2Zud7ZlQZsbzKZ3bl3zj3n3IwgItjYeDO3MlWme0bjUth8e8/fO2tHzx3XqUEk50uft+Ndnhdmc3SlfNPkVZT8Cy600DoIISvVfKYtlvfX1p66XmoIYsMZdjJQWvEFbbsC/S5g2QhSkKUK7rx6OzvzqLpsovAhaAxA3DUBQn2TUFsl7KwTfm4Z9DoO5LW7uPXi9Wxpfn7ZKF09vyPxX2iWcNRkKGZz0mQWKoNs8AVB6x1yRY2pYnc2LLofuXTxMgAlmlXIfngCxNxEzM+DPv6NQa2BygLgZyX6JT83ngHTN5GAL0WSoUQkSQnXkyBh/k0GegTAaldM20sTKvet+yyhIZApECamL0jUSe3oFChx3TopM4TeEQP2gc6BgGIwb4KGNXRhCkMGxgg2kJeybRiZM45D8W61qEAknSmpHStBhywu0nFVupSCTAcM4ECwqapv+NQ6LS9JGALoMIIoPYDjZiEL1xHtbyO39AQUDaA7R1AH23DSeSA4hv5RG/VAhxomPYP8sw9A4TaC9iHkjUWmrtGvbyC18BLe3GP0m3WW4I5hEBEnPIStXzyuFIxb4EkMEJ79Qa/xHbKxCdM7xeCwzUZOjgEwnuzt7qLz6T3cySmQP43uzjeIiTJM6io6W19B/NLCKMVGCzkCoLR/0lrfOI2fNy/huKC1FTsK/rbGNeMRC8dHpHByfu+vAAMAL/0jvAVZQl0AAAAASUVORK5CYII=", + "less": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjZERjZENTJGMTE4MTFFMUIwOEVERjQ5MTZEMkVBREUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjZERjZENTNGMTE4MTFFMUIwOEVERjQ5MTZEMkVBREUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGNkRGNkQ1MEYxMTgxMUUxQjA4RURGNDkxNkQyRUFERSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNkRGNkQ1MUYxMTgxMUUxQjA4RURGNDkxNkQyRUFERSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pl1w97IAAAJhSURBVHjahJNLbxJRFMf/wPAIMIxMkUI7tS0VYqlGDLGhjdKkqyZ24cJFN925de+XcONHaHRj4k7TND6SGo1VWwmp2kSLhlqMDbQ87gzPYcY7k4GgoJ6bmdw598zvnvM/95pUVYVma+svcovx8yMnFZHAMJPJBJfDzq5vpX6+/vD5qo/z7DOMBdo/d26t6jFMJ3iY51jBz4M+LP6wxEw40Gy23qYzB3HO7fpmpZCOmfEfa7Xb4NxOrC4lvbPToe2yKE3K1PdPwNOtHdx79ESfq4qKkijB5/XgevIyHxEC24USmewDqD2ABxubaLRkfW6zMqjWGlh7/ByyAtxYnOPnL0Q2+gGGmKRaw8zUBJaTiS5QOO1FJnuIAM8hciaIWHgi8NcSNt+loVDY8JBXh2ojJAR1HbTSNFMUpV8Dxcjg0nSYBrtBxdLbqI1iheCUh9XXNGurAwCdEkb9QyBSFam9TDfoPZ1LUg1BH28IiwEARTVAQOzcFKRaHZpLoa9avY6L1Gfs0c32t4PU6W2lWsV8LAorw0Cs1nXftYWE3qZGqwWHzYp2zzlgetuolVFvtiDLbRRKFTAWCxx2G/KlMtXFhWPqOzsWHJwBx7rxKv2R7mwFz3lw9/5DLC/M4Us2RwV0g3U58XJnF7dvrsBOoX0Abbej/DFKRMKI30fTVGC32WA2m5H9cQQvhYi0vE/7Wdgczn6ARA9QPBrBszcp/XvpyqxebzQ0Tlsq6llxLhe9bD4cFMr9XdjLHpLv+SLGBYHAYiVu1kNOpAaRTWbCejgiw0zGhFGSK1aw+zXbvfK/BBgAPwADAs5GpGsAAAAASUVORK5CYII=", + "mid": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnhJREFUeNpsU01PE1EUPdOZKWUotKUKFLEWkQ1EASGGxGBi4sIVrt27IixN/Cn+CxfVnQsXJiz8IAoqRBGEaMUUWzofnXkz781436QDkjKTyXuZe96595x3rxJFEeTzaKW6dmdpfIoxjuRRFECGn7/4Utvarj/syWgflU5s891qvGoJePJasfBgeSpnW+yEIJVS4DEBx3FzGT2qfvh0tJxOE4mCU0yy8X3BLdODRQTJZ5oMzYaD0UuDePzkbnnx1mjV9/lMp+izBKEIwQMOzvnJGoYhhBDgFKtMjmBl9XZ54WapSjLnknMnEkQYgflCVhKXLt+/dRMy2d5OHdVnPoxeHUtLV8u2w5/S78UzBJwLMC8gAsosIqy9/ga37WNmvgKVKmEkb7JSwI3pIdRq1kBXBZJAUKkb6wd49fIzbJthdn6cIhE0XUWbyP4cmshmdZAE0eUBD6gCN0DtZwM7Xw+RUlVEJCui7CmyPaS94zC06ZMedREERNA6djBWHsS9+9fRS3p9AraOXbhELMlUQju2G2O7JAQENk0XhpHG3MIVlEZzaDbdOKO8jWy/TraGsMmL4L8KTgnIfcfy4JBWeQNp0j10MQtB4EJOg6qFMI/bEH3pGNtF4LOAjHMxO1dGvW4jXzDi7Iw60TB0jJRyONhv4MdunbDneMA6BMPDA6iMFzExcQH9AxkUiwby+QzevtnF2OU8lBT1i8fOa2UO1/FwdGTHE2STHM/14+vlPOz0RxibKPfn9AHXZHBzYx866ZdTKkuVndhHuqenS1h/v4ffvxqyvbUuAtPizZ0Dp7X1fTs+FA9cMnWd4ZG90NOjomVFzeTcPwEGACDGeYddZX86AAAAAElFTkSuQmCC", + "mp3": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnxJREFUeNp0U89PE0EU/ra7XWxpSsFYIbVQf9REFBHkYBRIPJh4wrN3DsZ4MPGP8b/wUCIHEw5EY0w04o9ILcREGmwVgaXbbXdnd2bXNxPahGyczebtzrz3ve99740WRRHkWn5cebu4cH6SMY7e0jRAHr9c3WxsVvcemmbys9yT6+uHJ8oaPefypdPDD5Ymh5w26wMkEho8JtDtuEOZFCrvN/4uJZNGH0T59D58X/C27aFNAL3Xthmsww5GCyN4+uzu+OLtQsUPxPQx6ZMAoQjBAw7O+bEVCMMQgqygs+LFs1h+dGd8bna0QmXO9OL6JYgwAvOFZKKoy3V44CgNfv7Yx8oLH+lUEgvzF8Ydhz+n41snAGRG5gUEwClzhHdvttFxfNyYK0EnJozKK5eGcf1qHo1GOxtjwI+pfvm4g/W1qtJgerYE2SXJSIL9+W0jk0mCShAxDXgQKgbNXxZq35vQKCiKQkSUXdc1+gcch1FHGPmKuIgBCdc66qJQHMG9+1NIpUylxxHtuW6gEiTIu+N4yjdWgty0yTmdNjFzcwKjY0MU7MLt+IjoSad16FoIx3b/A0DZ7FYXnsdpAjUMDOjI5zPgfoBsRodhhGhZHfBBU/nGAGRtxWIOg5lT2NtrI5dL0SB5KJzLodloqXaOEatPGztKq5gG3S5DNjuAK5NjKJfPYKI0okBkSdemCiSgS/rkQNLSePtxBj4LSCwfFtE0krqqX7ZVMnu9XlMXy2l7ME0dzA3iANQyY6vWxC61UY41zTyNcYh6/QCNXQvzi5dR39nHVq1BUyuMGAARsF6tbbe4iKD1r7Om5iFBdmW1SsDflLiuB6sX90+AAQDHAW7dW0YnzgAAAABJRU5ErkJggg==", + "mp4": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnBJREFUeNpsk99r01AUx79psrTrujVtbceabnZs4DYRHSoMh6Dgq77rn+AfoA/+If4Bok+C0CfxVRDBh+I2NqZzrpS1DVvbtU3SJPcm8SSlsJlecsn9dT73nO85V/B9H0H78OLdt/LDlQ1uMYybIAgI9n99OWxoe83nkiz9hDDae330JvxL48O51Xxm/enNtKPbVwAh0Ec6kYpXat9Pnl2GBC02HrjM5Y7h4P8+7FtIFVJ49OrxUnl7ucIdfhv+BIDv+fBcj7p/tXMPrs2RXVTw4OX2UnFTrXCbbY7tpMsA13FDSDAOQ4gJEGUJLs0PPh9CkESsPrmxxEz2lra3rnpAt3G6adgdQhBpmeLkFodNmsjpOPoXBrQTDcmFFNS7i3MRDzzPCw/vva8ikU+COQxm14BBhvJcHLGpGPTOAJxxeLbrRgAkYujBdH4G5oWJWXUW19YL4XqunAMFhnq1BqWYgaY1MAHASQOiU96zKzkU76mwehaOvx6h9uMv7KFN3RopL4oTAI4HRh4wSl399xla+00YbR3yrIzM9SzSqgJJnoKcklGrH08CcJjnBtLLCsSEGGpSWJvHtDKNoFippsJ0ulIsDDUCCATMlBQkNuahEyiZTcLsmFBKaQxaOk53TlHeKkM70AjAooCghBOk9sKtIvqtPqS4FBaRnJSRX8tj2DOh3lFB5Qw2ZNFK5LRo6w4sKt2ggAzywidAMN/9uIPSZglBLDO5FF3mRD3wHE9qVRvoHrUpfn+UEQK0/7ShtwboHJ6jdH8RZxSC57hSVETb7e5/2u0FxqPHJow+8iZ4lYY2QGu3idhIxO7Y7p8AAwALCGZKEPBGCgAAAABJRU5ErkJggg==", + "mpg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnxJREFUeNpsU0tPE1EU/ubRdlqmnUBboa0UeUQDiUGCC1+JmrhxoXt/gBvXJi74If4AV0Y3sNKF0YUaICqoIfjgVShEiGF4tDOdO/fOeOaSKtie5GZu7pzz3e/c7ztKGIaI4vn9p+/P3h4e4a6Pv6EoQBDiy7P5rc1P1Xt6XP8M5ejXo6UJ+dWbuemeTGdpvNdiNe9YvQLe4Bi4PmTpRmyq8m71rp74BxKF2twIHvAo+f/l1T2Yp0zceHizfOZa/xRnfBRhG4CQqAYioBWeXDyA8Di6ei1ceXC1XBwrTXHPH2vW6ccBBBMI6BsSUEQzakGL6xB0tvjyBxRNxdCtc2Xf8R9TyaWTDOg2TjfVdw6hqIoE9B2GxkEDWlLH7s4ette2kSp0oDRezrQwCIIA3oGHr0/mKMmE53qo23W4+w5S+Q5ohob9X3tgHgO8ULQACC7gMx9mKQP30EW6mEHpYi8xcJEdzMucjfkKcrTfmqmiFYBxCF/Id+gayKJwoQjHdrA5v4HK7Cq44KjZNWpagaqp7QACks0H9znW365ia24DzoEDozOJbH8eVtGShXHTwNracnsG7q6LzsEuaAlNPm9h7DSSVjLyCMkppDI+GS2StQWA1RlKo0X56n2X+6QHkmkDakxF9WMVqWyK+s/BrthYfvWz1Ug+zUDcjMPMm0h3pxEjFma3CbIuCud7oMc0LL1ZgmElpGJtW3B+15HIGNITrMYIlOH7i0U41NrInREylYbu4R5qQbQBaAh95fVKZCnpQCnb9DrWZyrRERS6NDeUw+yHaXh7rt4C4B8y+9vkwn7kwKNRpDoa9aiFKBYnF+RcREqQ2e1m3R8BBgAy9kz9ysCE6QAAAABJRU5ErkJggg==", + "odf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAi5JREFUeNp0UktrU0EU/mbu3FfE1KRRUpWYheALNBURUVy7cy9UkO6KW/+Lbt0IPsFui4gLBbUqFaUuXETUKCYa0jS5yZ2ZO557b5MmTXpgmDPnfOc7jznMGINYPi0de5UvmpORxpjE/kbNqW005DVu8TWw1H758ZfkFgNgJmtyxSPRjJIj0QTW/RDiYGXGb7Dl32/eXrVsd0gSCx9miqC0ooCdp69g5Q/h6OLN0ty5ynIkwzMwUwh2FwMdcbDiCZQXlkqFCpEoPT/wih1YjLInANcD+/Ua9bu3wJlGvrBZCmet2+S6ME5g4oGlZ9A/I70XCDhhDexPNTFmswJBwcnuXkF86VSNZxVu0ukLSGnBcqlnN4HoCQIaIuIv7LUooMOgQ7q75LAAb59B9gCBHSKgqemRr94mMKmD24CfM8nb7THYGQNLpAkUkcb66JyGBFFEWRVL57gFEH5qj8Lxwca2qS3EZaugmzAw24dR/XQgwtsCSBjPIdWbUoE2UJLBnV8Ac/ciWHsK9/glWLnD6K2vgPszsOdOQdfeQ1c/ThKoTgDn9A3KUED/52d45xchZsvorD6Bf/Z60riV3Q9Z/0bbGU1uopYGkfERSQ3VbsMwl0qlqoIARmSoPYXWy0dor79LfBMEEd8jGs/uQ3Yl7PJFNFbuEXiV2riCf88fovXhBbo/vqP3t02/ZYmJFqTkzY160Go9uEMbFK8hR/NrdXtFuUVmnmySVGgO4v4LMAAjRgmO+SJJiQAAAABJRU5ErkJggg==", + "ods": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAetJREFUeNqMUj1IHEEU/i7u7Z23e8tGgneGQPw3hZDkkhQiSuwMQREba4uUgpVlCrvEQhurkCoWqcQQ0oTAaYKNqJygGEwgHCSB6Knn7eXcdX/GmdHVPWYFP3gw78173/vmvYkQQsAwNvckq96UnyIEh7/d4t7uUd/8y+85P+bXSX4grkhI6nJYPW7LrXpBK2YxiSoShhu4Buq1NPofDeqdrZ3Z4cl7D4J3UtA5VyVAlmJoru9Af2ZAp1lcCQ3nqgiuKmbY3l/BH+MnHM9GVLP0Ww3KNA33CQoQQnL834Fj74PUGkANEIkCSSsa8gQqgYTIcB0PVsXB318GInRiCVWCkpRFAs+j5gKlA4t29Ggh4d0t04FKt9PQqF4UFgumSEA8ApeaElilWbYRVy/lsns/N1QBkxtENF4jxPxcgcB1CZVOrvMteK5IQDtJJIGh++PcX9iYwWjXK37+vP0WdYk0Ht99jtX8JywWFkQChw4tc+cZcvlF7rMze+ubbxN40fMalRMDP/6twaiUeK7wlZ0TD0a5hLTWxo2d45KKprqHKJslTsy209s2wnMFBTYNZjc/oLt9gPvLOx+hxVJIKS2YW5pCbSyJTGMK775O8VyBwDJd2LTDl/X5i8v3S7NVw9vJb51tITDEUwEGANCx2/rXEEFFAAAAAElFTkSuQmCC", + "odt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAepJREFUeNqMkz1II1EQx/+7Ca6JkqyYiJ8cKEpAQbBQFDm0sVOsFBS9wt5KOTgEG5twxVlZ+XEnKNiIghYKxx5nwEpIIXaiSAgKGmMi0d23u8+3T7OaZJEMLG9mmPnN/w1vBUopLPNNhRWXHOyDg0nx82TiJtZPlPVoNpftc2cTotcHtxx06kdXpSQ/BvzKESZzIDmAz6y+NojOjpDMZiqRPIgNoFyWM8DrKUV7axO+gcp4g7AzmquAdVNqOgL2z2I4id1B0wgeygOyt/rLL5buLwAIDgA9dY+L+DkuDQOCrkMgBsRglcMOqAGwIstMg8AkGsuZMNUMRMkLqE+QGloglvlA7uIOAKvZajR0qJkUj/XHe0BTIclVKKlrfKsj9qA8gA6wqSJzPaXlr7ky//tdLEUfawsBjExUFGVWbT7AxSa42H2LMfODmvd3wKb7RAMLYwM8nts8xJ/pEe7/3PmP2eGv3D+9usb35W0bINoA7RmjXSHsH0f5Z/mUSZ0Ir2JmsBtD80s8/rGyzWsLFTD5yUQCbfUBHl9d38LvkdDTXIuHVBo0k+bbt06qO+yAPGXwe/cA4wO9PN44jKDG70GougIzi2tQ00ms7/3lpwnBBgjZ37Kkd1Shht5XzBIFl/ufFtniT/lFgAEAU//g6kvdGBMAAAAASUVORK5CYII=", + "otp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAcJJREFUeNqMkssvA1EUxr+ZjkdbrfFKVD12ErYSRELY2fkH+BMsLcQaSwsrSzZi47EjJEQkEhYkFlhYSVtFpdqOqpk717l3jKZmiC+5mZlzv/s795wzCuccQncz3YeRBj4KHz0/RrOZe2NsZPP20o255zQ3EAxzEAC+6uzTw13G4TFQAakA/CWtIYbY0KBOrx7IvwDQqlHV1o3YxKTOvyAUvfQCfqmA3e4ikyS/zRAKvOot7eoSHEgZIHrCfQAfBqBaKQQDKScQAExd8emBANg+2U2CvNMkkgSqBmrCxFB8mujeoJBWwEqARcssKTAJEGrmaGrjqK1zvNknH4BtyxKl2VUpRxmj5W+x73q9AEaZrR/ND1EJluIpS3i9JQiA+a+hSq8HwJjTsLrRaWitPTCOlhEZn5N75sM1qigmlN+dB3u++Qao5W4TtbEXXIsiszGL4PA00itTsu6XnQWo0TjMTAJqfMDx/ryBJcaVzSNSH4fW0Q+rkIf5rsjRiid7yyN7uoXS3Zn0egE0NiORAN9bQ017D1Lri7CLlP2EDr3Rf7C/itzV2bfXA/igLDaRixfngFhSCooH2xVPCWBlwKcAAwBX1suA6te+hAAAAABJRU5ErkJggg==", + "ots": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfZJREFUeNqMUk1rE1EUPS8zmabJdDKB2glEwY9ExJYiBUEQpV25qgtBXfgbpEtXuujKf+AfEKRddOdOGHClbYVCvyKWaijT2mhjphk7Sd7Me76ZONp0EsiBYWbOvfe88+69hHOOAE9f3zTVnDKNHvhlsfqPw/rM0ovyWsRFdXJEpDIyRnSlVz0KSkmvabaJeXSJBEhgAJzTDNybmtUnS5Pmg/lrN07H5NM/f13FoMgpXDSuhiIiK3Qi6LUugX7FAbaPPsJqfIHHKCStqRsXVFPQuZgD9BBxjikSiRq41AAkgCQBzVf0+BWEBX7GBm0xgHHUqk1UbBuEcIydzyCZlOI9YEGuDxwduCCitS3Xh3viCZ4jrcq4PJ6DLHd67tjtuAAXib54dCPVEfQ5XIcik/0/2iDeOYz3ceCxrisMi904y0XiMQFfkB7lg6xFHwFxEqUMV0anUNBLWKm8xd3i4zBWOzmASx0UsiW831mA59Xjm+h7HCOygduXHqJatzA7Poey9QnXjTuoVD/j/sRcmDOWLgqnLC5A2wwST+Pn8T629lahSCo291bwu9XA7vcy3m2+gTaUR14thrk9BXasbdiOjSe3nmPpwys0xSi/HpbDd3bIQC6dx/q3ZbRb/j8BEi3Po5cTJpHI9CBNDEa++GyDBN9/BBgAwfDlCVUQaNAAAAAASUVORK5CYII=", + "ott": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdFJREFUeNqMU89r02AYfpJ0iVm7EqhVOxw7dDBEdpiCE1RoEZRddvUgbIex/Rs7eehppyF4LOzQu4MxwYp0HgShIuwwUVSCVtl0s13afl+SzzcpyZYmyF74eN583/s+PO+PSEIIeJZdrtQVI19Cgmk/Ph39bpllXq82g7sgLxVcyKNZpIx8Uj5u5zSjc9Gov8ZihCRC8D+7On4JczevGeTGSEIC4ctKJtB1DTPXi1iCCEkIm1EFlC2Em0iwtWfinXkIzjiO0jljtDC5TtflGIGUQMB+mfja/oPv2Rx9MMjpMdJxOXyXTwkcwIkewfqQ1QtQNB385zcI14FrtQexsSb6SRysZ4Fbf+F6eHwATc9gJGNAm5iCTL5n/LCVRGADNoeaGoHqyaXj5gqQlTODovcwNk5Aj6wXqV8eCo7EDhMonEHpW+dZC7gUG98D3geo7vkb01h9cAvPdt76OGy1xntUd3bjUxAk3+l2sHJ/FgtrT0MUJNfDSm0bjQ/72Hzxxo+NK+h3B7XRNO4UrwymQtMIkdTBU0m+sBOayLsn8Ka78mQDjx/e87HXPkb1+UsfP37+AmZ1fP/suknBb6nefVQXjl06TxMlJfWKNWr+Kv8TYAAkUueexJF47QAAAABJRU5ErkJggg==", + "pdf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmhJREFUeNp0U0trU0EYPTP35qYxaW6TlDapNKWGbgo2FkF8rARB6rboXusf0F/hyq2U4krFqugqSBeuAyL4SERBstHa0iR9JKZJ7mvu+M0tqZGkH3x8987jzDnnm2FSSqh4ns0VU1ybFzj674Wa3uWiWbfsFQb+jrGj8Xvbm0HlvYVRxhJprpmTlGmum+OMm5uNPZNbtjk3l82ey8++8oW4Jv/H/wdA456g2kvH99FyHNiuAz2dwflbN8YW8zMK5Go/CMfQkAhpGsyQgRCtlpE4jIULyC9fHzu7MPPEl/5ib6WOE0JJNRiHHg6j86mMjw/2gG4bkbY4PW4Yj2j64skA5FTHdaEMPiAJszt1sK0d4suJmY4k0+IDDGRfqmh0u5gejQc+fG8eYCIahRQCEfgQnIuhEkgtONE+dGxYxEDj1DhiEycZ+1YXdUpHCqTMJIYyEES5aXXQsi2kYlGEia5GtHVKn+amPBeCutPgfLALPuVu+xDVPw2EQyFEjHDghbpYNm1yKVVnYjTOerepn4E6XQmLGSPkPkOXWATMSDcjQEkAaqOu6+i/rccALtFL53LI3r0Nq1ZD4/MXZJaWYFer+PXiJc6s3IEgY3+uPYZHTAcAHM+DTE8gnM1CSyaCulv+GrRy8uYyElcu4XfhLVpkpNtn/DGA5Uu0abFH36WnzzCayWAkmYJvWeCkfb9SwY+NDbSoOx4bYqJF8rZqVRRXV/HhzWtUSmWwmWl0RmN4v76OUqGASrmMOkntSHF8MOs954dT08W248wzYsJDOujRBAaqqikTpRo/qqd0/dv97c3Lat9fAQYA4z8bX9nTsb8AAAAASUVORK5CYII=", + "php": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAhNJREFUeNqMkltrE0EUx//ZbDaXNrvZzdIkbYOXGgxYQlCK2IIY6EufxGdB8Av44AdR8AP44JOPBR+Ego0PClUKTTXQSmkTYtOkmubSJrQ1e3H2yJSEJNIDs3PmP+f89pyZcdm2DcdWvn7LzkxFHmCIra7nm9ulg8yLZ09yXON55Dgjt1PM2iPs0+aW/frdh8bzV2/SvQBnCLiEqcFxLKSSodlrU9leiGPihWePBkgeEZO6ShC2dCAZNuf6ADb+ldQ5PUPx4BCFcgXfdwq4Ph1Dtd5CZi4Nw7SQiMdCXkl6yVIy/QBWgcU+yx/XsLK2cdHndqlK/lZxH/OpJO7fnsWY3z/YAq+g0TmHpoUH2vB5PXi8RD9Fo10aAmDJTgWyIuOupmK38rsPcOvqJO33XWEvwLJsmKxHRVEwf/MKWl/yUMf8mIloWN8rw+sP0D6PHQmYuzGNgCRiMZVA17IQV4OIaTI8buH/AJMFd02Tkp05PO4jnWvc57EDAINt7u1X8Pb9KgI+Lxbv3cFR8xjx6AQ+b+Txs/qL9KePlih2CMBCq92hg2qzt1AoV7H5YxdhdqhHzRbgcpFeqdUplpvQW4FhmAixZ/sws4BoWCM/qmsE5XqE3dDQCrqGAYWdejqZgK6GUD8+IV9VghBFN1RZJv3sT5diBwC15gncggCPJKF0WCPN8dun55jQdVpz3Ynl9leAAQAJhiGatD9AOgAAAABJRU5ErkJggg==", + "png": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmtJREFUeNpsU9tOE1EUXXPp0CAUWmJbC04xBANNTF+kKhG8fID6aqL/gPEj9E0lIf6Dj30HL03wxQtVIC0QKrWxNG1Dk9Z2Oj1zxn1m0oIZTnIyZ8/ee+211z5Hsm0bYg29fLGpxWIJWBYGS5IA8ncKhT9Wvf4Yqprtu+w3q85X7f9QxseD/pmZMZsxN9fnc5JNw0ACGGv6tPSvyvEDKEoWZ5Y8OHHObKpucw4B0t3agnl4CJPs2YkQVu4s61ORaBqMJc8CDBiIRhhVM9bXYdVqYAcH8M3NgS0tQQsFcfdKHEbvlr6WyaR/V6uPKPy7B4DT7lUq4MUipMlJ2MPDUKtVfKZ2nn/5BoNbkONxXeb8LYXe/A9AJLNWCxgdhZJagDI9DZg9qIkEytRSkdqTSFQtGILSbgc8LViM+tc0yPfukzIyOJ359k9YR0eQdB2KmBbpwXoM3Dod1SkD+scpEapCI5DdpsJhIJcjajQZagcjI+5oLe4VkeQnyiZgdIH2X6BJ7dSqQLfrggjw0AQwP+/GegCIHppNoFAgEMO1RZKo7BQgRi3yN05cnwdA0BQMAgF3C6pnbuNg92M9AFT1diSCh6kb+FGvo2MxnBB9ocZxp4Mns1cde213B81e7xwAcl4jkaa0IUSjUdLJwkL0Ej6VSvArCt7l81iku6GrKnYEU89VJlSJRmR0Dax+fI9suYxSo4HlWIw6M3FBlnD9YhiXabyOsOeIqG7TzDeIYo6EDGp+ZPb2kKKqH8h+mkxiI5/D1/19J3bwYPvPWXq2skkiJVxesqt0XzghpKM8nRVV2Lv2q9eLIvSfAAMAaacnllcFBmYAAAAASUVORK5CYII=", + "ppt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAkhJREFUeNpsU11rE0EUPTM7ySZpmzT9DNamWAtFfSiCigr+AxF9zKtv/hvf/Aki+FEi6ov4ItWHPGiwiBUKoUqqTUJImmR3M7Mz3t0kNe1m4LIwc+65595zlxljEJzdR5uf5nLmsvZx6gSvtd9W9bjhF7jg5dH9nRc/wq8YXaTSJptb0xklx7IZoKUEz1zJ2DUU69/37vFYrDxegJ9U0lC+AoIIVGg9CL+vIObP48KDQn7x0sWiVnJrnEDg7KGk+i/Ac4iUM/R7BsmrSSxtXMfa3X7el8+Kjf3KfUJ+iRJQw4w0Tc8BRyWGRAZY3rBR/VlC+XED2ayDhZyXl03+hNA3TxNQshlGLAnE44zCIL1goXZwiMNvB1i6zbC0KuAsxNITWwgNMYPeLVJiFEO9ArjHAivrAjNzBr4f4vwIgdGD4YUACsZCE8AtYGWT5jCsGQw5wEYJzP/pj5RwYTA1b07eQmfZ8P0sgdaM2FlYwWkMgMpl6NQAO33GKM0wsQWflkh1uqGVmVWblsiDkQyqxwfag35SqcktaEWTUTHYNx4iGU/C29+BvX4Lpu/C7zYgFjegSY63WySsHyXwpYHU00ieu0bAOuJbBTArBkiXKiaAmTzcvRJUV9E8rOgqBwqlY8ASs/AadbRLb8CzeTjVClqft6FdB17tL7yeCbFRBYoLr6vR/PiSEl5BZJaBD0/R2nkOZqfQ2fsKt+0SEQ+GLSIEUvJm+6jbah2+pS2aon+4g/afd4SYJVuA7vvXdC/IHQtSoTnK+yfAAIEaId1m+vudAAAAAElFTkSuQmCC", + "psd": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAqxJREFUeNpsU01ME0EYfbtdKKWGtoItRWgJHApCBE2I0YuoiSaaeDJeOJh41YN3TfTixcRwMfEk8eDJGA+Eg0YTTRRMg02KKFooCBbTlkJLS7f7P+u3K9Xo8iWT3Zn55s173/uGM00TVlwZfzJztD92iKO5ouvQGQPHcQDN380vlDPr65fdLj4Oa41i9sFt+ytgN7o7woGOrqgvvpLBaF8vWj1NUAwGTVNRM3mf5vU/zaU+XySQuTqIFXz9hxmGLkoS7r+YxvVnrzGzlgXPDOzUZPT4m3Dt/KlIuH9oUjXYEHZZ/wOgGQZi4TZcGI5hLb+FO++TSOSKcLtcMA0dI0EPrp4+HtnfG5skiUecDGwQE2MjAwiGWlFVNDz+tIyCokJhPKYSX7Gdz2I01hOJdnY9rJ/7UwPGTEiqjtbmJtw4MYx78S/4Wa3h5UoOYwPdIOp2Xi/t18rlFgcDw6o+ydiWVRwOBnCpL0oOAMmNEhLZIgSeoxwGSWcERon/M9DoBknTIdNQNAMnO4PIVGpIFXcwndlA2OtGc4MAxml27p4AIulWSIa9QVadiYSoJxhqBJivKgh5ad3k9gaw6JdlDaqq7q5wINY4F22HaLHSDZQkBW72O9cBYFEviBIURQH7a7MN0uDisUW12ZZcaGlmdq4DwCqeTo1zNtZuW7hUqGIw7MNqSUS2ImNsKEpSdEwt5lGhfQdAkQBEoub3NNrDJfAIeBuRrcrY5xGQ2RFJAjl00I8PCckJUCB9q1URBnk38XEJEuk41tmGwZAf66s1VOh2keqwoUnYpFxHH4iKIixkN3HzVQKP3iQR/5GDKMuYmE3h+fx3MHqh1sMafztHLuiCg0FAk0uFdLqcpGY5QEXbTC/j7mIaVjc18DxufUtBJ/vcggs+3ijVz/0SYABsJHPUtu/OYwAAAABJRU5ErkJggg==", + "py": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlVJREFUeNpsUktvEmEUPTPzTUFmgJK2UqXQFG3pA6OBLrQxamJcaYwuu3Dp0l9iXLvVtRuDpgt3JIYaTVSaxtRHsJq2xEJBHgXmifebMhECXzKZme+ee+65516h2+2Cn2cb2VwyHl12//vP2/zOQaF4uD7GWN69e/LogfNm7kUsPBFaXYwHMeK0OlpQEJApHJTuykzK98dE98O0bLM/UNgr4v32Dj1fwSQRt9dSsfmZcMa0rIv9ODaqYrPVxuPnL1Cu1aEbJu7fvIZUIo4bqeVYRzcyv/8c3SPYpwECt/dmu4ON3Ed4TymI+hQc1ZqoE+F+uQLDsnHlwkKMscJTgl4eJOi9fxZLePNhGx6ZQRRFqH4VjZaGSv0Y6cQcJLpra0ZguIWegqDiw7lYBBZV6xiGk9DQDLzK5bEyF4Hi9VLMsoYI7J6Es5PjeHjnOl5ubqHaaJGBEkzbxplQAKIgDmBHekDTgI+qKKqKLvNApgmEgyquLs1CoFn2Y4cIeLJpkjoCLkWnUSIF3JxISIUsCjAoxhWNJLBIJs3YeXj/08oYZkOKY65HllE/bkMmY504YUd40HUq2JSSyW6iVPmLiXE/ZMYQCU+hXK3h1toqdNN0sEObyKtqtDQ6kXDwcadDS2TBryp4nX2HxXjsJK6bDnZIAZem6Tp5YMMmicn5OC4lztNWtvB9cg+hQABtWjKL2jH/T3GgBcYDXEE6mcDM6SlaJAGMWkivLBC54ZgniZaDHSI4rNSqn7/t1vgkGJPwZXffSeCjk2iUWz9+nSTQN8e6ef8EGAClUi/qoiOc3wAAAABJRU5ErkJggg==", + "qt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnVJREFUeNpsU8tu00AUPU5sp41NkzRxpfSZqi0VIIQqEEJUZYXECvbwCWxYsuBD+ABUFrDrCnWBQEJdIWigBSr6pqRJ1ebhxrE9M7aZmSrQ4o505fHMnXPPPWdGiaIIYrx89GKpNDdxmXkU3aEoCsT+z8W1Sm21+jCpJctQTvaerj+TX7WbnJ+0cpfuX8mQtn8GgJ4AZtIFY2Hz3foDVRcgyt+cRHcS0IARh+D/8G0PpmVi7smd0dLs+AIjwTVEiANEYYQwCHlEZyJgIQKfoX84g9uPZ0cHZ4YWmE9nuufU0wABCSSImMsWEgqSuoqA/39/swZFTWLy7vQo7dDnfPvWWQa8GuOV3IYLJXmyzDzG2/ChZ3pwbHdQ267BKJoYuj7SF2MQhiF8LuDK/Gf0DKTBKINz1IbTbEMzU1ANDW7LAfEIQKIgBsBFlAx6LYOz6MAcvoDCtAVGGPKlAiIu/F55F33FDA6W93EOAOMaMOl7biKPwRtD8Foetj5sYPfTDtxjl1f3Ubo5jkQieQ4ACSUD2iE4XDpAdbUiW9D7UsiN9WNkZgxajwbd0LGzt3keAJPUc1N5SVeENT0Ao2BKV6QzwlZeRBSKAYhe3aYHcZWn7l1EfjyPypcK9LQGa8qCvW9j9+MvaasQOHaRhGWdhsNLR8hwodYWf6B4tYjDjSOovRqq32rSYq/lytw4A77o1V2ERiAtzY5kkUrrsH+3QF2KY87ArTtQuQ6nAf4x6FCV1D001+vYersBM2vA4y1Rm2D7/Rac/TZIw4d/6MrcGAPf9htN0miJh7Lyuoyvr8rQeP9iVJcrSKgJ+TrFcyYebXTP/RFgAFQobmIOBxbsAAAAAElFTkSuQmCC", + "rar": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnpJREFUeNpsUktPE1EU/u68OgylZXi0hZACQU1LEKKCMcat7jTRnQsXxsQtv4E/4M74P1iriUaNCw1FgxpjCJQKKAU60+m8mJnrmSll4XCTc8+959zz3e88GOcc8aq9evChOHl/lvMoubvWX/z4+BwTlbvw7bXdg8b7h6LE1gGW+O88CRMt4XTlR6/rYxce5Xv3jlHH19fPkBu+gWy5mlcFb3Wn/umeKOEMJF5C7xCFbtA9dRXjFoYKGiTRAlPGUV1aKU9O3VwNQ74A8DQAIZxqAuAhBPIMFYpQVAVB4CPSZjEzv1weH5tbDQN+JQ2Abu488mnzIbAAA3o/VK2PwDJo7r5Fy7ZRuvi4PFS6+qIXdVYD8Jg6BUcuOD8BozSLlRWyicgVKkTMQWwUlFF0Ooe5FIPk57BD7G0SiywyjD8bCDyHsOkeeeR3SUxEkROmU6BfQYFJMHfhWXV8efkUrb13VPMTsrcTQSzxZ/+n0GVA6EGbSGdgG9vo15fg2nFgbO8k70SRdd+mahDT81vUxTZRlJBRMsjq89C0EXCvSf7TIBZ136YZUJEiE7LgJ2dN01BZuE0dkIhxE7KcQTK1QUj+cwAEyrPZ+IydzRoyah+mLy2isbWBweESJEnB9q+1RM9Ub9GQOWkABg8HjRr2d9Yh0hTlBlRsfn+D4vg0BvUC9rZqECUJuk7Tzr1zahCYlB6HJAREPwfbbMBzLBzsbUKVI0qBgQkc+SxgWUYaIAqOpKwKXJ6bgGlaaDV/YvHaFNrtDsKTfVSrJeqIg/bRNwjclFIALeP3saybhu8SC4VBHwnhBXXIKocYRXD9QzBi4Xgchmkd9+L+CTAAMqwy+ZzluBgAAAAASUVORK5CYII=", + "rb": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAixJREFUeNqEUktvElEU/mag5f2yJhXLwxIt0kiqsVEXujP+A925cu1Pce3WtXVtYuJCF7KtTY0NrVQIpRVKeXTkMcO9F8+9ZVooJJ5kcmbmfOe733fO1YbDIWS8+/g1dycVX7W/xyO3vdsuVKqvnE7HZ230783rlyo7bVBicSGyfjsVwozomVbIPe/c+FmsPHfoRKJd1HT7hXHBZjVbA4aA14NnD9bC2VR8gwuxPi5Sx39Cp+M0XUP0ahhP1jLhW7HFD4zze3b93ILtXYyyVKlR8/5hFbnvO9gtlrGSjOF+OpXkYviWyo8mCS4R6bqO4p86vm3v4fC4DrPfw4unj1XN6JvBaQtjChzUXK43sVU4wNFJA43Tv/B73edQwTmfIhAjCVL6UdPAj1IVFSKhCdAcAI9rnjBiAjtBYEu3GEeh1sKJ0YXR68sVIujzIhzwY8DEBHZqiLRKkicQDfvABxaiQTc4Y/C65pCOXwcjcmlvJgHtlwi4epYifiQWgmoLZwPW6HQG07LgcOgKO0UglAKOTt/E+09fwAiUWU7QAE9xUK3jbvomsispZVHMVEDSZdHo9rCZ/4VIMKAu0XGjpU7d2S8hk0pCELHEzrjKnCQOYJoD+Dxu1RyiwUm5LaMDo9NFt2cqDLvY4oQFp/QpfT/MrmI5FkWebt+NpWto0j2QmQkOjZ9hpwhqjXZzM/+7LU+cc7lRrjXh8/lVLRK5ovLWXglOsiOxdt8/AQYAzv8qbmu6vgEAAAAASUVORK5CYII=", + "rtf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAe5JREFUeNqEU01PE0EYfnZmd5FSvgLYFuwWt9EgHyEaox68eDJevHvwJ/hTPHv1N/QgZ2NC4g3kUAQKFKGhjVKqRrvbnRlnht262FHfy+y8877PPM8z71pCCKh4/ebt+rJfXEz26Vjf2mnsN5rPKKWbVpx7+eK5Xu2kyMtNTd5d8MdhiJ9BOO7atFI9ajy1UyAqSPIRMR6ZmoNehNHMMB7fX/UWvEKFMbYKE8DfQnAhwRmmJkbx6M6S5+WmK2Evup2c9yUk2nnKA0XVcSiGXAe1k5beP1i+4RFCXqnPywB/AKVzK34RjHNYlgVKCH50w7EBBogbTa/AVM5SgBdn0gc2AMDjPsbFPz2xye9asweS6n+NTbG8BCCfUtLjff2WoVnVpAH6z6hMUtJE3EykYfpF4vUiL3QNS7FMeSAQRBHW3r1Hq91B+VoBQRji4+ExFsvz6Hz7jm7Yw5OH92AcJKW9G4SoHhzhy/lXbB98Qmm2oCXN5WawsV2TACEoJXqwTKOsb3BtR2ucmZxANpPB8JUhyPnHWDaDpfJ1eZFALzJJ4MKO5MEtv4TSXB7V/br8iQLMz+almRZWbvoo5q9qRlxwewCgeXbe3qrVO5ZkUD/9jJGRLPaOm6COi92TU1DbxYe9umRD0DrrtJO+XwIMABWp9nS+FgaoAAAAAElFTkSuQmCC", + "sass": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDNDMTBBM0JGMTE5MTFFMTg3N0NFOTIyMTQ2QzhBNkQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDNDMTBBM0NGMTE5MTFFMTg3N0NFOTIyMTQ2QzhBNkQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowM0MxMEEzOUYxMTkxMUUxODc3Q0U5MjIxNDZDOEE2RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowM0MxMEEzQUYxMTkxMUUxODc3Q0U5MjIxNDZDOEE2RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po72XUcAAAJcSURBVHjahFJdTxNBFD1bykc/ttvdtttWGgI0bYrUgDZoNYqRJ014kMRXHvwB/hQTH/wFhMREJfFBQxBjhMRIFEQSCAlQxKYGggiU3e3HbnfX2bFt1EU9k9m9mblz5p4zlzFNExYmpue/jmTSZw5PZAl1MAwDT0c7O72wvPdudeNakPNtOZ0tsM7cvzdOc5yN5LDAsTFRAJks/kC2PxFRVe39Si6f4byez62EpAEH/gNN18F53Ri/Ocxf7OtdLMpKT42s/ZPg1cISJp/P0tg0TBzLCoK8D7eHh4RkLLJ4cCz12AjMXwgez8yhqtVo3NbqRKlcxcSL16gZwJ2Ry8KVc8kZO0HdTKlURn+8G6PD2SZhLMQj96WAiMAh2RXFYKI78lcJcx9WYBCycICnpNbojUWpD5Y0C4Zh2D0w6hWc70uQZC+IWfQZrXF0IsHvY+meBd08haAhoVMMQFJKWF7PNZM+klhRyogGhbqxOIXAMOtEwGAqDqVcgbVkkE+5UsEAWavf0az2t0ZqvK2qabh6IU3joizDwTgwej1LdVfJXkdbK8mt2QkayO99A0/0trQ46I1lVcX+UREhnsP34yLp1AD1xibBMuntpzU8mJyi3Tc1O4+l9U06n7x8Q/8PHz1DrrALt8tlr0CrkbJMHTop9Sk5sLa1g8L+ARJdnShKClY3tunN69t5iGLYTlCtakjFY7gxNABdN3B37BaqqoYT8pyX0in4ORbRkIA46YlDRbUTbBZ2Jb/Pw4qiKFnapcpPo9pdbrg8DjAOBsFgELJmsGs7eWkkc5bu/xBgAHkWC6UPADTOAAAAAElFTkSuQmCC", + "scss": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RkM4QjYyNDVGMTE4MTFFMTlBREZCNDNEM0ExMTk0MUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RkM4QjYyNDZGMTE4MTFFMTlBREZCNDNEM0ExMTk0MUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGQzhCNjI0M0YxMTgxMUUxOUFERkI0M0QzQTExOTQxQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGQzhCNjI0NEYxMTgxMUUxOUFERkI0M0QzQTExOTQxQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pkf1yeMAAAJbSURBVHjahFNdTxNBFD0tLULpB91uodVWPmorUIxo0VSiNSExMYYHE33l0Ud/in+C+OSjYgjRGDBRCKJIUkIEWi0WKlja0ul22+5219lJ26gLeiezuXvn7rnnnrlrUFUVms3Mvd2bjIyezRVLBA0zGAzo6jhjm1te+7EU37rFO+w7JlMbtG+ePJ5mOaZmci/nsPl6ONBtw18WDQc9tZq0sp7YjTisXV/NFKRpRvzHpHodDqsF03djzuvDg6vHJWFAprF/Arxe/oins6+YryoqCiUBvNOO+7FrXMjnWc0WyIAOQP0N4Nn8IqqSzPx2swllsYqZl28gK8DDyRvcxKXQvB6gISYpiwgH+jEVi7YAfW4nEqk0PJwDofNejAX7Pae2sPhhHQoF63U5Gai2Bn1epoPWmmaKoug1UBoMrgwHabIVVCx2jdrKFwm67TZ2plldPQGg2cK5HheIUMbaZqKV9In6giDCy3MNYXECgKI2gICxoQAEsQItpNCHWKngMo01arTY/jFIzbutShJuXh1Fm9FImYiM7tTtKOtbO+toN9Nc+fQ5SGUOIVYl7HzPIH2YRZ0y2KZ+sVzBHn2v1mpMGx0DTaR3nzfwfGEJdybGkdo/wEigDyvxLzg4yiESvojZhfd49OAeLJ2degaSLIPOO6vwgiYaaRErTRREEdn8MeJbSVZ5M7nLdNExqFLaQwEfFfACQn1+HBWKSKb3MT4Sgstuh9vVDa+bQ4DORE6o6RlspzMk9TOPfr+fiLJCLFYr3TZSKNcI7+aJwWQmPM+TkqRg49tu65f/JcAAMwMas6WUKd8AAAAASUVORK5CYII=", + "sql": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAh5JREFUeNp8kctrE1EUxr+ZyXMkoa1NBROaSkpTBE23PhZ25cql2y5duvAPUdGFS1FxIRRBXZlFQ9GVdDENIhGJxkDsw2mneZnM83ruNZlOmNoDhzlzz3d/9zv3Sowx8Ch/qlYK2XM3cEJsbH0+qjV/rd6/u6aN18b7RMFT+9aosP/Ex+0ae/puw7j36PlKEMAzctKJ3aGFamMHjV0d+wcGitkMrpWWp6hVIciEk2MAOwbUWjosx0UiFoWqJpGMx5DNzODq5aIPoa82AWBg/lyKLMH1PMp/a9XvLXLzG1cuFlBaWpiKxaIPSLY6CaC93ggQjyiQZRkeQSzLRovGaPciWLt5faSWEBoh6KBvOhiaNga0+Y9pwaFxvu7rfp8F5pWDt+qNMp2IijHGwddWCvN+33/CoAOP5nVdT9SdoQ1JkggiQ6Yvr7V60+9z7akA2gfH9cRF8hO5F5Ve4lQAF9uuK+qFsylkzsQxrcaQm04hdWkR83Mzfp9rQ3fAFzu9Ph6+WMfjl6/pGBdb2jbKmx8QlRjWy5vkyhUZBPgOeGNHN9AbDLGUz6He2hVj3Ll9C8/evsdgaMK0HV8bcmDTU0UUBYXcedR+NLGnH0I3jvDk1Rsy46FP4C/1BtrdntCGHNiOAzWZgEKQ5Qt5lIqLojbaXSQTcRy2OwT4SZqk0IYAOgkVWUE+lxX/zb0DpFNpkTzmZmfFtzewhHYcfwUYAMZmVaZQlLFHAAAAAElFTkSuQmCC", + "tga": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnxJREFUeNp0U89PE0EU/ra725K22ILRGipb22pMG6JcSEQTbUIwnozxpBcvepeEP0KPogcT/wlNT17kIKbEmChFUYKGVtL0R2gLtNCl3Z1Z3+zSAlonmezOe/O+973vvZEsy4JYnqdPMu6RkSQYQ29JEkB+PZcrslrtPhQl23VZc8/tr9I1yMHg0EA8HrBM04lVFAhoY38fSSDQVN3pfKV8G7KcxZHl6v1xblqU3eLc3p2VFZjr6+gQgwsnhzGTuq6Nhs6kYZqXjwL0GFhEl3U60OfnwWs1GGtrUKNRsKkpeIIBpKIRtI1J7cX7hXRhc/MOhXw5DkCZGG2zXAajzFIoBMvng1ypIKOqmP30GW3OIEcimovzlxRy5RgAFwDEAIODkCcmIMdiQLsNdWwMZdJlg8pzEUt1aBhKq3XinxKYqF9yQbqRIqsMy+0Gyy47bKgUWXSLtDENE5wdtuqQATm50F1VnPbRGeEw8HXZbiV8fsDvI9ldju9vADAyihLEbrWAZhOoVp3z6iqBUiB1A4nEfwCEsbkL/M4TgE5n5jDx+oTEzp1d8m9tC8H6MaAB0imzx0NU/WKUYE+loEyawDBo2ui6TGfT6ANAxrvx87gYCGCxXEKVJvCWFsG3eh1vN/J4OD6Od4UC8o0G3TX7TGLHwI9iEQmvF9X6Fh7F4/iYy+GcLOMSlfEgGsP0qdNOmX0BiGKpVkV1bw/1nW2b/gCpf1PTcI+Y7eg6ps+G4bG4PR99SjAVo9HE4q+fKNE0vl5awuSohjeijbRefVjAtUgEQRK7Yhi9OKn7nKWZxxlSPWl3QwgnaIrW8QMhD542vUbx/W49m7sq4v4IMABOqi3Ej7bAEAAAAABJRU5ErkJggg==", + "tgz": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnhJREFUeNpsU1trE0EYPbMzSTfdtInFtkkpiaXVWou2FRUEn/so6JugL/oH/Af+B1988if40jcFERQURNBSQdDWlLQN2lsue8neZsZvc7FoOrDszM75znfOmVmmtUYyvry++36yfOeS1qqzDtvH2P76ApPlW3Drb2sHex/uccHWAdbZX30kO2+B3siN3zhTnHuQ66+95i423jzFzOVljBdKOZNHazvVT7e5wF+SZBj9iZJ+3J11mbW2kR8T4LwFli5i4fqTUvnczTUp9RLtDhKgJx0q4dEwWAxrREKICHEsoYYXMXvlcWmquLgmY71yCkG/c0AkARgLMZpnMDMpGNzEYe0dGp6HwvmHpbHC1Wf9MnFCkHQOyYEPzSJwQ2B65Tm5NZG3Fshim6wbMNJn4bpHowMKtIqo2COgR2IcAptwjvcgo6i77igjEmVDqbY8xQJ1VwRULhiBI6+G9Zf3cbTziuzIDkmHSNqECTFgQScEcYuc2NA8TcdYwXD+GkK/TYVN+u72WrIudiAD8o6oAR2RRCmQMjis3CIy1iSpPySCXhFTXeyAgh4BR+JVw8pauLi0Cp4yCX9A90FQhnSBYtnF/k+Q+HYam9itfIZB3QvT8zj8XSW5EhNTs9ivbSLwPUzPLNPJBIMEKnaQYg6aB9+RGR5F5VsNgnNKXMI1NdJGG5WfHzFVLJ7k8c8xUngpVodlDSGbFYj8Y4yMpOG09lHf3yIFPzA3fwHZTAQVtU4JUTeFDrdgDdlI8wAz5Qy2KxswReI7QODZcOr0ZH3q2hIDBI7zq16tuk3FNPxAI4wN+pkoccYoE4YJU5EdUtM4Qst26v26PwIMAKj3P/2YUKgYAAAAAElFTkSuQmCC", + "tiff": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmRJREFUeNp0UktPE1EU/qYzHWstlrYJNcWUElyUJsaNGh9B0g1Lo0v9Ey78EbrVxBhXuHShm25YGBJRQpAYBDEWpaEPEhksdVpbyjzveO4MfZDCTWbauefc736PIziOA77OPH2yJCcSGdg2uksQAKofFou/7VrtASRpvVNynj13f6XOhjg8HAlMTIQdy/LO+v3uYUPTkAHCTb+cK+0pdyGK6+hbvu4/xiyHbncYAwfR19ZgbG/DoO9LsSgeTd9JXoxfyMG2rvQDdBlwIZauQ5ufh12twioU4E+nYU1NIRCNIDs+Bt28mXzx8VNuZ796j9q/DgAwomwqClilAmF0FE4wCInAlkjO4y+r0JgNX2os6XPYS2q/cQyAcQatFjA0BPH6NYipccAwIGUy2CVJFZInkKlyJAqx3T4/IMGmJkeWIWSz5KgI5pdhb3yDXS5DSCYh8rTID8s0wexeVD0GtMd85KkkefFxUfE47M1NokbJkByEQl6tL+ouAI+MUwbFhnYbaJKc/Sqg0x4H4eDRGDA56fUOABA9/GsCpaIHwr8FOhQ823O5RfW66tUGADhNy3RNRDjcN41HLxdQ8J6jYTsOQLfOJBK4f+s2/uoathoNGKT1MtFeVHZxdWTEZfEq/wMKl3rCJOIzTV6ADs2R5ulYDDNkYjp0DhrF+zCVgkw31+v1UxjQZkNV0SADd2o1MIuc9gmY+/kLxb0/UFoHePd9A1qzeUoKpilx9xcLWzgg+u/zeVfuQqkM9bCN1ysrWKXxdtPgvScwUAm58XZ52W16QyPtifRUzi588GbEi1ztHPsvwAC4uC9qhnsZvwAAAABJRU5ErkJggg==", + "txt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAeJJREFUeNp8UrtOG1EQPfsyXiyzBguIJSyChZBBEFCKpKHLo6egpErNn8CHgH8gkZIiTSIXLhJAWCgkoMgRMSiRBSK29z4y9+I1d/HCrFb3MTPnnjkzlpQSynY+fP70fGF2gQuByCz6lfdd9Uurfvrrjes6762eb3tzQ69uFJwPsqOPC+MBEmxxphi4tlU5OGmsOzaBWLc+O9oIIVhScidkyGZ8vH62nHtSKlaI4cse6TjAfSaFBBcco0EWqyvzubmpyQrj/FXk75cQaSEMeMXU8xykPA/Hjd/6/LRcyjEpt2i7HAe4A2TeLZWKUOJaVLxj27j813EHGKCXaAJExu/4BOdiAED08riQD2riOrexyRoYc3CvsAbLGAAjZga7vgZG23WMCdBvoxKJc36TRBlMiaa2JByjNqqD8qkYc1pjDK7abey+/YhrWlfKswhpiCR96aEU9o5+QE3g2ovVWDm2Sc22bBQm8vrVpbkS9r+doPr1EOWZaQ0yFoxg2PcREosEAI4uvZhJpzFMP+cSXRbq+043RManez+tNWKMI6GN0g0Z04HFR+NoNC/0yx717efZOSbzY3AcR4Op2AGA5p/W31r9e0vNgSrh9OwCrpeCkqvZuqTybnpRqx/r2CjvvwADAJC/7lzAzQmwAAAAAElFTkSuQmCC", + "wav": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAApFJREFUeNpsU1tPE0EYPXtpKbX0wqUQKVQMFdIXQBNCQBs06KP+B8ODGh+Mf4b/4IsGE54kxhcMBrkp7YOQgBRvSKG73fvsrt8Otoask0xmd+b7zpxzvm8E3/cRjPkniyulW0NFy2JoDkEAguOlpXJ9p3L8MBqVl4O9YHxae8pXuRlcGO7KPLhfTDVUqwUgigJMy4Whm6lEXHjxYf3XnByRN0QB/2KaH7btMlUxoRJAcyqKhdOaht7+DJ49n+2cvTnwynXcsb+kLwJ4rgfmMDDGWqvneXCZS9ND7mov5h9ND85M9y86Dpto5rUkuJ4Py3YDJpy6QGJPayqB+Njf+43XL220t0cwOZkfrNXsBUqZugDA6CbLdAiAwaek1ZU9LmP8Rh6S78GsGxjOp9FdzKJaVZIhBgGASzK21w/wbrnCk8euX+EMAjaaZuPHdwUdHVFYluuGPGCORwwYjg5rqOwccRk+3Ux0IEvntmsNG4ZmUayL/wAwKHUNfZfTKN0ZRaw9Cof8qJ/pMAyHy5KkAMTksSEJtnMenM7EMVMawbejMzJRh67bXEYiIXEAVTW50SEAhzqwfqrBcXx4VOhYm4RsNgHbsJFOyZTsQ1MN+hcohoUlkFiMT+TQFpMwXOjGpXgE+XwGk1N5pFJtKNCequgYGupCRBbCDOp0KBJc4VoP3dyBONW8uydBgBHUThqQKCk3mEZ/LoUG+RBioJO7VarAwEAntjYPiUUW9Hh4b2R7k9j98hN37xWx8fGAt3eIAdVMLn+uUv+b2KReSCZjZJiB9bV9jIz2ofr1BKvvd7G9dRC80lae0HzOt+cWVnrSKDrMJykifwNBpCgE/UAllEXufmDu8Zlffvvm8XSQ90eAAQA0pF7c08o4PAAAAABJRU5ErkJggg==", + "xls": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmxJREFUeNpsU0trFEEQ/mamZ3Y2+0zIC2MmITEkUYgERFQErx5E8KTi1b/h79A/4SW3nCNeYggBYZVEMU/y3N3Z7M7OTD/G6lk2ruw20zRdU/XV91VVG0mSQK/3n1a/jky6d6Xs3G8WXS+Pw5N6LXjLLGuna/78oZKerGsYKtrDE16uJGL1L9gEOOcYd2dL1fNwrbL//aXN7J1efPMmkUqEFAk0A0VZNbFEaQCBscIkXj975y3NLq9xye8PBkAniHOFph+j2eC4rsdoB4LsFubGl/Hq8RtvYWpxTQi52o1jvWiGYaRZL0/auDgOkC/Z8BYL2Pqxidp1FZkhoDxpeaXA/Ujuj/4HoOxKKjiOiek7RUShRNQWaNYFQuMafrYCxiw4ozZKfqbYJ0EvRdl1DQyyTs8XCNTA6UELMwvDyLpZWIZNNlNLlQOK2LMJRJ+5AkuZ1S7CFFzJzk56GnUjQWlYkqCoBWFbonEVYcLLA4dNnB624GQsDBWIgfZJEgxkoChzSFWvn4VpQemDm2VwXQsXJwF1h6c+gxlQ5jgSiEUEt0wdIe7tMES+nEG2aCLiJMOIIWIr9e0DEELAMUrwRuchVAyTKimUwO75Jm6VF3Bv7imOaj+xd7UFKVS/BPJF1b/E4tgTrE49J60O5kceoNqowiuuYKa8ghHXA48U9MT2AQgyRvTThE30bQiaSGa4yLMJNFo+Dq/2cHt4CYlwyFf2S6BHwwrMw/avDbR5C1k7h1YQ4KH3Amf+AcZyEbZPv9CItzQD1l9EbtYOjv74v/d3O9RMPTDrsEwGIWN8q2yk7XNYRs9JrRv3V4ABADSGR6eQ0/NQAAAAAElFTkSuQmCC", + "xlsx": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU8tqFEEUPVXdPY/ueWZIoiYZiSYKYhJc6EbduHOhgijo3t/wH1z6B0JAhOyMILhxo4kJGk1ASTAxwWF0Mpp5dHc9vFUzYwidaoqmq+8959xzbzGtNcx69PTS26ETmQtS9r4Hy/xv7MW7jV+th5yzVcaYPX/++It9u4NAv+CVR6tBUUTqMJsDcRzjZOZM8W9ZLKx+/XDb4e5/kH5In0lpIYWGUaC0YTZnBCAEKoVR3L36oDo7NbsglZwbqD6iQKOXFMcKUVfBkBAoQhlD5xxMDp/HrSv3q1JgYW3z0x0KXzkCYJaRZljru23aHWTzLiamAyytv0O9UYdf5PArqlppBfMUfu4oALErqZBKcUxMFRCHEp0DgW5Lo4N9NIN1dF0XXsVFOUyPJTzo+WBANDidjp8tgHGG3c0DnJ4uIRf4cOCBaW5KjY8xkZL72xpJ9QcFz5bVqHUJGHZL2YtNmKi06YCyiVFb4s/vEKMTAf1p4edOG6mMi1zR6wEpdUwX+vLDtkCzHoK7ptcM6ayLmGajvtex4PliyoIkFRjmUEASelB2rXQRSfjUCT9PlWpmW21iTGzCAyEkUixPRqXhe2V4zKczbdmybgkpJ0cGOuA6Y2MTCsKoi5HsNK7N3MN+uwYaWbxYfoLLkzdxcew6lrYWaZhm8PHHG3zffp1UwJSHz9vvkU8PodbcQYYYS5lxYkxTkGdVDQdV1Js1qPgYD6JIuIE7gsXVefIhIuM05k7dwMbeMmh87a18ufIMaVYyprrJLgje2Nr+1tzYXANnDnr3zRhHj37Vvy2wpXHtNAd5/wQYAD6WMuT2CwoVAAAAAElFTkSuQmCC", + "xml": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAilJREFUeNqMks1PE0EYxh+g3W2t1G0sEqyISynUFJsSOShNwCamiYZED3LgIkcuxoN/iCZePZiYGD2aGD+i0F5KMChxlVaakAK2ykcAt+WzdLu7zkxo3WZL4pu8mXfmeeY3885ug67roPFh5nvc62m9hjoR+5LMp7MrkYf370qVtco+VtCUFpbj+jGR+JbWn76OyQ8ePwsZATQb8R/hanZgINgj9IqeuBFCw1Kt9OMBnNWCs24XwkG/QKYUEiGjVAPQof/rq0783pShET3ULQo8xz0iS5FaANmrHQH2DoqY+DSLSz6RzecWlnD9ymU47LYjd4O5BXqDTG4FM3NpTEkpdJ5rw0AowLRMbhUfp58gTOaD/UHmNQPI6YmvKWRX1zESHUJ/oBs2nmPa+Mgw0ZIM3tZyGoJwygzQNB2jNyJIZX7iB0lpPoM70UGmPX8zCU+rG8NDVxHwdiC5mKsPUFUN/gvtLLf39sFzVqaN3YrC6TjBauqhXhNA1TQoqloV7Da+pjZq1FsXUCamF29j6LvYhf3iISamZ3Fv9DZevouhRzzPfOG+3hpA9U9UyioOlTJ7pFeTCQS6RGzIebyf+oz5pSzWtmSW1EO9phvQ00slBRt/8qR3DoWdXbiczUiTzd52D+tdLmyTB14mx1rMAKVcRpEATjrsuElee/HXGmnFRyBOGD30C/nEDjNgs7CDpsYmnHG3YPegBCvHs9oYfm8nG9dJa5X4K8AAQzQX4KSN3wcAAAAASUVORK5CYII=", + "yml": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdxJREFUeNqMUl1rE0EUPbM7m5Y0Zptu21AwWwhYpfSDFh+kvvRd8N0Hf4I/xWdf/Q158F0QoQ+CVsFKaLSQpt/dpmvztTOzzky6cetOpWcZZvbO3MO5514SxzEU3r57/3GpWllM/tP4sL3TarROXuSo/SWJvX71Uu80Cfhlr/T4UdWFAVfdnmsTUtvdP35OUyQKVnJgXDBTcj9icAsTeLax7j/052qM81UjwW1QJXEhMF0qYnN90fdnvdogYmvJPU0/VBApD4hcDrWRcyikfB17srzgW7b9Rh1vEvxDlI4tVytaBSEEtmWh0xsUMwpwnWjqAlcxogiHd1wiQyCu87iI/+sJtf6+NXsgpd7FWCMB50KvkYMGMbLdZgLlfj+K9K4+FnFQ2x7WntIs50AbmiGwLILt+k+EvzvSNIHzdigdJ/AmXQRhiHv5POSwYmG+cqPVo0HqDxj8uTK2vn1Hfa+JmdIkvtZ/4fOPXU3WPDpFeNWVyUKryCiIGMN4zsH98gym3CIcOTwT+XHdXrdQQHAZotE8kBPpSqPNHtBOr48HUmLOcXRJT9dWNMGYJFby91pHOAvaykSaITg+bwefdhrteDRTMSwyrFCgI88E056Hy+4Ah2cXQZL3R4ABALUe7fqXWFN6AAAAAElFTkSuQmCC", + "zip": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAm9JREFUeNpsk0tv00AUhc+MY6dOmgeFJg1FoVVpUWlFC0s2IFF1jxBbhKj4BSxYdscPYcEmQmIDq0gsERIViy4TpD7VFzF1Ho5je2a4thOqNhlp5Mz4zudzzp0wpRTC8fPrk0/TC6+fDtYicLH97T1Kc2vQDcs+rH3eUAxVznn0fn1DRM8E+iOdv5ct3XmZG6yVlNj6solUbgVTt0q5FGtX6vXqC6VklTE+KAO/OODHSIQPRQpsXC+kkEz2ELA0ystv84tLzyucsbWByisAGf+QAS2CCDRRLMJMmxC+i8C4jdLCm/zM7OOKFGptcO6/BTpJ0yeQB0Y+mfKQuZZG0jQgeRbW8Xdomobs9LN8scc+UPHNy4Dwq8IljotIIQEm59/RoSyM1CKkXKZNBm7kIVgyM6wgAnSgRK9vqQfHPiMFDHqyFVsLR9Cm0o4YzoAASrSjCelQfRPb1Vc4qn0EY5L2W9GEaBLcxQgFHpGbkMIDJ69e+wjJ8VXqRgKid0r7ftQdxkRs9SqA2kgAm14SSIQh9uhuLGPMnKJs/5KquL1x0N0RCsizigoDaLqBdHoMiyvrlBsHVx1wphD4BCewoqxGKKDwAgtOy8JufYuk+5golGGaGZwc1sIGoDz3AOPZSVLaHgVwydoJDM1H4DbQODughB3YpOD44HfoHgnu4e7So0uAi0stHLJ3Aud8B9bpHu6vPoSu9TtDl6tUuoFiIYOgu0+158MKmOxomtyD3Qi/3MTR7i8K0EDG1GHO5DE3X4DvNahZlJOwEkOATvdPc2//hx3mXJ5lFJaF8K8bStd0YGfnOJbMGex21x6c+yfAAOlIPDJzr7cLAAAAAElFTkSuQmCC" +} diff --git a/tools/ui/node_modules/http-server/lib/core/show-dir/index.js b/tools/ui/node_modules/http-server/lib/core/show-dir/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9a6891cf2a50f7b669b2094c799b0bb9001df3c7 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/show-dir/index.js @@ -0,0 +1,173 @@ +'use strict'; + +const styles = require('./styles'); +const lastModifiedToString = require('./last-modified-to-string'); +const permsToString = require('./perms-to-string'); +const sizeToString = require('./size-to-string'); +const sortFiles = require('./sort-files'); +const fs = require('fs'); +const path = require('path'); +const he = require('he'); +const etag = require('../etag'); +const url = require('url'); +const status = require('../status-handlers'); + +const supportedIcons = styles.icons; +const css = styles.css; + +module.exports = (opts) => { + // opts are parsed by opts.js, defaults already applied + const cache = opts.cache; + const root = path.resolve(opts.root); + const baseDir = opts.baseDir; + const humanReadable = opts.humanReadable; + const hidePermissions = opts.hidePermissions; + const handleError = opts.handleError; + const showDotfiles = opts.showDotfiles; + const si = opts.si; + const weakEtags = opts.weakEtags; + + return function middleware(req, res, next) { + // Figure out the path for the file from the given url + const parsed = url.parse(req.url); + const pathname = decodeURIComponent(parsed.pathname); + const dir = path.normalize( + path.join( + root, + path.relative( + path.join('/', baseDir), + pathname + ) + ) + ); + + fs.stat(dir, (statErr, stat) => { + if (statErr) { + if (handleError) { + status[500](res, next, { error: statErr }); + } else { + next(); + } + return; + } + + // files are the listing of dir + fs.readdir(dir, (readErr, _files) => { + let files = _files; + + if (readErr) { + if (handleError) { + status[500](res, next, { error: readErr }); + } else { + next(); + } + return; + } + + // Optionally exclude dotfiles from directory listing. + if (!showDotfiles) { + files = files.filter(filename => filename.slice(0, 1) !== '.'); + } + + res.setHeader('content-type', 'text/html'); + res.setHeader('etag', etag(stat, weakEtags)); + res.setHeader('last-modified', (new Date(stat.mtime)).toUTCString()); + res.setHeader('cache-control', cache); + + function render(dirs, renderFiles, lolwuts) { + // each entry in the array is a [name, stat] tuple + + let html = `${[ + '', + '', + ' ', + ' ', + ' ', + ` Index of ${he.encode(pathname)}`, + ` `, + ' ', + ' ', + `

Index of ${he.encode(pathname)}

`, + ].join('\n')}\n`; + + html += ''; + + const failed = false; + const writeRow = (file) => { + // render a row given a [name, stat] tuple + const isDir = file[1].isDirectory && file[1].isDirectory(); + let href = `./${encodeURIComponent(file[0])}`; + + // append trailing slash and query for dir entry + if (isDir) { + href += `/${he.encode((parsed.search) ? parsed.search : '')}`; + } + + const displayName = he.encode(file[0]) + ((isDir) ? '/' : ''); + const ext = file[0].split('.').pop(); + const classForNonDir = supportedIcons[ext] ? ext : '_page'; + const iconClass = `icon-${isDir ? '_blank' : classForNonDir}`; + + // TODO: use stylessheets? + html += `${'' + + '`; + if (!hidePermissions) { + html += ``; + } + html += + `` + + `` + + `` + + '\n'; + }; + + dirs.sort((a, b) => a[0].toString().localeCompare(b[0].toString())).forEach(writeRow); + renderFiles.sort((a, b) => a.toString().localeCompare(b.toString())).forEach(writeRow); + lolwuts.sort((a, b) => a[0].toString().localeCompare(b[0].toString())).forEach(writeRow); + + html += '
(${permsToString(file[1])})${lastModifiedToString(file[1])}${sizeToString(file[1], humanReadable, si)}${displayName}
\n'; + html += `
Node.js ${ + process.version + }/ http-server ` + + `server running @ ${ + he.encode(req.headers.host || '')}
\n` + + '' + ; + + if (!failed) { + res.writeHead(200, { 'Content-Type': 'text/html' }); + res.end(html); + } + } + + sortFiles(dir, files, (lolwuts, dirs, sortedFiles) => { + // It's possible to get stat errors for all sorts of reasons here. + // Unfortunately, our two choices are to either bail completely, + // or just truck along as though everything's cool. In this case, + // I decided to just tack them on as "??!?" items along with dirs + // and files. + // + // Whatever. + + // if it makes sense to, add a .. link + if (path.resolve(dir, '..').slice(0, root.length) === root) { + fs.stat(path.join(dir, '..'), (err, s) => { + if (err) { + if (handleError) { + status[500](res, next, { error: err }); + } else { + next(); + } + return; + } + dirs.unshift(['..', s]); + render(dirs, sortedFiles, lolwuts); + }); + } else { + render(dirs, sortedFiles, lolwuts); + } + }); + }); + }); + }; +}; diff --git a/tools/ui/node_modules/http-server/lib/core/show-dir/last-modified-to-string.js b/tools/ui/node_modules/http-server/lib/core/show-dir/last-modified-to-string.js new file mode 100644 index 0000000000000000000000000000000000000000..917d38010c63dfe202f2a3eba83d657bdcf7425d --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/show-dir/last-modified-to-string.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function lastModifiedToString(stat) { + const t = new Date(stat.mtime); + return (('0' + (t.getDate())).slice(-2) + '-' + + t.toLocaleString('default', { month: 'short' }) + '-' + + t.getFullYear() + ' ' + + ('0' + t.getHours()).slice(-2) + ':' + + ('0' + t.getMinutes()).slice(-2)); +}; diff --git a/tools/ui/node_modules/http-server/lib/core/show-dir/perms-to-string.js b/tools/ui/node_modules/http-server/lib/core/show-dir/perms-to-string.js new file mode 100644 index 0000000000000000000000000000000000000000..9e65821d77093f5a395e954415341ace7782b821 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/show-dir/perms-to-string.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = function permsToString(stat) { + if (!stat.isDirectory || !stat.mode) { + return '???!!!???'; + } + + const dir = stat.isDirectory() ? 'd' : '-'; + const mode = stat.mode.toString(8); + + return dir + mode.slice(-3).split('').map(n => [ + '---', + '--x', + '-w-', + '-wx', + 'r--', + 'r-x', + 'rw-', + 'rwx', + ][parseInt(n, 10)]).join(''); +}; diff --git a/tools/ui/node_modules/http-server/lib/core/show-dir/size-to-string.js b/tools/ui/node_modules/http-server/lib/core/show-dir/size-to-string.js new file mode 100644 index 0000000000000000000000000000000000000000..a5fbec995a0e07fb0e68a6a2d64e234cbe0110d1 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/show-dir/size-to-string.js @@ -0,0 +1,30 @@ +'use strict'; + +// given a file's stat, return the size of it in string +// humanReadable: (boolean) whether to result is human readable +// si: (boolean) whether to use si (1k = 1000), otherwise 1k = 1024 +// adopted from http://stackoverflow.com/a/14919494/665507 +module.exports = function sizeToString(stat, humanReadable, si) { + if (stat.isDirectory && stat.isDirectory()) { + return ''; + } + + let bytes = stat.size; + const threshold = si ? 1000 : 1024; + + if (!humanReadable || bytes < threshold) { + return `${bytes}B`; + } + + const units = ['k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; + let u = -1; + do { + bytes /= threshold; + u += 1; + } while (bytes >= threshold); + + let b = bytes.toFixed(1); + if (isNaN(b)) b = '??'; + + return b + units[u]; +}; diff --git a/tools/ui/node_modules/http-server/lib/core/show-dir/sort-files.js b/tools/ui/node_modules/http-server/lib/core/show-dir/sort-files.js new file mode 100644 index 0000000000000000000000000000000000000000..67be77618db8466ddfaef747ffafffb96029f0ab --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/show-dir/sort-files.js @@ -0,0 +1,36 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +module.exports = function sortByIsDirectory(dir, paths, cb) { + // take the listing file names in `dir` + // returns directory and file array, each entry is + // of the array a [name, stat] tuple + let pending = paths.length; + const errs = []; + const dirs = []; + const files = []; + + if (!pending) { + cb(errs, dirs, files); + return; + } + + paths.forEach((file) => { + fs.stat(path.join(dir, file), (err, s) => { + if (err) { + errs.push([file, err]); + } else if (s.isDirectory()) { + dirs.push([file, s]); + } else { + files.push([file, s]); + } + + pending -= 1; + if (pending === 0) { + cb(errs, dirs, files); + } + }); + }); +}; diff --git a/tools/ui/node_modules/http-server/lib/core/show-dir/styles.js b/tools/ui/node_modules/http-server/lib/core/show-dir/styles.js new file mode 100644 index 0000000000000000000000000000000000000000..85f6259a59e0d13f11a747e2e336227d86f8c8b2 --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/show-dir/styles.js @@ -0,0 +1,20 @@ +'use strict'; + +const icons = require('./icons.json'); + +const IMG_SIZE = 16; + +let css = `i.icon { display: block; height: ${IMG_SIZE}px; width: ${IMG_SIZE}px; }\n`; +css += 'table tr { white-space: nowrap; }\n'; +css += 'td.perms {}\n'; +css += 'td.file-size { text-align: right; padding-left: 1em; }\n'; +css += 'td.display-name { padding-left: 1em; }\n'; + +Object.keys(icons).forEach((key) => { + css += `i.icon-${key} {\n`; + css += ` background-image: url("data:image/png;base64,${icons[key]}");\n`; + css += '}\n\n'; +}); + +exports.icons = icons; +exports.css = css; diff --git a/tools/ui/node_modules/http-server/lib/core/status-handlers.js b/tools/ui/node_modules/http-server/lib/core/status-handlers.js new file mode 100644 index 0000000000000000000000000000000000000000..265b399e5b3d01da0717ddb8376b796ba176cfdd --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/core/status-handlers.js @@ -0,0 +1,96 @@ +'use strict'; + +const he = require('he'); + +// not modified +exports['304'] = (res) => { + res.statusCode = 304; + res.end(); +}; + +// access denied +exports['403'] = (res, next) => { + res.statusCode = 403; + if (typeof next === 'function') { + next(); + } else if (res.writable) { + res.setHeader('content-type', 'text/plain'); + res.end('ACCESS DENIED'); + } +}; + +// disallowed method +exports['405'] = (res, next, opts) => { + res.statusCode = 405; + if (typeof next === 'function') { + next(); + } else { + res.setHeader('allow', (opts && opts.allow) || 'GET, HEAD'); + res.end(); + } +}; + +// not found +exports['404'] = (res, next) => { + res.statusCode = 404; + if (typeof next === 'function') { + next(); + } else if (res.writable) { + res.setHeader('content-type', 'text/plain'); + res.end('File not found. :('); + } +}; + +exports['416'] = (res, next) => { + res.statusCode = 416; + if (typeof next === 'function') { + next(); + } else if (res.writable) { + res.setHeader('content-type', 'text/plain'); + res.end('Requested range not satisfiable'); + } +}; + +// flagrant error +exports['500'] = (res, next, opts) => { + res.statusCode = 500; + res.setHeader('content-type', 'text/html'); + const error = String(opts.error.stack || opts.error || 'No specified error'); + const html = `${[ + '', + '', + ' ', + ' ', + ' 500 Internal Server Error', + ' ', + ' ', + '

', + ` ${he.encode(error)}`, + '

', + ' ', + '', + ].join('\n')}\n`; + res.end(html); +}; + +// bad request +exports['400'] = (res, next, opts) => { + res.statusCode = 400; + res.setHeader('content-type', 'text/html'); + const error = opts && opts.error ? String(opts.error) : 'Malformed request.'; + const html = `${[ + '', + '', + ' ', + ' ', + ' 400 Bad Request', + ' ', + ' ', + '

', + ` ${he.encode(error)}`, + '

', + ' ', + '', + ].join('\n')}\n`; + res.end(html); +}; diff --git a/tools/ui/node_modules/http-server/lib/http-server.js b/tools/ui/node_modules/http-server/lib/http-server.js new file mode 100644 index 0000000000000000000000000000000000000000..dfe4c474cc1cc1354973d0531cac953af042233e --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/http-server.js @@ -0,0 +1,192 @@ +'use strict'; + +var fs = require('fs'), + union = require('union'), + httpServerCore = require('./core'), + auth = require('basic-auth'), + httpProxy = require('http-proxy'), + corser = require('corser'), + secureCompare = require('secure-compare'); + +// +// Remark: backwards compatibility for previous +// case convention of HTTP +// +exports.HttpServer = exports.HTTPServer = HttpServer; + +/** + * Returns a new instance of HttpServer with the + * specified `options`. + */ +exports.createServer = function (options) { + return new HttpServer(options); +}; + +/** + * Constructor function for the HttpServer object + * which is responsible for serving static files along + * with other HTTP-related features. + */ +function HttpServer(options) { + options = options || {}; + + if (options.root) { + this.root = options.root; + } else { + try { + // eslint-disable-next-line no-sync + fs.lstatSync('./public'); + this.root = './public'; + } catch (err) { + this.root = './'; + } + } + + this.headers = options.headers || {}; + this.headers['Accept-Ranges'] = 'bytes'; + + this.cache = ( + // eslint-disable-next-line no-nested-ternary + options.cache === undefined ? 3600 : + // -1 is a special case to turn off caching. + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#Preventing_caching + options.cache === -1 ? 'no-cache, no-store, must-revalidate' : + options.cache // in seconds. + ); + this.showDir = options.showDir !== 'false'; + this.autoIndex = options.autoIndex !== 'false'; + this.showDotfiles = options.showDotfiles; + this.gzip = options.gzip === true; + this.brotli = options.brotli === true; + if (options.ext) { + this.ext = options.ext === true + ? 'html' + : options.ext; + } + this.contentType = options.contentType || + this.ext === 'html' ? 'text/html' : 'application/octet-stream'; + + var before = options.before ? options.before.slice() : []; + + if (options.logFn) { + before.push(function (req, res) { + options.logFn(req, res); + res.emit('next'); + }); + } + + if (options.username || options.password) { + before.push(function (req, res) { + var credentials = auth(req); + + // We perform these outside the if to avoid short-circuiting and giving + // an attacker knowledge of whether the username is correct via a timing + // attack. + if (credentials) { + // if credentials is defined, name and pass are guaranteed to be string + // type + var usernameEqual = secureCompare(options.username.toString(), credentials.name); + var passwordEqual = secureCompare(options.password.toString(), credentials.pass); + if (usernameEqual && passwordEqual) { + return res.emit('next'); + } + } + + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm=""'); + res.end('Access denied'); + }); + } + + if (options.cors) { + this.headers['Access-Control-Allow-Origin'] = '*'; + this.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Range'; + if (options.corsHeaders) { + options.corsHeaders.split(/\s*,\s*/) + .forEach(function (h) { this.headers['Access-Control-Allow-Headers'] += ', ' + h; }, this); + } + before.push(corser.create(options.corsHeaders ? { + requestHeaders: this.headers['Access-Control-Allow-Headers'].split(/\s*,\s*/) + } : null)); + } + + if (options.robots) { + before.push(function (req, res) { + if (req.url === '/robots.txt') { + res.setHeader('Content-Type', 'text/plain'); + var robots = options.robots === true + ? 'User-agent: *\nDisallow: /' + : options.robots.replace(/\\n/, '\n'); + + return res.end(robots); + } + + res.emit('next'); + }); + } + + before.push(httpServerCore({ + root: this.root, + cache: this.cache, + showDir: this.showDir, + showDotfiles: this.showDotfiles, + autoIndex: this.autoIndex, + defaultExt: this.ext, + gzip: this.gzip, + brotli: this.brotli, + contentType: this.contentType, + mimetypes: options.mimetypes, + handleError: typeof options.proxy !== 'string' + })); + + if (typeof options.proxy === 'string') { + var proxyOptions = options.proxyOptions || {}; + var proxy = httpProxy.createProxyServer(proxyOptions); + before.push(function (req, res) { + proxy.web(req, res, { + target: options.proxy, + changeOrigin: true + }, function (err, req, res) { + if (options.logFn) { + options.logFn(req, res, { + message: err.message, + status: res.statusCode }); + } + res.emit('next'); + }); + }); + } + + var serverOptions = { + before: before, + headers: this.headers, + onError: function (err, req, res) { + if (options.logFn) { + options.logFn(req, res, err); + } + + res.end(); + } + }; + + if (options.https) { + serverOptions.https = options.https; + } + + this.server = serverOptions.https && serverOptions.https.passphrase + // if passphrase is set, shim must be used as union does not support + ? require('./shims/https-server-shim')(serverOptions) + : union.createServer(serverOptions); + + if (options.timeout !== undefined) { + this.server.setTimeout(options.timeout); + } +} + +HttpServer.prototype.listen = function () { + this.server.listen.apply(this.server, arguments); +}; + +HttpServer.prototype.close = function () { + return this.server.close(); +}; diff --git a/tools/ui/node_modules/http-server/lib/shims/https-server-shim.js b/tools/ui/node_modules/http-server/lib/shims/https-server-shim.js new file mode 100644 index 0000000000000000000000000000000000000000..30d4fc58e6e4c938083e4332e95777e6c0c5df1b --- /dev/null +++ b/tools/ui/node_modules/http-server/lib/shims/https-server-shim.js @@ -0,0 +1,67 @@ +/* eslint-disable no-process-env */ +/* eslint-disable no-sync */ +var https = require('https'); +var fs = require('fs'); +var core = require('union/lib/core'); +var RoutingStream = require('union/lib/routing-stream'); + +module.exports = function (options) { + var isArray = Array.isArray(options.after); + var credentials; + + if (!options) { + throw new Error('options is required to create a server'); + } + + function requestHandler(req, res) { + var routingStream = new RoutingStream({ + before: options.before, + buffer: options.buffer, + after: + isArray && + options.after.map(function (After) { + return new After(); + }), + request: req, + response: res, + limit: options.limit, + headers: options.headers + }); + + routingStream.on('error', function (err) { + var fn = options.onError || core.errorHandler; + fn(err, routingStream, routingStream.target, function () { + routingStream.target.emit('next'); + }); + }); + + req.pipe(routingStream); + } + + var serverOptions; + + serverOptions = options.https; + if (!serverOptions.key || !serverOptions.cert) { + throw new Error( + 'Both options key and cert are required.' + ); + } + + credentials = { + key: fs.readFileSync(serverOptions.key), + cert: fs.readFileSync(serverOptions.cert), + passphrase: process.env.NODE_HTTP_SERVER_SSL_PASSPHRASE + }; + + if (serverOptions.ca) { + serverOptions.ca = !Array.isArray(serverOptions.ca) + ? [serverOptions.ca] + : serverOptions.ca; + + credentials.ca = serverOptions.ca.map(function (ca) { + return fs.readFileSync(ca); + }); + } + + return https.createServer(credentials, requestHandler); +}; diff --git a/tools/ui/node_modules/http-server/package.json b/tools/ui/node_modules/http-server/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7316ac953e1faaacb1e07f888c720230d5474d4c --- /dev/null +++ b/tools/ui/node_modules/http-server/package.json @@ -0,0 +1,118 @@ +{ + "name": "http-server", + "version": "14.1.1", + "description": "A simple zero-configuration command-line http server", + "main": "./lib/http-server", + "repository": { + "type": "git", + "url": "git://github.com/http-party/http-server.git" + }, + "keywords": [ + "cli", + "command", + "static", + "http", + "https", + "http-server", + "https-server", + "server" + ], + "scripts": { + "start": "node ./bin/http-server", + "test": "tap --reporter=spec test/*.test.js", + "test-watch": "tap --reporter=spec --watch test/*.test.js" + }, + "files": [ + "lib", + "bin", + "doc" + ], + "man": "./doc/http-server.1", + "engines": { + "node": ">=12" + }, + "contributors": [ + { + "name": "Charlie Robbins", + "email": "charlie.robbins@gmail.com" + }, + { + "name": "Marak Squires", + "email": "marak.squires@gmail.com" + }, + { + "name": "Charlie McConnell", + "email": "charlie@charlieistheman.com" + }, + { + "name": "Joshua Holbrook", + "email": "josh.holbrook@gmail.com" + }, + { + "name": "Maciej Małecki", + "email": "maciej.malecki@notimplemented.org" + }, + { + "name": "Matthew Bergman", + "email": "mzbphoto@gmail.com" + }, + { + "name": "brad dunbar", + "email": "dunbarb2@gmail.com" + }, + { + "name": "Dominic Tarr" + }, + { + "name": "Travis Person", + "email": "travis.person@gmail.com" + }, + { + "name": "Jinkwon Lee", + "email": "master@bdyne.net" + }, + { + "name": "BigBlueHat", + "email": "byoung@bigbluehat.com" + }, + { + "name": "Daniel Dalton", + "email": "daltond2@hawkmail.newpaltz.edu" + }, + { + "name": "Jade Michael Thornton", + "email": "jademichael@jmthornton.net" + } + ], + "dependencies": { + "basic-auth": "^2.0.1", + "chalk": "^4.1.2", + "corser": "^2.0.1", + "he": "^1.2.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy": "^1.18.1", + "mime": "^1.6.0", + "minimist": "^1.2.6", + "opener": "^1.5.1", + "portfinder": "^1.0.28", + "secure-compare": "3.0.1", + "union": "~0.5.0", + "url-join": "^4.0.1" + }, + "devDependencies": { + "eol": "^0.9.1", + "eslint": "^4.19.1", + "eslint-config-populist": "^4.2.0", + "express": "^4.17.1", + "request": "^2.88.2", + "tap": "^14.11.0" + }, + "bugs": { + "url": "https://github.com/http-party/http-server/issues" + }, + "license": "MIT", + "preferGlobal": true, + "bin": { + "http-server": "./bin/http-server" + } +} diff --git a/tools/ui/node_modules/ico-endec/LICENSE.md b/tools/ui/node_modules/ico-endec/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..197b2ffdb0019fecd9412efac3cd465d546234a6 --- /dev/null +++ b/tools/ui/node_modules/ico-endec/LICENSE.md @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/tools/ui/node_modules/ico-endec/README.md b/tools/ui/node_modules/ico-endec/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a851193b54f90aa1f43525e58ae3961d39a474d1 --- /dev/null +++ b/tools/ui/node_modules/ico-endec/README.md @@ -0,0 +1,56 @@ +# ICO encoder & decoder +This JavaScript library provides an encoder and decoder for ICO and CUR files. Although this library can encode and decode both BMP and PNG images, BMP endec does not provide bitmasking support, and as such, will not work with some icons. However, PNG support is widespread and has become a more defacto standard for application icons, so this problem is largely moot -- but it still would be nice to have. + +## Encoding +### icoEndec.encode([Buffer||ArrayBuffer]) +The encode function takes an array of ArrayBuffers or Buffers that contain BMP or PNG data. It returns a Buffer containing the binary data of the ICO file. + +#### Example +``` +const icoEndec = require('ico-endec') +const fsPromises = require('fs').Promises + +(async () => { + let icoBuffer = icoEndec.encode([ + await fsPromises.readFile('myIcon-16x16.png'), + await fsPromises.readFile('myIcon-32x32.png'), + await fsPromises.readFile('myIcon-64x64.png') + ]) + + await fsPromises.writeFile('myIcon.ico', icoBuffer) +})() +``` + +## Decoding +### icoEndec.decode(Buffer) +The decode function takes a Buffer or an ArrayBuffer that holds the binary data of an ICO file. It returns an array of [IconEntries](#iconentry). +#### Example +``` +const icoEndec = require('ico-endec') +const fsPromises = require('fs').Promises + +(async () => { + let icons = icoEndec.decode(await fsPromises.readFile('myIcon.ico')) + + icons.forEach((icon, index) => { + fsPromises.writeFile(`myIcon-${icon.width}x${icon.height}.${icon.imageType}`, icon.imageData) + }) +})() +``` + +## IconEntry +The IconEntry class stores various information about the given icon entry. + +| Accessor | Type | Description | +|-|-|-| +| width | Number | width of the image, maximum of 256 +| height | Number | height of the image, maximum of 256 +| colors | Number | number of colors +| colorPlanes | Number | color planes of an ICO image +| bitsPerPixel | Number | bits per pixel of an ICO image +| horizontalHotspot | Number | horizontal hotspot of a CUR image +| verticalHotspot | Number | vertical hotspot of a CUR image +| imageSize | Number | (interal) size of imageData's buffer +| imageOffset | Number | (interal) offset start of the image data +| imageType | String | 'png' or 'bmp' +| imageData | [Buffer](https://nodejs.org/api/buffer.html) | image data of the icon \ No newline at end of file diff --git a/tools/ui/node_modules/ico-endec/dist/bundle.js b/tools/ui/node_modules/ico-endec/dist/bundle.js new file mode 100644 index 0000000000000000000000000000000000000000..b240d1335e7a9feaaccdc4e9b86dea88ee06f20b --- /dev/null +++ b/tools/ui/node_modules/ico-endec/dist/bundle.js @@ -0,0 +1,7 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).icoEndec={})}(this,(function(t){"use strict";class e{constructor(t){this._imageBuffers=t.map(t=>{if(t instanceof ArrayBuffer)return Buffer.from(new Uint8Array(t));if(t instanceof Buffer)return t;throw"Encoder requires ArrayBuffers or Buffers"})}get buffer(){return this._buffer}encode(){this._buffer=Buffer.alloc(0),this._bufferOffset=0,this._imageOffset=0,this._writeICONDIR();for(let t=0;t256)throw"PNG width must not exceed 256";if(256===f&&(f=0),r>256)throw"PNG height must not exceed 256";256===r&&(r=0),i.writeUInt8(f,0),i.writeUInt8(r,1),i.writeUInt8(h,2),i.writeUInt8(0,3),i.writeUInt16LE(1,4),i.writeUInt16LE(s,6),i.writeUInt32LE(e.length,8),this._imageOffset+=16,this._buffer=Buffer.concat([this._buffer,i])}_writeICONDIRENTRY_bmp(t){const e=this._imageBuffers[t],i=Buffer.alloc(16);let f=e.readInt32LE(18),r=e.readInt32LE(22),s=e.readUInt16LE(26),h=e.readUInt32LE(46),n=e.readUInt16LE(28);if(f>256)throw"BMP width must not exceed 256";if(256===f&&(f=0),r>256)throw"BMP height must not exceed 256";if(256===r&&(r=0),1!==s)throw"BMP color planes must be 1";0===h&&32!==n&&(h=Math.pow(2,n)),h>256?h=0:256===h&&(h=255),i.writeUInt8(f,0),i.writeUInt8(r,1),i.writeUInt8(h,2),i.writeUInt8(0,3),i.writeUInt16LE(s,4),i.writeUInt16LE(n,6),i.writeUInt32LE(e.length-14,8),this._imageOffset+=16,this._buffer=Buffer.concat([this._buffer,i])}_writeICONDATA(t){let e=6+16*t+12;this._buffer.writeUInt32LE(this._imageOffset,e);const i=this._imageBuffers[t];137===i[0]&&80===i[1]&&78===i[2]&&71===i[3]?(this._buffer=Buffer.concat([this._buffer,i]),this._imageOffset+=i.length):(this._buffer=Buffer.concat([this._buffer,i.slice(14)]),this._imageOffset+=i.length-14)}}class i{constructor(){this._width=-1,this._height=-1,this._colors=-1,this._colorPlanes=-1,this._bitsPerPixel=-1,this._horizontalHotspot=-1,this._verticalHotspot=-1,this._imageSize=-1,this._imageOffset=-1,this._imageType=-1,this._imageData=null}get width(){return this._width}get height(){return this._height}get colors(){return this._colors}get colorPlanes(){return this._colorPlanes}get bitsPerPixel(){return this._bitsPerPixel}get horizontalHotspot(){return this._horizontalHotspot}get verticalHotspot(){return this._verticalHotspot}get imageSize(){return this._imageSize}get imageOffset(){return this._imageOffset}get imageType(){return this._imageType}get imageData(){return this._imageData}}class f{constructor(t){this._bufferOffset=0,this._buffer=Buffer.from(t),this._iconEntries=[]}decode(){this._readICONDIR();for(let t=0;tnew f(t).decode(),t.encode=t=>(Array.isArray(t)||(t=[t]),new e(t).encode()),Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/tools/ui/node_modules/ico-endec/package.json b/tools/ui/node_modules/ico-endec/package.json new file mode 100644 index 0000000000000000000000000000000000000000..90b696ad00c58609eb634034996f350484979792 --- /dev/null +++ b/tools/ui/node_modules/ico-endec/package.json @@ -0,0 +1,23 @@ +{ + "name": "ico-endec", + "version": "0.1.6", + "description": "ICO encoder and decoder library", + "main": "dist/bundle.js", + "repository": { + "type": "git", + "url": "https://github.com/kettek/ico-endec-js" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "rollup -c" + }, + "keywords": [], + "author": "Ketchetwahmeegwun T. Southall", + "license": "MPL-2.0", + "devDependencies": { + "minimist": "^1.2.5", + "rollup": "^2.3.2", + "rollup-plugin-license": "^2.0.0", + "rollup-plugin-terser": "^5.3.0" + } +} diff --git a/tools/ui/node_modules/iconv-lite/LICENSE b/tools/ui/node_modules/iconv-lite/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d518d8376af9faa47af875d83c8cdd51a11f9099 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/tools/ui/node_modules/iconv-lite/README.md b/tools/ui/node_modules/iconv-lite/README.md new file mode 100644 index 0000000000000000000000000000000000000000..78a7a5f1cf2a03ebad4c4bacdfe9d2368470ca81 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/README.md @@ -0,0 +1,138 @@ +## iconv-lite: Pure JS character encoding conversion + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-downloads-url] +[![License][license-image]][license-url] +[![NPM Install Size][npm-install-size-image]][npm-install-size-url] + +* No need for native code compilation. Quick to install, works on Windows, Web, and in sandboxed environments. +* Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. +* Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). +* Intuitive encode/decode API, including Streaming support. +* In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). +* Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. +* React Native is supported (need to install `stream` module to enable Streaming API). + +## Usage + +### Basic API + +```javascript +var iconv = require('iconv-lite'); + +// Convert from an encoded buffer to a js string. +str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); + +// Convert from a js string to an encoded buffer. +buf = iconv.encode("Sample input string", 'win1251'); + +// Check if encoding is supported +iconv.encodingExists("us-ascii") +``` + +### Streaming API + +```javascript +// Decode stream (from binary data stream to js strings) +http.createServer(function(req, res) { + var converterStream = iconv.decodeStream('win1251'); + req.pipe(converterStream); + + converterStream.on('data', function(str) { + console.log(str); // Do something with decoded strings, chunk-by-chunk. + }); +}); + +// Convert encoding streaming example +fs.createReadStream('file-in-win1251.txt') + .pipe(iconv.decodeStream('win1251')) + .pipe(iconv.encodeStream('ucs2')) + .pipe(fs.createWriteStream('file-in-ucs2.txt')); + +// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. +http.createServer(function(req, res) { + req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { + assert(typeof body == 'string'); + console.log(body); // full request body string + }); +}); +``` + +## Supported encodings + + * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. + * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. + Aliases like 'latin1', 'us-ascii' also supported. + * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. + +See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). + +Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! + +Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! + +## Encoding/decoding speed + +Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). +Note: your results may vary, so please always check on your hardware. + + operation iconv@2.1.4 iconv-lite@0.4.7 + ---------------------------------------------------------- + encode('win1251') ~96 Mb/s ~320 Mb/s + decode('win1251') ~95 Mb/s ~246 Mb/s + +## BOM handling + + * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options + (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). + A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. + * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. + * Encoding: No BOM added, unless overridden by `addBOM: true` option. + +## UTF-16 Encodings + +This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be +smart about endianness in the following ways: + * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be + overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. + +## UTF-32 Encodings + +This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. + * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) + +## Other notes + +When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see [#65](https://github.com/ashtuchkin/iconv-lite/issues/65), [#77](https://github.com/ashtuchkin/iconv-lite/issues/77)). + +## Testing + +```sh +git clone git@github.com:ashtuchkin/iconv-lite.git +cd iconv-lite +npm install +npm test + +# To view performance: +npm run test:performance + +# To view test coverage: +npm run test:cov +open coverage/index.html +``` + +[npm-downloads-image]: https://badgen.net/npm/dm/iconv-lite +[npm-downloads-url]: https://npmcharts.com/compare/iconv-lite?minimal=true +[npm-url]: https://npmjs.org/package/iconv-lite +[npm-version-image]: https://badgen.net/npm/v/iconv-lite +[npm-install-size-image]: https://badgen.net/packagephobia/install/iconv-lite +[npm-install-size-url]: https://packagephobia.com/result?p=iconv-lite +[license-image]: https://img.shields.io/npm/l/iconv-lite.svg +[license-url]: https://github.com/ashtuchkin/iconv-lite/blob/HEAD/LICENSE \ No newline at end of file diff --git a/tools/ui/node_modules/iconv-lite/encodings/dbcs-codec.js b/tools/ui/node_modules/iconv-lite/encodings/dbcs-codec.js new file mode 100644 index 0000000000000000000000000000000000000000..bfec7f2ef9071ed98b30ebf8dfd4ac4b103e5271 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -0,0 +1,532 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. + +exports._dbcs = DBCSCodec + +var UNASSIGNED = -1 +var GB18030_CODE = -2 +var SEQ_START = -10 +var NODE_START = -1000 +var UNASSIGNED_NODE = new Array(0x100) +var DEF_CHAR = -1 + +for (var i = 0; i < 0x100; i++) { UNASSIGNED_NODE[i] = UNASSIGNED } + +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec (codecOptions, iconv) { + this.encodingName = codecOptions.encodingName + if (!codecOptions) { throw new Error("DBCS codec is called without the data.") } + if (!codecOptions.table) { throw new Error("Encoding '" + this.encodingName + "' has no data.") } + + // Load tables. + var mappingTable = codecOptions.table() + + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = [] + this.decodeTables[0] = UNASSIGNED_NODE.slice(0) // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = [] + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) { this._addDecodeChunk(mappingTable[i]) } + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === "function") { + this.gb18030 = codecOptions.gb18030() // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length + this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + + var commonFourthByteNodeIdx = this.decodeTables.length + this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + + // Fill out the tree + var firstByteNode = this.decodeTables[0] + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]] + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2") + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]] + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3") + } + + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]] + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) { fourthByteNode[l] = GB18030_CODE } + } + } + } + } + } + + this.defaultCharUnicode = iconv.defaultCharUnicode + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = [] + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = [] + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {} + if (codecOptions.encodeSkipVals) { + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i] + if (typeof val === "number") { skipEncodeChars[val] = true } else { + for (var j = val.from; j <= val.to; j++) { skipEncodeChars[j] = true } + } + } + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars) + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) { + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) { this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]) } + } + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)] + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"] + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0) +} + +DBCSCodec.prototype.encoder = DBCSEncoder +DBCSCodec.prototype.decoder = DBCSDecoder + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function (addr) { + var bytes = [] + for (; addr > 0; addr >>>= 8) { bytes.push(addr & 0xFF) } + if (bytes.length == 0) { bytes.push(0) } + + var node = this.decodeTables[0] + for (var i = bytes.length - 1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]] + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)) + } else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val] + } else { throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)) } + } + return node +} + +DBCSCodec.prototype._addDecodeChunk = function (chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16) + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr) + curAddr = curAddr & 0xFF + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k] + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++) + if (code >= 0xD800 && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++) + if (codeTrail >= 0xDC00 && codeTrail < 0xE000) { writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00) } else { throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]) } + } else if (code > 0x0FF0 && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2 + var seq = [] + for (var m = 0; m < len; m++) { seq.push(part.charCodeAt(l++)) } // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length + this.decodeTableSeq.push(seq) + } else { writeTable[curAddr++] = code } // Basic char + } + } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1 + for (var l = 0; l < part; l++) { writeTable[curAddr++] = charCode++ } + } else { throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]) } + } + if (curAddr > 0xFF) { throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr) } +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function (uCode) { + var high = uCode >> 8 // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) { + this.encodeTable[high] = UNASSIGNED_NODE.slice(0) + } // Create bucket on demand. + return this.encodeTable[high] +} + +DBCSCodec.prototype._setEncodeChar = function (uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode) + var low = uCode & 0xFF + if (bucket[low] <= SEQ_START) { this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode } // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) { bucket[low] = dbcsCode } +} + +DBCSCodec.prototype._setEncodeSequence = function (seq, dbcsCode) { + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0] + var bucket = this._getEncodeBucket(uCode) + var low = uCode & 0xFF + + var node + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START - bucket[low]] + } else { + // There was no sequence object - allocate a new one. + node = {} + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low] // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length + this.encodeTableSeq.push(node) + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length - 1; j++) { + var oldVal = node[uCode] + if (typeof oldVal === "object") { node = oldVal } else { + node = node[uCode] = {} + if (oldVal !== undefined) { node[DEF_CHAR] = oldVal } + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length - 1] + node[uCode] = dbcsCode +} + +DBCSCodec.prototype._fillEncodeTable = function (nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx] + var hasValues = false + var subNodeEmpty = {} + for (var i = 0; i < 0x100; i++) { + var uCode = node[i] + var mbCode = prefix + i + if (skipEncodeChars[mbCode]) { continue } + + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode) + hasValues = true + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0 // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) { hasValues = true } else { subNodeEmpty[subNodeIdx] = true } + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode) + hasValues = true + } + } + return hasValues +} + +// == Encoder ================================================================== + +function DBCSEncoder (options, codec) { + // Encoder state + this.leadSurrogate = -1 + this.seqObj = undefined + + // Static data + this.encodeTable = codec.encodeTable + this.encodeTableSeq = codec.encodeTableSeq + this.defaultCharSingleByte = codec.defCharSB + this.gb18030 = codec.gb18030 +} + +DBCSEncoder.prototype.write = function (str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)) + var leadSurrogate = this.leadSurrogate + var seqObj = this.seqObj + var nextChar = -1 + var i = 0; var j = 0 + + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break + var uCode = str.charCodeAt(i++) + } else { + var uCode = nextChar + nextChar = -1 + } + + // 1. Handle surrogates. + if (uCode >= 0xD800 && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode + continue + } else { + leadSurrogate = uCode + // Double lead surrogate found. + uCode = UNASSIGNED + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00) + leadSurrogate = -1 + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED + } + } + } else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED // Write an error, then current char. + leadSurrogate = -1 + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode] + if (typeof resCode === "object") { // Sequence continues. + seqObj = resCode + continue + } else if (typeof resCode === "number") { // Sequence finished. Write it. + dbcsCode = resCode + } else if (resCode == undefined) { // Current character is not part of the sequence. + // Try default character for this sequence + resCode = seqObj[DEF_CHAR] + if (resCode !== undefined) { + dbcsCode = resCode // Found. Write it. + nextChar = uCode // Current character will be written too in the next iteration. + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined + } else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8] + if (subtable !== undefined) { dbcsCode = subtable[uCode & 0xFF] } + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START - dbcsCode] + continue + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode) + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]) + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600 + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260 + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10 + newBuf[j++] = 0x30 + dbcsCode + continue + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) { dbcsCode = this.defaultCharSingleByte } + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode + } else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8 // high byte + newBuf[j++] = dbcsCode & 0xFF // low byte + } else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16 + newBuf[j++] = (dbcsCode >> 8) & 0xFF + newBuf[j++] = dbcsCode & 0xFF + } else { + newBuf[j++] = dbcsCode >>> 24 + newBuf[j++] = (dbcsCode >>> 16) & 0xFF + newBuf[j++] = (dbcsCode >>> 8) & 0xFF + newBuf[j++] = dbcsCode & 0xFF + } + } + + this.seqObj = seqObj + this.leadSurrogate = leadSurrogate + return newBuf.slice(0, j) +} + +DBCSEncoder.prototype.end = function () { + if (this.leadSurrogate === -1 && this.seqObj === undefined) { return } // All clean. Most often case. + + var newBuf = Buffer.alloc(10); var j = 0 + + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR] + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode + } else { + newBuf[j++] = dbcsCode >> 8 // high byte + newBuf[j++] = dbcsCode & 0xFF // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined + } + + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte + this.leadSurrogate = -1 + } + + return newBuf.slice(0, j) +} + +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx + +// == Decoder ================================================================== + +function DBCSDecoder (options, codec) { + // Decoder state + this.nodeIdx = 0 + this.prevBytes = [] + + // Static data + this.decodeTables = codec.decodeTables + this.decodeTableSeq = codec.decodeTableSeq + this.defaultCharUnicode = codec.defaultCharUnicode + this.gb18030 = codec.gb18030 +} + +DBCSDecoder.prototype.write = function (buf) { + var newBuf = Buffer.alloc(buf.length * 2) + var nodeIdx = this.nodeIdx + var prevBytes = this.prevBytes; var prevOffset = this.prevBytes.length + var seqStart = -this.prevBytes.length // idx of the start of current parsed sequence. + var uCode + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset] + + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte] + + if (uCode >= 0) { + // Normal character, just use it. + } else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0) + i = seqStart // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i - 3] - 0x81) * 12600 + (buf[i - 2] - 0x30) * 1260 + (buf[i - 1] - 0x81) * 10 + (curByte - 0x30) + } else { + var ptr = (prevBytes[i - 3 + prevOffset] - 0x81) * 12600 + + (((i - 2 >= 0) ? buf[i - 2] : prevBytes[i - 2 + prevOffset]) - 0x30) * 1260 + + (((i - 1 >= 0) ? buf[i - 1] : prevBytes[i - 1 + prevOffset]) - 0x81) * 10 + + (curByte - 0x30) + } + var idx = findIdx(this.gb18030.gbChars, ptr) + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx] + } else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode + continue + } else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode] + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k] + newBuf[j++] = uCode & 0xFF + newBuf[j++] = uCode >> 8 + } + uCode = seq[seq.length - 1] + } else { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte) } + + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000 + var uCodeLead = 0xD800 | (uCode >> 10) + newBuf[j++] = uCodeLead & 0xFF + newBuf[j++] = uCodeLead >> 8 + + uCode = 0xDC00 | (uCode & 0x3FF) + } + newBuf[j++] = uCode & 0xFF + newBuf[j++] = uCode >> 8 + + // Reset trie node. + nodeIdx = 0; seqStart = i + 1 + } + + this.nodeIdx = nodeIdx + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)) + + return newBuf.slice(0, j).toString("ucs2") +} + +DBCSDecoder.prototype.end = function () { + var ret = "" + + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode + var bytesArr = this.prevBytes.slice(1) + + // Parse remaining as usual. + this.prevBytes = [] + this.nodeIdx = 0 + if (bytesArr.length > 0) { ret += this.write(bytesArr) } + } + + this.prevBytes = [] + this.nodeIdx = 0 + return ret +} + +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx (table, val) { + if (table[0] > val) { return -1 } + + var l = 0; var r = table.length + while (l < r - 1) { // always table[l] <= val < table[r] + var mid = l + ((r - l + 1) >> 1) + if (table[mid] <= val) { l = mid } else { r = mid } + } + return l +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/dbcs-data.js b/tools/ui/node_modules/iconv-lite/encodings/dbcs-data.js new file mode 100644 index 0000000000000000000000000000000000000000..a3858d4cf36253ebfd612bfa062260f8f4a20fcc --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/dbcs-data.js @@ -0,0 +1,185 @@ +"use strict" + +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. + +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + + shiftjis: { + type: "_dbcs", + table: function () { return require("./tables/shiftjis.json") }, + encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E }, + encodeSkipVals: [{ from: 0xED40, to: 0xF940 }] + }, + csshiftjis: "shiftjis", + mskanji: "shiftjis", + sjis: "shiftjis", + windows31j: "shiftjis", + ms31j: "shiftjis", + xsjis: "shiftjis", + windows932: "shiftjis", + ms932: "shiftjis", + 932: "shiftjis", + cp932: "shiftjis", + + eucjp: { + type: "_dbcs", + table: function () { return require("./tables/eucjp.json") }, + encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E } + }, + + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + gb2312: "cp936", + gb231280: "cp936", + gb23121980: "cp936", + csgb2312: "cp936", + csiso58gb231280: "cp936", + euccn: "cp936", + + // Microsoft's CP936 is a subset and approximation of GBK. + windows936: "cp936", + ms936: "cp936", + 936: "cp936", + cp936: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json") } + }, + + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + gbk: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) } + }, + xgbk: "gbk", + isoir58: "gbk", + + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + gb18030: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) }, + gb18030: function () { return require("./tables/gb18030-ranges.json") }, + encodeSkipVals: [0x80], + encodeAdd: { "€": 0xA2E3 } + }, + + chinese: "gb18030", + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + windows949: "cp949", + ms949: "cp949", + 949: "cp949", + cp949: { + type: "_dbcs", + table: function () { return require("./tables/cp949.json") } + }, + + cseuckr: "cp949", + csksc56011987: "cp949", + euckr: "cp949", + isoir149: "cp949", + korean: "cp949", + ksc56011987: "cp949", + ksc56011989: "cp949", + ksc5601: "cp949", + + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + + windows950: "cp950", + ms950: "cp950", + 950: "cp950", + cp950: { + type: "_dbcs", + table: function () { return require("./tables/cp950.json") } + }, + + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + big5: "big5hkscs", + big5hkscs: { + type: "_dbcs", + table: function () { return require("./tables/cp950.json").concat(require("./tables/big5-added.json")) }, + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce + ] + }, + + cnbig5: "big5hkscs", + csbig5: "big5hkscs", + xxbig5: "big5hkscs" +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/index.js b/tools/ui/node_modules/iconv-lite/encodings/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9d90e3cac6b09d9bee4d67eb1a9d8d01254eb05d --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/index.js @@ -0,0 +1,23 @@ +"use strict" + +var mergeModules = require("../lib/helpers/merge-exports") + +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + require("./internal"), + require("./utf32"), + require("./utf16"), + require("./utf7"), + require("./sbcs-codec"), + require("./sbcs-data"), + require("./sbcs-data-generated"), + require("./dbcs-codec"), + require("./dbcs-data") +] + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i] + mergeModules(exports, module) +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/internal.js b/tools/ui/node_modules/iconv-lite/encodings/internal.js new file mode 100644 index 0000000000000000000000000000000000000000..4e5c3ff25ac158bba365548767e9fdd815a1788c --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/internal.js @@ -0,0 +1,218 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true }, + cesu8: { type: "_internal", bomAware: true }, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true }, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec +} + +// ------------------------------------------------------------------------------ + +function InternalCodec (codecOptions, iconv) { + this.enc = codecOptions.encodingName + this.bomAware = codecOptions.bomAware + + if (this.enc === "base64") { this.encoder = InternalEncoderBase64 } else if (this.enc === "utf8") { this.encoder = InternalEncoderUtf8 } else if (this.enc === "cesu8") { + this.enc = "utf8" // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8 + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from("eda0bdedb2a9", "hex").toString() !== "💩") { + this.decoder = InternalDecoderCesu8 + this.defaultCharUnicode = iconv.defaultCharUnicode + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder +InternalCodec.prototype.decoder = InternalDecoder + +// ------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = require("string_decoder").StringDecoder + +function InternalDecoder (options, codec) { + this.decoder = new StringDecoder(codec.enc) +} + +InternalDecoder.prototype.write = function (buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf) + } + + return this.decoder.write(buf) +} + +InternalDecoder.prototype.end = function () { + return this.decoder.end() +} + +// ------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder (options, codec) { + this.enc = codec.enc +} + +InternalEncoder.prototype.write = function (str) { + return Buffer.from(str, this.enc) +} + +InternalEncoder.prototype.end = function () { +} + +// ------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64 (options, codec) { + this.prevStr = "" +} + +InternalEncoderBase64.prototype.write = function (str) { + str = this.prevStr + str + var completeQuads = str.length - (str.length % 4) + this.prevStr = str.slice(completeQuads) + str = str.slice(0, completeQuads) + + return Buffer.from(str, "base64") +} + +InternalEncoderBase64.prototype.end = function () { + return Buffer.from(this.prevStr, "base64") +} + +// ------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8 (options, codec) { +} + +InternalEncoderCesu8.prototype.write = function (str) { + var buf = Buffer.alloc(str.length * 3); var bufIdx = 0 + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i) + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) { buf[bufIdx++] = charCode } else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6) + buf[bufIdx++] = 0x80 + (charCode & 0x3f) + } else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12) + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f) + buf[bufIdx++] = 0x80 + (charCode & 0x3f) + } + } + return buf.slice(0, bufIdx) +} + +InternalEncoderCesu8.prototype.end = function () { +} + +// ------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8 (options, codec) { + this.acc = 0 + this.contBytes = 0 + this.accBytes = 0 + this.defaultCharUnicode = codec.defaultCharUnicode +} + +InternalDecoderCesu8.prototype.write = function (buf) { + var acc = this.acc; var contBytes = this.contBytes; var accBytes = this.accBytes + var res = "" + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i] + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode + contBytes = 0 + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte) + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F + contBytes = 1; accBytes = 1 + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F + contBytes = 2; accBytes = 1 + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f) + contBytes--; accBytes++ + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) { + res += this.defaultCharUnicode + } else if (accBytes === 3 && acc < 0x800) { + res += this.defaultCharUnicode + } else { + // Actually add character. + res += String.fromCharCode(acc) + } + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes + return res +} + +InternalDecoderCesu8.prototype.end = function () { + var res = 0 + if (this.contBytes > 0) { res += this.defaultCharUnicode } + return res +} + +// ------------------------------------------------------------------------------ +// check the chunk boundaries for surrogate pair + +function InternalEncoderUtf8 (options, codec) { + this.highSurrogate = "" +} + +InternalEncoderUtf8.prototype.write = function (str) { + if (this.highSurrogate) { + str = this.highSurrogate + str + this.highSurrogate = "" + } + + if (str.length > 0) { + var charCode = str.charCodeAt(str.length - 1) + if (charCode >= 0xd800 && charCode < 0xdc00) { + this.highSurrogate = str[str.length - 1] + str = str.slice(0, str.length - 1) + } + } + + return Buffer.from(str, this.enc) +} + +InternalEncoderUtf8.prototype.end = function () { + if (this.highSurrogate) { + var str = this.highSurrogate + this.highSurrogate = "" + return Buffer.from(str, this.enc) + } +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/sbcs-codec.js b/tools/ui/node_modules/iconv-lite/encodings/sbcs-codec.js new file mode 100644 index 0000000000000000000000000000000000000000..0e2fc924e1d40c723583b170825298e01ee09158 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -0,0 +1,75 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). + +exports._sbcs = SBCSCodec +function SBCSCodec (codecOptions, iconv) { + if (!codecOptions) { + throw new Error("SBCS codec is called without the data.") + } + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) { + throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)") + } + + if (codecOptions.chars.length === 128) { + var asciiString = "" + for (var i = 0; i < 128; i++) { + asciiString += String.fromCharCode(i) + } + codecOptions.chars = asciiString + codecOptions.chars + } + + this.decodeBuf = Buffer.from(codecOptions.chars, "ucs2") + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)) + + for (var i = 0; i < codecOptions.chars.length; i++) { + encodeBuf[codecOptions.chars.charCodeAt(i)] = i + } + + this.encodeBuf = encodeBuf +} + +SBCSCodec.prototype.encoder = SBCSEncoder +SBCSCodec.prototype.decoder = SBCSDecoder + +function SBCSEncoder (options, codec) { + this.encodeBuf = codec.encodeBuf +} + +SBCSEncoder.prototype.write = function (str) { + var buf = Buffer.alloc(str.length) + for (var i = 0; i < str.length; i++) { + buf[i] = this.encodeBuf[str.charCodeAt(i)] + } + + return buf +} + +SBCSEncoder.prototype.end = function () { +} + +function SBCSDecoder (options, codec) { + this.decodeBuf = codec.decodeBuf +} + +SBCSDecoder.prototype.write = function (buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf + var newBuf = Buffer.alloc(buf.length * 2) + var idx1 = 0; var idx2 = 0 + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i] * 2; idx2 = i * 2 + newBuf[idx2] = decodeBuf[idx1] + newBuf[idx2 + 1] = decodeBuf[idx1 + 1] + } + return newBuf.toString("ucs2") +} + +SBCSDecoder.prototype.end = function () { +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/tools/ui/node_modules/iconv-lite/encodings/sbcs-data-generated.js new file mode 100644 index 0000000000000000000000000000000000000000..9b4823607b6071c67dd7b553767bfee98a49de1c --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/sbcs-data-generated.js @@ -0,0 +1,451 @@ +"use strict"; + +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/iconv-lite/encodings/sbcs-data.js b/tools/ui/node_modules/iconv-lite/encodings/sbcs-data.js new file mode 100644 index 0000000000000000000000000000000000000000..d8f8e1729e6af5193d05056c906fb24bc2da35cf --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/sbcs-data.js @@ -0,0 +1,178 @@ +"use strict" + +// Manually added data to be used by sbcs codec in addition to generated one. + +module.exports = { + // Not supported by iconv, not sure why. + 10029: "maccenteuro", + maccenteuro: { + type: "_sbcs", + chars: "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + + 808: "cp808", + ibm808: "cp808", + cp808: { + type: "_sbcs", + chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, + + mik: { + type: "_sbcs", + chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + + cp720: { + type: "_sbcs", + chars: "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, + + // Aliases of generated encodings. + ascii8bit: "ascii", + usascii: "ascii", + ansix34: "ascii", + ansix341968: "ascii", + ansix341986: "ascii", + csascii: "ascii", + cp367: "ascii", + ibm367: "ascii", + isoir6: "ascii", + iso646us: "ascii", + iso646irv: "ascii", + us: "ascii", + + latin1: "iso88591", + latin2: "iso88592", + latin3: "iso88593", + latin4: "iso88594", + latin5: "iso88599", + latin6: "iso885910", + latin7: "iso885913", + latin8: "iso885914", + latin9: "iso885915", + latin10: "iso885916", + + csisolatin1: "iso88591", + csisolatin2: "iso88592", + csisolatin3: "iso88593", + csisolatin4: "iso88594", + csisolatincyrillic: "iso88595", + csisolatinarabic: "iso88596", + csisolatingreek: "iso88597", + csisolatinhebrew: "iso88598", + csisolatin5: "iso88599", + csisolatin6: "iso885910", + + l1: "iso88591", + l2: "iso88592", + l3: "iso88593", + l4: "iso88594", + l5: "iso88599", + l6: "iso885910", + l7: "iso885913", + l8: "iso885914", + l9: "iso885915", + l10: "iso885916", + + isoir14: "iso646jp", + isoir57: "iso646cn", + isoir100: "iso88591", + isoir101: "iso88592", + isoir109: "iso88593", + isoir110: "iso88594", + isoir144: "iso88595", + isoir127: "iso88596", + isoir126: "iso88597", + isoir138: "iso88598", + isoir148: "iso88599", + isoir157: "iso885910", + isoir166: "tis620", + isoir179: "iso885913", + isoir199: "iso885914", + isoir203: "iso885915", + isoir226: "iso885916", + + cp819: "iso88591", + ibm819: "iso88591", + + cyrillic: "iso88595", + + arabic: "iso88596", + arabic8: "iso88596", + ecma114: "iso88596", + asmo708: "iso88596", + + greek: "iso88597", + greek8: "iso88597", + ecma118: "iso88597", + elot928: "iso88597", + + hebrew: "iso88598", + hebrew8: "iso88598", + + turkish: "iso88599", + turkish8: "iso88599", + + thai: "iso885911", + thai8: "iso885911", + + celtic: "iso885914", + celtic8: "iso885914", + isoceltic: "iso885914", + + tis6200: "tis620", + tis62025291: "tis620", + tis62025330: "tis620", + + 10000: "macroman", + 10006: "macgreek", + 10007: "maccyrillic", + 10079: "maciceland", + 10081: "macturkish", + + cspc8codepage437: "cp437", + cspc775baltic: "cp775", + cspc850multilingual: "cp850", + cspcp852: "cp852", + cspc862latinhebrew: "cp862", + cpgr: "cp869", + + msee: "cp1250", + mscyrl: "cp1251", + msansi: "cp1252", + msgreek: "cp1253", + msturk: "cp1254", + mshebr: "cp1255", + msarab: "cp1256", + winbaltrim: "cp1257", + + cp20866: "koi8r", + 20866: "koi8r", + ibm878: "koi8r", + cskoi8r: "koi8r", + + cp21866: "koi8u", + 21866: "koi8u", + ibm1168: "koi8u", + + strk10482002: "rk1048", + + tcvn5712: "tcvn", + tcvn57121: "tcvn", + + gb198880: "iso646cn", + cn: "iso646cn", + + csiso14jisc6220ro: "iso646jp", + jisc62201969ro: "iso646jp", + jp: "iso646jp", + + cshproman8: "hproman8", + r8: "hproman8", + roman8: "hproman8", + xroman8: "hproman8", + ibm1051: "hproman8", + + mac: "macintosh", + csmacintosh: "macintosh" +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/big5-added.json b/tools/ui/node_modules/iconv-lite/encodings/tables/big5-added.json new file mode 100644 index 0000000000000000000000000000000000000000..3c3d3c2f7b14c6a570e58184f68ef0894a5f812d --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/big5-added.json @@ -0,0 +1,122 @@ +[ +["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], +["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], +["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], +["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], +["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], +["8940","𪎩𡅅"], +["8943","攊"], +["8946","丽滝鵎釟"], +["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], +["89a1","琑糼緍楆竉刧"], +["89ab","醌碸酞肼"], +["89b0","贋胶𠧧"], +["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], +["89c1","溚舾甙"], +["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], +["8a40","𧶄唥"], +["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], +["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], +["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], +["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], +["8aac","䠋𠆩㿺塳𢶍"], +["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], +["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], +["8ac9","𪘁𠸉𢫏𢳉"], +["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], +["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], +["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], +["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], +["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], +["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], +["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], +["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], +["8ca1","𣏹椙橃𣱣泿"], +["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], +["8cc9","顨杫䉶圽"], +["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], +["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], +["8d40","𠮟"], +["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], +["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], +["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], +["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], +["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], +["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], +["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], +["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], +["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], +["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], +["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], +["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], +["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], +["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], +["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], +["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], +["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], +["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], +["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], +["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], +["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], +["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], +["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], +["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], +["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], +["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], +["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], +["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], +["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], +["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], +["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], +["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], +["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], +["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], +["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], +["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], +["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], +["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], +["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], +["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], +["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], +["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], +["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], +["9fae","酙隁酜"], +["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], +["9fc1","𤤙盖鮝个𠳔莾衂"], +["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], +["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], +["9fe7","毺蠘罸"], +["9feb","嘠𪙊蹷齓"], +["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], +["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], +["a055","𡠻𦸅"], +["a058","詾𢔛"], +["a05b","惽癧髗鵄鍮鮏蟵"], +["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], +["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], +["a0a1","嵗𨯂迚𨸹"], +["a0a6","僙𡵆礆匲阸𠼻䁥"], +["a0ae","矾"], +["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], +["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], +["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], +["a3c0","␀",31,"␡"], +["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], +["c740","す",58,"ァアィイ"], +["c7a1","ゥ",81,"А",5,"ЁЖ",4], +["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], +["c8a1","龰冈龱𧘇"], +["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], +["c8f5","ʃɐɛɔɵœøŋʊɪ"], +["f9fe","■"], +["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], +["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], +["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], +["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], +["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], +["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], +["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], +["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], +["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], +["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] +] diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/cp936.json b/tools/ui/node_modules/iconv-lite/encodings/tables/cp936.json new file mode 100644 index 0000000000000000000000000000000000000000..49ddb9a1d68fd76a82904ef694de6b2770c04575 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/cp936.json @@ -0,0 +1,264 @@ +[ +["0","\u0000",127,"€"], +["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], +["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], +["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], +["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], +["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], +["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], +["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], +["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], +["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], +["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], +["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], +["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], +["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], +["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], +["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], +["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], +["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], +["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], +["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], +["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], +["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], +["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], +["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], +["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], +["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], +["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], +["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], +["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], +["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], +["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], +["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], +["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], +["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], +["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], +["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], +["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], +["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], +["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], +["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], +["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], +["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], +["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], +["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], +["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], +["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], +["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], +["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], +["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], +["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], +["9980","檧檨檪檭",114,"欥欦欨",6], +["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], +["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], +["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], +["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], +["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], +["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], +["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], +["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], +["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], +["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], +["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], +["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], +["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], +["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], +["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], +["a2a1","ⅰ",9], +["a2b1","⒈",19,"⑴",19,"①",9], +["a2e5","㈠",9], +["a2f1","Ⅰ",11], +["a3a1","!"#¥%",88," ̄"], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], +["a6ee","︻︼︷︸︱"], +["a6f4","︳︴"], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], +["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], +["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], +["a8bd","ńň"], +["a8c0","ɡ"], +["a8c5","ㄅ",36], +["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], +["a959","℡㈱"], +["a95c","‐"], +["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], +["a980","﹢",4,"﹨﹩﹪﹫"], +["a996","〇"], +["a9a4","─",75], +["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], +["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], +["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], +["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], +["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], +["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], +["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], +["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], +["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], +["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], +["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], +["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], +["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], +["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], +["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], +["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], +["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], +["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], +["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], +["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], +["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], +["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], +["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], +["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], +["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], +["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], +["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], +["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], +["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], +["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], +["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], +["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], +["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], +["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], +["bb40","籃",9,"籎",36,"籵",5,"籾",9], +["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], +["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], +["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], +["bd40","紷",54,"絯",7], +["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], +["be40","継",12,"綧",6,"綯",42], +["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], +["bf40","緻",62], +["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], +["c040","繞",35,"纃",23,"纜纝纞"], +["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], +["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], +["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], +["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], +["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], +["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], +["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], +["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], +["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], +["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], +["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], +["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], +["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], +["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], +["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], +["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], +["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], +["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], +["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], +["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], +["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], +["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], +["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], +["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], +["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], +["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], +["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], +["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], +["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], +["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], +["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], +["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], +["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], +["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], +["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], +["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], +["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], +["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], +["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], +["d440","訞",31,"訿",8,"詉",21], +["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], +["d540","誁",7,"誋",7,"誔",46], +["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], +["d640","諤",34,"謈",27], +["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], +["d740","譆",31,"譧",4,"譭",25], +["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], +["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], +["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], +["d940","貮",62], +["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], +["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], +["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], +["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], +["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], +["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], +["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], +["dd40","軥",62], +["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], +["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], +["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], +["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], +["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], +["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], +["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], +["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], +["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], +["e240","釦",62], +["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], +["e340","鉆",45,"鉵",16], +["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], +["e440","銨",5,"銯",24,"鋉",31], +["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], +["e540","錊",51,"錿",10], +["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], +["e640","鍬",34,"鎐",27], +["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], +["e740","鏎",7,"鏗",54], +["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], +["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], +["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], +["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], +["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], +["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], +["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], +["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], +["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], +["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], +["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], +["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], +["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], +["ee40","頏",62], +["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], +["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], +["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], +["f040","餈",4,"餎餏餑",28,"餯",26], +["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], +["f140","馌馎馚",10,"馦馧馩",47], +["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], +["f240","駺",62], +["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], +["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], +["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], +["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], +["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], +["f540","魼",62], +["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], +["f640","鯜",62], +["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], +["f740","鰼",62], +["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], +["f840","鳣",62], +["f880","鴢",32], +["f940","鵃",62], +["f980","鶂",32], +["fa40","鶣",62], +["fa80","鷢",32], +["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], +["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], +["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], +["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], +["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], +["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], +["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] +] diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/cp949.json b/tools/ui/node_modules/iconv-lite/encodings/tables/cp949.json new file mode 100644 index 0000000000000000000000000000000000000000..2022a007ff7ac97ce51167903d116eec42bffd9a --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/cp949.json @@ -0,0 +1,273 @@ +[ +["0","\u0000",127], +["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], +["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], +["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], +["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], +["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], +["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], +["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], +["8361","긝",18,"긲긳긵긶긹긻긼"], +["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], +["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], +["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], +["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], +["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], +["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], +["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], +["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], +["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], +["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], +["8741","놞",9,"놩",15], +["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], +["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], +["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], +["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], +["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], +["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], +["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], +["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], +["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], +["8a61","둧",4,"둭",18,"뒁뒂"], +["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], +["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], +["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], +["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], +["8c41","똀",15,"똒똓똕똖똗똙",4], +["8c61","똞",6,"똦",5,"똭",6,"똵",5], +["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], +["8d41","뛃",16,"뛕",8], +["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], +["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], +["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], +["8e61","럂",4,"럈럊",19], +["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], +["8f41","뢅",7,"뢎",17], +["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], +["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], +["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], +["9061","륾",5,"릆릈릋릌릏",15], +["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], +["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], +["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], +["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], +["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], +["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], +["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], +["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], +["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], +["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], +["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], +["9461","봞",5,"봥",6,"봭",12], +["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], +["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], +["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], +["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], +["9641","뺸",23,"뻒뻓"], +["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], +["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], +["9741","뾃",16,"뾕",8], +["9761","뾞",17,"뾱",7], +["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], +["9841","쁀",16,"쁒",5,"쁙쁚쁛"], +["9861","쁝쁞쁟쁡",6,"쁪",15], +["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], +["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], +["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], +["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], +["9a41","숤숥숦숧숪숬숮숰숳숵",16], +["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], +["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], +["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], +["9b61","쌳",17,"썆",7], +["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], +["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], +["9c61","쏿",8,"쐉",6,"쐑",9], +["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], +["9d41","쒪",13,"쒹쒺쒻쒽",8], +["9d61","쓆",25], +["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], +["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], +["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], +["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], +["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], +["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], +["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], +["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], +["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], +["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], +["a141","좥좦좧좩",18,"좾좿죀죁"], +["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], +["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], +["a241","줐줒",5,"줙",18], +["a261","줭",6,"줵",18], +["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], +["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], +["a361","즑",6,"즚즜즞",16], +["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], +["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], +["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], +["a481","쨦쨧쨨쨪",28,"ㄱ",93], +["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], +["a561","쩫",17,"쩾",5,"쪅쪆"], +["a581","쪇",16,"쪙",14,"ⅰ",9], +["a5b0","Ⅰ",9], +["a5c1","Α",16,"Σ",6], +["a5e1","α",16,"σ",6], +["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], +["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], +["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], +["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], +["a761","쬪",22,"쭂쭃쭄"], +["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], +["a841","쭭",10,"쭺",14], +["a861","쮉",18,"쮝",6], +["a881","쮤",19,"쮹",11,"ÆÐªĦ"], +["a8a6","IJ"], +["a8a8","ĿŁØŒºÞŦŊ"], +["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], +["a941","쯅",14,"쯕",10], +["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], +["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], +["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], +["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], +["aa81","챳챴챶",29,"ぁ",82], +["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], +["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], +["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], +["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], +["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], +["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], +["acd1","а",5,"ёж",25], +["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], +["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], +["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], +["ae41","췆",5,"췍췎췏췑",16], +["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], +["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], +["af41","츬츭츮츯츲츴츶",19], +["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], +["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], +["b041","캚",5,"캢캦",5,"캮",12], +["b061","캻",5,"컂",19], +["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], +["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], +["b161","켥",6,"켮켲",5,"켹",11], +["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], +["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], +["b261","쾎",18,"쾢",5,"쾩"], +["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], +["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], +["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], +["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], +["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], +["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], +["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], +["b541","킕",14,"킦킧킩킪킫킭",5], +["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], +["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], +["b641","턅",7,"턎",17], +["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], +["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], +["b741","텮",13,"텽",6,"톅톆톇톉톊"], +["b761","톋",20,"톢톣톥톦톧"], +["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], +["b841","퇐",7,"퇙",17], +["b861","퇫",8,"퇵퇶퇷퇹",13], +["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], +["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], +["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], +["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], +["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], +["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], +["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], +["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], +["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], +["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], +["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], +["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], +["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], +["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], +["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], +["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], +["be41","퐸",7,"푁푂푃푅",14], +["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], +["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], +["bf41","풞",10,"풪",14], +["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], +["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], +["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], +["c061","픞",25], +["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], +["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], +["c161","햌햍햎햏햑",19,"햦햧"], +["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], +["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], +["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], +["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], +["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], +["c361","홢",4,"홨홪",5,"홲홳홵",11], +["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], +["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], +["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], +["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], +["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], +["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], +["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], +["c641","힍힎힏힑",6,"힚힜힞",5], +["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], +["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], +["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], +["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], +["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], +["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], +["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], +["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], +["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], +["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], +["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], +["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], +["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], +["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], +["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], +["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], +["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], +["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], +["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], +["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], +["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], +["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], +["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], +["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], +["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], +["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], +["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], +["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], +["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], +["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], +["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], +["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], +["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], +["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], +["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], +["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], +["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], +["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], +["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], +["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], +["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], +["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], +["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], +["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], +["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], +["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], +["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], +["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], +["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], +["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], +["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], +["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], +["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], +["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], +["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] +] diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/cp950.json b/tools/ui/node_modules/iconv-lite/encodings/tables/cp950.json new file mode 100644 index 0000000000000000000000000000000000000000..d8bc87178dd38fca1829b9e2109c6f71e9721bdf --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/cp950.json @@ -0,0 +1,177 @@ +[ +["0","\u0000",127], +["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], +["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], +["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], +["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], +["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], +["a3a1","ㄐ",25,"˙ˉˊˇˋ"], +["a3e1","€"], +["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], +["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], +["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], +["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], +["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], +["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], +["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], +["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], +["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], +["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], +["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], +["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], +["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], +["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], +["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], +["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], +["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], +["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], +["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], +["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], +["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], +["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], +["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], +["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], +["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], +["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], +["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], +["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], +["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], +["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], +["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], +["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], +["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], +["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], +["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], +["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], +["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], +["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], +["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], +["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], +["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], +["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], +["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], +["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], +["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], +["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], +["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], +["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], +["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], +["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], +["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], +["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], +["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], +["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], +["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], +["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], +["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], +["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], +["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], +["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], +["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], +["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], +["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], +["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], +["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], +["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], +["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], +["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], +["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], +["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], +["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], +["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], +["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], +["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], +["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], +["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], +["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], +["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], +["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], +["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], +["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], +["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], +["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], +["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], +["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], +["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], +["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], +["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], +["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], +["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], +["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], +["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], +["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], +["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], +["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], +["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], +["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], +["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], +["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], +["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], +["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], +["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], +["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], +["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], +["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], +["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], +["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], +["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], +["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], +["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], +["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], +["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], +["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], +["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], +["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], +["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], +["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], +["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], +["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], +["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], +["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], +["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], +["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], +["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], +["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], +["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], +["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], +["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], +["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], +["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], +["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], +["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], +["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], +["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], +["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], +["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], +["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], +["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], +["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], +["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], +["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], +["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], +["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], +["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], +["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], +["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], +["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], +["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], +["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], +["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], +["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], +["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], +["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], +["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], +["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], +["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], +["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], +["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], +["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], +["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], +["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], +["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], +["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], +["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], +["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], +["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], +["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] +] diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/eucjp.json b/tools/ui/node_modules/iconv-lite/encodings/tables/eucjp.json new file mode 100644 index 0000000000000000000000000000000000000000..4fa61ca116009efc18ecbd1531538f31234ad103 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/eucjp.json @@ -0,0 +1,182 @@ +[ +["0","\u0000",127], +["8ea1","。",62], +["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], +["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], +["a2ba","∈∋⊆⊇⊂⊃∪∩"], +["a2ca","∧∨¬⇒⇔∀∃"], +["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["a2f2","ʼn♯♭♪†‡¶"], +["a2fe","◯"], +["a3b0","0",9], +["a3c1","A",25], +["a3e1","a",25], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["ada1","①",19,"Ⅰ",9], +["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], +["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], +["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], +["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], +["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], +["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], +["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], +["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], +["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], +["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], +["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], +["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], +["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], +["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], +["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], +["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], +["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], +["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], +["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], +["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], +["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], +["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], +["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], +["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], +["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], +["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], +["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], +["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], +["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], +["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], +["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], +["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], +["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], +["f4a1","堯槇遙瑤凜熙"], +["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], +["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], +["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["fcf1","ⅰ",9,"¬¦'""], +["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], +["8fa2c2","¡¦¿"], +["8fa2eb","ºª©®™¤№"], +["8fa6e1","ΆΈΉΊΪ"], +["8fa6e7","Ό"], +["8fa6e9","ΎΫ"], +["8fa6ec","Ώ"], +["8fa6f1","άέήίϊΐόςύϋΰώ"], +["8fa7c2","Ђ",10,"ЎЏ"], +["8fa7f2","ђ",10,"ўџ"], +["8fa9a1","ÆĐ"], +["8fa9a4","Ħ"], +["8fa9a6","IJ"], +["8fa9a8","ŁĿ"], +["8fa9ab","ŊØŒ"], +["8fa9af","ŦÞ"], +["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], +["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], +["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], +["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], +["8fabbd","ġĥíìïîǐ"], +["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], +["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], +["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], +["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], +["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], +["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], +["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], +["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], +["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], +["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], +["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], +["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], +["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], +["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], +["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], +["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], +["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], +["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], +["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], +["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], +["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], +["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], +["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], +["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], +["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], +["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], +["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], +["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], +["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], +["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], +["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], +["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], +["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], +["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], +["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], +["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], +["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], +["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], +["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], +["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], +["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], +["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], +["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], +["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], +["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], +["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], +["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], +["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], +["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], +["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], +["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], +["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], +["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], +["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], +["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], +["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], +["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], +["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], +["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], +["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], +["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], +["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], +["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] +] diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/tools/ui/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..85c6934757761e98580abf0c26c351b6fdfd6ad5 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json @@ -0,0 +1 @@ +{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/gbk-added.json b/tools/ui/node_modules/iconv-lite/encodings/tables/gbk-added.json new file mode 100644 index 0000000000000000000000000000000000000000..b742e368f560003b9c95c3ae9b96633034d6f9e9 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -0,0 +1,56 @@ +[ +["a140","",62], +["a180","",32], +["a240","",62], +["a280","",32], +["a2ab","",5], +["a2e3","€"], +["a2ef",""], +["a2fd",""], +["a340","",62], +["a380","",31," "], +["a440","",62], +["a480","",32], +["a4f4","",10], +["a540","",62], +["a580","",32], +["a5f7","",7], +["a640","",62], +["a680","",32], +["a6b9","",7], +["a6d9","",6], +["a6ec",""], +["a6f3",""], +["a6f6","",8], +["a740","",62], +["a780","",32], +["a7c2","",14], +["a7f2","",12], +["a896","",10], +["a8bc","ḿ"], +["a8bf","ǹ"], +["a8c1",""], +["a8ea","",20], +["a958",""], +["a95b",""], +["a95d",""], +["a989","〾⿰",11], +["a997","",12], +["a9f0","",14], +["aaa1","",93], +["aba1","",93], +["aca1","",93], +["ada1","",93], +["aea1","",93], +["afa1","",93], +["d7fa","",4], +["f8a1","",93], +["f9a1","",93], +["faa1","",93], +["fba1","",93], +["fca1","",93], +["fda1","",93], +["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], +["8135f437",""] +] diff --git a/tools/ui/node_modules/iconv-lite/encodings/tables/shiftjis.json b/tools/ui/node_modules/iconv-lite/encodings/tables/shiftjis.json new file mode 100644 index 0000000000000000000000000000000000000000..5a3a43cf8cf6d20324a49b75aff87d1bf902d108 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/tables/shiftjis.json @@ -0,0 +1,125 @@ +[ +["0","\u0000",128], +["a1","。",62], +["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], +["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], +["81b8","∈∋⊆⊇⊂⊃∪∩"], +["81c8","∧∨¬⇒⇔∀∃"], +["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["81f0","ʼn♯♭♪†‡¶"], +["81fc","◯"], +["824f","0",9], +["8260","A",25], +["8281","a",25], +["829f","ぁ",82], +["8340","ァ",62], +["8380","ム",22], +["839f","Α",16,"Σ",6], +["83bf","α",16,"σ",6], +["8440","А",5,"ЁЖ",25], +["8470","а",5,"ёж",7], +["8480","о",17], +["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["8740","①",19,"Ⅰ",9], +["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["877e","㍻"], +["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], +["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], +["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], +["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], +["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], +["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], +["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], +["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], +["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], +["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], +["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], +["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], +["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], +["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], +["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], +["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], +["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], +["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], +["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], +["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], +["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], +["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], +["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], +["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], +["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], +["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], +["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], +["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], +["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], +["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], +["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], +["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], +["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], +["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], +["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], +["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], +["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["eeef","ⅰ",9,"¬¦'""], +["f040","",62], +["f080","",124], +["f140","",62], +["f180","",124], +["f240","",62], +["f280","",124], +["f340","",62], +["f380","",124], +["f440","",62], +["f480","",124], +["f540","",62], +["f580","",124], +["f640","",62], +["f680","",124], +["f740","",62], +["f780","",124], +["f840","",62], +["f880","",124], +["f940",""], +["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], +["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], +["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], +["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], +["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] +] diff --git a/tools/ui/node_modules/iconv-lite/encodings/utf16.js b/tools/ui/node_modules/iconv-lite/encodings/utf16.js new file mode 100644 index 0000000000000000000000000000000000000000..ae60d98e305145b06da0ddede84f7d20484c3e59 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/utf16.js @@ -0,0 +1,187 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js + +// == UTF16-BE codec. ========================================================== + +exports.utf16be = Utf16BECodec +function Utf16BECodec () { +} + +Utf16BECodec.prototype.encoder = Utf16BEEncoder +Utf16BECodec.prototype.decoder = Utf16BEDecoder +Utf16BECodec.prototype.bomAware = true + +// -- Encoding + +function Utf16BEEncoder () { +} + +Utf16BEEncoder.prototype.write = function (str) { + var buf = Buffer.from(str, "ucs2") + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = tmp + } + return buf +} + +Utf16BEEncoder.prototype.end = function () { +} + +// -- Decoding + +function Utf16BEDecoder () { + this.overflowByte = -1 +} + +Utf16BEDecoder.prototype.write = function (buf) { + if (buf.length == 0) { return "" } + + var buf2 = Buffer.alloc(buf.length + 1) + var i = 0; var j = 0 + + if (this.overflowByte !== -1) { + buf2[0] = buf[0] + buf2[1] = this.overflowByte + i = 1; j = 2 + } + + for (; i < buf.length - 1; i += 2, j += 2) { + buf2[j] = buf[i + 1] + buf2[j + 1] = buf[i] + } + + this.overflowByte = (i == buf.length - 1) ? buf[buf.length - 1] : -1 + + return buf2.slice(0, j).toString("ucs2") +} + +Utf16BEDecoder.prototype.end = function () { + this.overflowByte = -1 +} + +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); + +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). + +exports.utf16 = Utf16Codec +function Utf16Codec (codecOptions, iconv) { + this.iconv = iconv +} + +Utf16Codec.prototype.encoder = Utf16Encoder +Utf16Codec.prototype.decoder = Utf16Decoder + +// -- Encoding (pass-through) + +function Utf16Encoder (options, codec) { + options = options || {} + if (options.addBOM === undefined) { options.addBOM = true } + this.encoder = codec.iconv.getEncoder("utf-16le", options) +} + +Utf16Encoder.prototype.write = function (str) { + return this.encoder.write(str) +} + +Utf16Encoder.prototype.end = function () { + return this.encoder.end() +} + +// -- Decoding + +function Utf16Decoder (options, codec) { + this.decoder = null + this.initialBufs = [] + this.initialBufsLen = 0 + + this.options = options || {} + this.iconv = codec.iconv +} + +Utf16Decoder.prototype.write = function (buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf) + this.initialBufsLen += buf.length + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + { return "" } + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.write(buf) +} + +Utf16Decoder.prototype.end = function () { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + var trail = this.decoder.end() + if (trail) { resStr += trail } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + return this.decoder.end() +} + +function detectEncoding (bufs, defaultEncoding) { + var b = [] + var charsProcessed = 0 + // Number of ASCII chars when decoded as LE or BE. + var asciiCharsLE = 0 + var asciiCharsBE = 0 + + outerLoop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i] + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]) + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return "utf-16le" + if (b[0] === 0xFE && b[1] === 0xFF) return "utf-16be" + } + + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++ + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++ + + b.length = 0 + charsProcessed++ + + if (charsProcessed >= 100) { + break outerLoop + } + } + } + } + + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return "utf-16be" + if (asciiCharsBE < asciiCharsLE) return "utf-16le" + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || "utf-16le" +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/utf32.js b/tools/ui/node_modules/iconv-lite/encodings/utf32.js new file mode 100644 index 0000000000000000000000000000000000000000..723178937a3a729a4b701992983292246f55f92f --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/utf32.js @@ -0,0 +1,307 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +// == UTF32-LE/BE codec. ========================================================== + +exports._utf32 = Utf32Codec + +function Utf32Codec (codecOptions, iconv) { + this.iconv = iconv + this.bomAware = true + this.isLE = codecOptions.isLE +} + +exports.utf32le = { type: "_utf32", isLE: true } +exports.utf32be = { type: "_utf32", isLE: false } + +// Aliases +exports.ucs4le = "utf32le" +exports.ucs4be = "utf32be" + +Utf32Codec.prototype.encoder = Utf32Encoder +Utf32Codec.prototype.decoder = Utf32Decoder + +// -- Encoding + +function Utf32Encoder (options, codec) { + this.isLE = codec.isLE + this.highSurrogate = 0 +} + +Utf32Encoder.prototype.write = function (str) { + var src = Buffer.from(str, "ucs2") + var dst = Buffer.alloc(src.length * 2) + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE + var offset = 0 + + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i) + var isHighSurrogate = (code >= 0xD800 && code < 0xDC00) + var isLowSurrogate = (code >= 0xDC00 && code < 0xE000) + + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset) + offset += 4 + } else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000 + + write32.call(dst, codepoint, offset) + offset += 4 + this.highSurrogate = 0 + + continue + } + } + + if (isHighSurrogate) { this.highSurrogate = code } else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset) + offset += 4 + this.highSurrogate = 0 + } + } + + if (offset < dst.length) { dst = dst.slice(0, offset) } + + return dst +} + +Utf32Encoder.prototype.end = function () { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) { return } + + var buf = Buffer.alloc(4) + + if (this.isLE) { buf.writeUInt32LE(this.highSurrogate, 0) } else { buf.writeUInt32BE(this.highSurrogate, 0) } + + this.highSurrogate = 0 + + return buf +} + +// -- Decoding + +function Utf32Decoder (options, codec) { + this.isLE = codec.isLE + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0) + this.overflow = [] +} + +Utf32Decoder.prototype.write = function (src) { + if (src.length === 0) { return "" } + + var i = 0 + var codepoint = 0 + var dst = Buffer.alloc(src.length + 4) + var offset = 0 + var isLE = this.isLE + var overflow = this.overflow + var badChar = this.badChar + + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) { overflow.push(src[i]) } + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i + 1] << 8) | (overflow[i + 2] << 16) | (overflow[i + 3] << 24) + } else { + codepoint = overflow[i + 3] | (overflow[i + 2] << 8) | (overflow[i + 1] << 16) | (overflow[i] << 24) + } + overflow.length = 0 + + offset = _writeCodepoint(dst, offset, codepoint, badChar) + } + } + + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i + 1] << 8) | (src[i + 2] << 16) | (src[i + 3] << 24) + } else { + codepoint = src[i + 3] | (src[i + 2] << 8) | (src[i + 1] << 16) | (src[i] << 24) + } + offset = _writeCodepoint(dst, offset, codepoint, badChar) + } + + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]) + } + + return dst.slice(0, offset).toString("ucs2") +} + +function _writeCodepoint (dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar + } + + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000 + + var high = 0xD800 | (codepoint >> 10) + dst[offset++] = high & 0xff + dst[offset++] = high >> 8 + + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF) + } + + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff + dst[offset++] = codepoint >> 8 + + return offset +}; + +Utf32Decoder.prototype.end = function () { + this.overflow.length = 0 +} + +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); + +// Encoder prepends BOM (which can be overridden with (addBOM: false}). + +exports.utf32 = Utf32AutoCodec +exports.ucs4 = "utf32" + +function Utf32AutoCodec (options, iconv) { + this.iconv = iconv +} + +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder + +// -- Encoding + +function Utf32AutoEncoder (options, codec) { + options = options || {} + + if (options.addBOM === undefined) { + options.addBOM = true + } + + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || "utf-32le", options) +} + +Utf32AutoEncoder.prototype.write = function (str) { + return this.encoder.write(str) +} + +Utf32AutoEncoder.prototype.end = function () { + return this.encoder.end() +} + +// -- Decoding + +function Utf32AutoDecoder (options, codec) { + this.decoder = null + this.initialBufs = [] + this.initialBufsLen = 0 + this.options = options || {} + this.iconv = codec.iconv +} + +Utf32AutoDecoder.prototype.write = function (buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf) + this.initialBufsLen += buf.length + + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + { return "" } + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.write(buf) +} + +Utf32AutoDecoder.prototype.end = function () { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + var trail = this.decoder.end() + if (trail) { resStr += trail } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.end() +} + +function detectEncoding (bufs, defaultEncoding) { + var b = [] + var charsProcessed = 0 + var invalidLE = 0; var invalidBE = 0 // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0; var bmpCharsBE = 0 // Number of BMP chars when decoded as LE or BE. + + outerLoop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i] + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]) + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return "utf-32le" + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return "utf-32be" + } + } + + if (b[0] !== 0 || b[1] > 0x10) invalidBE++ + if (b[3] !== 0 || b[2] > 0x10) invalidLE++ + + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++ + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++ + + b.length = 0 + charsProcessed++ + + if (charsProcessed >= 100) { + break outerLoop + } + } + } + } + + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be" + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le" + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || "utf-32le" +} diff --git a/tools/ui/node_modules/iconv-lite/encodings/utf7.js b/tools/ui/node_modules/iconv-lite/encodings/utf7.js new file mode 100644 index 0000000000000000000000000000000000000000..fe72a9d9b52b1b616ce05a534ff53e7975928e23 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/encodings/utf7.js @@ -0,0 +1,283 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 + +exports.utf7 = Utf7Codec +exports.unicode11utf7 = "utf7" // Alias UNICODE-1-1-UTF-7 +function Utf7Codec (codecOptions, iconv) { + this.iconv = iconv +}; + +Utf7Codec.prototype.encoder = Utf7Encoder +Utf7Codec.prototype.decoder = Utf7Decoder +Utf7Codec.prototype.bomAware = true + +// -- Encoding + +// Why scape ()?./? +// eslint-disable-next-line no-useless-escape +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g + +function Utf7Encoder (options, codec) { + this.iconv = codec.iconv +} + +Utf7Encoder.prototype.write = function (str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function (chunk) { + return "+" + (chunk === "+" + ? "" + : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + + "-" + }.bind(this))) +} + +Utf7Encoder.prototype.end = function () { +} + +// -- Decoding + +function Utf7Decoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = "" +} + +// Why scape /? +// eslint-disable-next-line no-useless-escape +var base64Regex = /[A-Za-z0-9\/+]/ +var base64Chars = [] +for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) } + +var plusChar = "+".charCodeAt(0) +var minusChar = "-".charCodeAt(0) +var andChar = "&".charCodeAt(0) + +Utf7Decoder.prototype.write = function (buf) { + var res = ""; var lastI = 0 + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + + // The decoder is more involved as we must handle chunks in stream. + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. + lastI = i + 1 + inBase64 = true + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "+-" -> "+" + res += "+" + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii") + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + { i-- } + + lastI = i + 1 + inBase64 = false + base64Accum = "" + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii") + + var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded) + + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + this.inBase64 = inBase64 + this.base64Accum = base64Accum + + return res +} + +Utf7Decoder.prototype.end = function () { + var res = "" + if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } + + this.inBase64 = false + this.base64Accum = "" + return res +} + +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. + +exports.utf7imap = Utf7IMAPCodec +function Utf7IMAPCodec (codecOptions, iconv) { + this.iconv = iconv +}; + +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder +Utf7IMAPCodec.prototype.bomAware = true + +// -- Encoding + +function Utf7IMAPEncoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = Buffer.alloc(6) + this.base64AccumIdx = 0 +} + +Utf7IMAPEncoder.prototype.write = function (str) { + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + var base64AccumIdx = this.base64AccumIdx + var buf = Buffer.alloc(str.length * 5 + 10); var bufIdx = 0 + + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i) + if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) + base64AccumIdx = 0 + } + + buf[bufIdx++] = minusChar // Write '-', then go to direct mode. + inBase64 = false + } + + if (!inBase64) { + buf[bufIdx++] = uChar // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + { buf[bufIdx++] = minusChar } + } + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar // Write '&', then go to base64 mode. + inBase64 = true + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8 + base64Accum[base64AccumIdx++] = uChar & 0xFF + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx) + base64AccumIdx = 0 + } + } + } + } + + this.inBase64 = inBase64 + this.base64AccumIdx = base64AccumIdx + + return buf.slice(0, bufIdx) +} + +Utf7IMAPEncoder.prototype.end = function () { + var buf = Buffer.alloc(10); var bufIdx = 0 + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) + this.base64AccumIdx = 0 + } + + buf[bufIdx++] = minusChar // Write '-', then go to direct mode. + this.inBase64 = false + } + + return buf.slice(0, bufIdx) +} + +// -- Decoding + +function Utf7IMAPDecoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = "" +} + +var base64IMAPChars = base64Chars.slice() +base64IMAPChars[",".charCodeAt(0)] = true + +Utf7IMAPDecoder.prototype.write = function (buf) { + var res = ""; var lastI = 0 + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. + lastI = i + 1 + inBase64 = true + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&" + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, "/") + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + { i-- } + + lastI = i + 1 + inBase64 = false + base64Accum = "" + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/") + + var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded) + + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + this.inBase64 = inBase64 + this.base64Accum = base64Accum + + return res +} + +Utf7IMAPDecoder.prototype.end = function () { + var res = "" + if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } + + this.inBase64 = false + this.base64Accum = "" + return res +} diff --git a/tools/ui/node_modules/iconv-lite/lib/bom-handling.js b/tools/ui/node_modules/iconv-lite/lib/bom-handling.js new file mode 100644 index 0000000000000000000000000000000000000000..a86a6b55ce1982670735bc873e18da940f796747 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/lib/bom-handling.js @@ -0,0 +1,48 @@ +"use strict" + +var BOMChar = "\uFEFF" + +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper (encoder, options) { + this.encoder = encoder + this.addBOM = true +} + +PrependBOMWrapper.prototype.write = function (str) { + if (this.addBOM) { + str = BOMChar + str + this.addBOM = false + } + + return this.encoder.write(str) +} + +PrependBOMWrapper.prototype.end = function () { + return this.encoder.end() +} + +// ------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper +function StripBOMWrapper (decoder, options) { + this.decoder = decoder + this.pass = false + this.options = options || {} +} + +StripBOMWrapper.prototype.write = function (buf) { + var res = this.decoder.write(buf) + if (this.pass || !res) { return res } + + if (res[0] === BOMChar) { + res = res.slice(1) + if (typeof this.options.stripBOM === "function") { this.options.stripBOM() } + } + + this.pass = true + return res +} + +StripBOMWrapper.prototype.end = function () { + return this.decoder.end() +} diff --git a/tools/ui/node_modules/iconv-lite/lib/helpers/merge-exports.js b/tools/ui/node_modules/iconv-lite/lib/helpers/merge-exports.js new file mode 100644 index 0000000000000000000000000000000000000000..e79e041d9529bfa24dc638a72bbc28039c83d54f --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/lib/helpers/merge-exports.js @@ -0,0 +1,13 @@ +"use strict" + +var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn + +function mergeModules (target, module) { + for (var key in module) { + if (hasOwn(module, key)) { + target[key] = module[key] + } + } +} + +module.exports = mergeModules diff --git a/tools/ui/node_modules/iconv-lite/lib/index.d.ts b/tools/ui/node_modules/iconv-lite/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b11d99e91e6d8ed211f8d8b1d3b457c6adf0044b --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/lib/index.d.ts @@ -0,0 +1,129 @@ +/* --------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * REQUIREMENT: This definition is dependent on the @types/node definition. + * Install with `npm install @types/node --save-dev` + *-------------------------------------------------------------------------------------------- */ + +/* --------------------------------------------------------------------------------------------- + * This file provides detailed typings for the public API of iconv-lite + *-------------------------------------------------------------------------------------------- */ + +import type Stream = require("stream") +import type { Encoding } from "../types/encodings" + +declare namespace iconv { + export interface DecodeOptions { + /** + * Strip the Byte Order Mark (BOM) from the input, + * when decoding, if the codec is BOM-aware. @default true + */ + stripBOM?: boolean; + /** Override the default endianness for `UTF-16` and `UTF-32` decodings. */ + defaultEncoding?: "utf16be" | "utf32be"; + } + + export interface EncodeOptions { + /** + * Add a Byte Order Mark (BOM) to the output, when encoding, + * if the codec is BOM-aware. @default false + */ + addBOM?: boolean; + /** Override the default endianness for `UTF-32` encoding. */ + defaultEncoding?: "utf32be"; + } + + export interface EncoderStream { + write(str: string): Buffer; + end(): Buffer | undefined; + } + + export interface DecoderStream { + write(buf: Buffer): string; + end(): string | undefined; + } + + export interface Codec { + encoder: new (options?: EncodeOptions, codec?: Codec) => EncoderStream; + decoder: new (options?: DecodeOptions, codec?: Codec) => DecoderStream; + bomAware?: boolean; + [key: string]: any; + } + + /** Encodes a `string` into a `Buffer`, using the provided `encoding`. */ + export function encode (content: string, encoding: Encoding, options?: EncodeOptions): Buffer + + /** Decodes a `Buffer` into a `string`, using the provided `encoding`. */ + export function decode (buffer: Buffer | Uint8Array, encoding: Encoding, options?: DecodeOptions): string + + /** Checks if a given encoding is supported by `iconv-lite`. */ + export function encodingExists (encoding: string): encoding is Encoding + + /** Legacy alias for {@link iconv.encode}. */ + export const toEncoding: typeof iconv.encode + + /** Legacy alias for {@link iconv.decode}. */ + export const fromEncoding: typeof iconv.decode + + /** Creates a stream that decodes binary data from a given `encoding` into strings. */ + export function decodeStream (encoding: Encoding, options?: DecodeOptions): NodeJS.ReadWriteStream + + /** Creates a stream that encodes strings into binary data in a given `encoding`. */ + export function encodeStream (encoding: Encoding, options?: EncodeOptions): NodeJS.ReadWriteStream + + /** + * Explicitly enable Streaming API in browser environments by passing in: + * ```js + * require('stream') + * ``` + * @example iconv.enableStreamingAPI(require('stream')); + */ + export function enableStreamingAPI (stream_module: { Transform: typeof Stream.Transform }): void + + /** Creates and returns a low-level encoder stream. */ + export function getEncoder (encoding: Encoding, options?: EncodeOptions): EncoderStream + + /** Creates and returns a low-level decoder stream. */ + export function getDecoder (encoding: Encoding, options?: DecodeOptions): DecoderStream + + /** + * Returns a codec object for the given `encoding`. + * @throws If the `encoding` is not recognized. + */ + export function getCodec (encoding: Encoding): Codec + + /** Strips all non-alphanumeric characters and appended year from `encoding`. */ + export function _canonicalizeEncoding (encoding: Encoding): string + + /** A cache of all loaded encoding definitions. */ + export let encodings: Record< + Encoding, + | string + | { + type: string; + [key: string]: any; + } + > | null + + /** A cache of initialized codec objects. */ + export let _codecDataCache: Record + + /** The character used for untranslatable `Unicode` characters. @default "�" */ + export let defaultCharUnicode: string + + /** The character used for untranslatable `single-byte` characters. @default "?" */ + export let defaultCharSingleByte: string + + /** + * Skip deprecation warning when strings are used instead of Buffers during decoding. + * Note: {@link iconv.decode} converts the string to Buffer regardless. + */ + export let skipDecodeWarning: boolean + + /** @readonly Whether or not, Streaming API is enabled. */ + export const supportsStreams: boolean + + export type { iconv as Iconv, Encoding } +} + +export = iconv diff --git a/tools/ui/node_modules/iconv-lite/lib/index.js b/tools/ui/node_modules/iconv-lite/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bd5d6bc0d90ac1a924e825a0f2c2c5c5a8021924 --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/lib/index.js @@ -0,0 +1,182 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +var bomHandling = require("./bom-handling") +var mergeModules = require("./helpers/merge-exports") + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true +module.exports.encodings = null + +// Characters emitted in case of error. +module.exports.defaultCharUnicode = "�" +module.exports.defaultCharSingleByte = "?" + +// Public API. +module.exports.encode = function encode (str, encoding, options) { + str = "" + (str || "") // Ensure string. + + var encoder = module.exports.getEncoder(encoding, options) + + var res = encoder.write(str) + var trail = encoder.end() + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res +} + +module.exports.decode = function decode (buf, encoding, options) { + if (typeof buf === "string") { + if (!module.exports.skipDecodeWarning) { + console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding") + module.exports.skipDecodeWarning = true + } + + buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer. + } + + var decoder = module.exports.getDecoder(encoding, options) + + var res = decoder.write(buf) + var trail = decoder.end() + + return trail ? (res + trail) : res +} + +module.exports.encodingExists = function encodingExists (enc) { + try { + module.exports.getCodec(enc) + return true + } catch (e) { + return false + } +} + +// Legacy aliases to convert functions +module.exports.toEncoding = module.exports.encode +module.exports.fromEncoding = module.exports.decode + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +module.exports._codecDataCache = { __proto__: null } + +module.exports.getCodec = function getCodec (encoding) { + if (!module.exports.encodings) { + var raw = require("../encodings") + // TODO: In future versions when old nodejs support is removed can use object.assign + module.exports.encodings = { __proto__: null } // Initialize as empty object. + mergeModules(module.exports.encodings, raw) + } + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = module.exports._canonicalizeEncoding(encoding) + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {} + while (true) { + var codec = module.exports._codecDataCache[enc] + + if (codec) { return codec } + + var codecDef = module.exports.encodings[enc] + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef + break + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) { codecOptions[key] = codecDef[key] } + + if (!codecOptions.encodingName) { codecOptions.encodingName = enc } + + enc = codecDef.type + break + + case "function": // Codec itself. + if (!codecOptions.encodingName) { codecOptions.encodingName = enc } + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + // + codec = new codecDef(codecOptions, module.exports) + + module.exports._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later. + return codec + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')") + } + } +} + +module.exports._canonicalizeEncoding = function (encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "") +} + +module.exports.getEncoder = function getEncoder (encoding, options) { + var codec = module.exports.getCodec(encoding) + var encoder = new codec.encoder(options, codec) + + if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) } + + return encoder +} + +module.exports.getDecoder = function getDecoder (encoding, options) { + var codec = module.exports.getCodec(encoding) + var decoder = new codec.decoder(options, codec) + + if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) } + + return decoder +} + +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) { + if (module.exports.supportsStreams) { return } + + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(streamModule) + + // Not public API yet, but expose the stream classes. + module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream + module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream + + // Streaming API. + module.exports.encodeStream = function encodeStream (encoding, options) { + return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options) + } + + module.exports.decodeStream = function decodeStream (encoding, options) { + return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options) + } + + module.exports.supportsStreams = true +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var streamModule +try { + streamModule = require("stream") +} catch (e) {} + +if (streamModule && streamModule.Transform) { + module.exports.enableStreamingAPI(streamModule) +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + module.exports.encodeStream = module.exports.decodeStream = function () { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.") + } +} + +// Some environments, such as browsers, may not load JavaScript files as UTF-8 +// eslint-disable-next-line no-constant-condition +if ("Ā" !== "\u0100") { + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.") +} diff --git a/tools/ui/node_modules/iconv-lite/lib/streams.js b/tools/ui/node_modules/iconv-lite/lib/streams.js new file mode 100644 index 0000000000000000000000000000000000000000..ebfed8e0dc39caaa6830d86ef0a0b3ae1fde4f6f --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/lib/streams.js @@ -0,0 +1,105 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function (streamModule) { + var Transform = streamModule.Transform + + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream (conv, options) { + this.conv = conv + options = options || {} + options.decodeStrings = false // We accept only strings, so we don't need to decode them. + Transform.call(this, options) + } + + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }) + + IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) { + if (typeof chunk !== "string") { + return done(new Error("Iconv encoding stream needs strings as its input.")) + } + + try { + var res = this.conv.write(chunk) + if (res && res.length) this.push(res) + done() + } catch (e) { + done(e) + } + } + + IconvLiteEncoderStream.prototype._flush = function (done) { + try { + var res = this.conv.end() + if (res && res.length) this.push(res) + done() + } catch (e) { + done(e) + } + } + + IconvLiteEncoderStream.prototype.collect = function (cb) { + var chunks = [] + this.on("error", cb) + this.on("data", function (chunk) { chunks.push(chunk) }) + this.on("end", function () { + cb(null, Buffer.concat(chunks)) + }) + return this + } + + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream (conv, options) { + this.conv = conv + options = options || {} + options.encoding = this.encoding = "utf8" // We output strings. + Transform.call(this, options) + } + + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }) + + IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) } + try { + var res = this.conv.write(chunk) + if (res && res.length) this.push(res, this.encoding) + done() + } catch (e) { + done(e) + } + } + + IconvLiteDecoderStream.prototype._flush = function (done) { + try { + var res = this.conv.end() + if (res && res.length) this.push(res, this.encoding) + done() + } catch (e) { + done(e) + } + } + + IconvLiteDecoderStream.prototype.collect = function (cb) { + var res = "" + this.on("error", cb) + this.on("data", function (chunk) { res += chunk }) + this.on("end", function () { + cb(null, res) + }) + return this + } + + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream + } +} diff --git a/tools/ui/node_modules/iconv-lite/package.json b/tools/ui/node_modules/iconv-lite/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2a573574293a93259fa06edef5810076d4f9ac7d --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/package.json @@ -0,0 +1,70 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.7.2", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "author": "Alexander Shtuchkin ", + "main": "./lib/index.js", + "typings": "./lib/index.d.ts", + "homepage": "https://github.com/pillarjs/iconv-lite", + "bugs": "https://github.com/pillarjs/iconv-lite/issues", + "files": [ + "lib/", + "encodings/", + "types/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/iconv-lite.git" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "lint": "eslint", + "lint:fix": "eslint --fix", + "test": "mocha --reporter spec --check-leaks --grep .", + "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test", + "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test", + "test:performance": "node --allow-natives-syntax performance/index.js", + "test:tap": "mocha --reporter tap --check-leaks --grep .", + "test:typescript": "tsc && attw --pack", + "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz", + "typegen": "node generation/gen-typings.js" + }, + "browser": { + "stream": false + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", + "@stylistic/eslint-plugin": "^5.1.0", + "@stylistic/eslint-plugin-js": "^4.1.0", + "@types/node": "^24.0.12", + "async": "^3.2.0", + "bench-node": "^0.10.0", + "eslint": "^9.0.0", + "errto": "^0.2.1", + "expect-type": "^1.2.0", + "iconv": "^2.3.5", + "mocha": "^6.2.2", + "neostandard": "^0.12.0", + "nyc": "^14.1.1", + "request": "^2.88.2", + "semver": "^6.3.0", + "typescript": "~5.9.2", + "unorm": "^1.6.0" + }, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } +} diff --git a/tools/ui/node_modules/iconv-lite/types/encodings.d.ts b/tools/ui/node_modules/iconv-lite/types/encodings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bedbe33f87099e919425a1b40256e2556255252f --- /dev/null +++ b/tools/ui/node_modules/iconv-lite/types/encodings.d.ts @@ -0,0 +1,423 @@ +/* + * --------------------------------------------------------------------------------------------- + * DO NOT EDIT THIS FILE MANUALLY. + * THIS FILE IS AUTOMATICALLY GENERATED. + * TO UPDATE, RUN `npm run typegen` AND COMMIT THE CHANGES. + * --------------------------------------------------------------------------------------------- + */ + +/** A union of all supported encoding strings in `iconv-lite`. */ +export type Encoding = + | "10000" + | "10006" + | "10007" + | "10029" + | "10079" + | "10081" + | "1046" + | "1124" + | "1125" + | "1129" + | "1133" + | "1161" + | "1162" + | "1163" + | "1250" + | "1251" + | "1252" + | "1253" + | "1254" + | "1255" + | "1256" + | "1257" + | "1258" + | "20866" + | "21866" + | "28591" + | "28592" + | "28593" + | "28594" + | "28595" + | "28596" + | "28597" + | "28598" + | "28599" + | "28600" + | "28601" + | "28603" + | "28604" + | "28605" + | "28606" + | "437" + | "737" + | "775" + | "808" + | "850" + | "852" + | "855" + | "856" + | "857" + | "858" + | "860" + | "861" + | "862" + | "863" + | "864" + | "865" + | "866" + | "869" + | "874" + | "922" + | "932" + | "936" + | "949" + | "950" + | "ansix34" + | "ansix341968" + | "ansix341986" + | "arabic" + | "arabic8" + | "armscii8" + | "ascii" + | "ascii8bit" + | "asmo708" + | "base64" + | "big5" + | "big5hkscs" + | "binary" + | "celtic" + | "celtic8" + | "cesu8" + | "chinese" + | "cn" + | "cnbig5" + | "cp1046" + | "cp1124" + | "cp1125" + | "cp1129" + | "cp1133" + | "cp1161" + | "cp1162" + | "cp1163" + | "cp1250" + | "cp1251" + | "cp1252" + | "cp1253" + | "cp1254" + | "cp1255" + | "cp1256" + | "cp1257" + | "cp1258" + | "cp20866" + | "cp21866" + | "cp28591" + | "cp28592" + | "cp28593" + | "cp28594" + | "cp28595" + | "cp28596" + | "cp28597" + | "cp28598" + | "cp28599" + | "cp28600" + | "cp28601" + | "cp28603" + | "cp28604" + | "cp28605" + | "cp28606" + | "cp367" + | "cp437" + | "cp720" + | "cp737" + | "cp775" + | "cp808" + | "cp819" + | "cp850" + | "cp852" + | "cp855" + | "cp856" + | "cp857" + | "cp858" + | "cp860" + | "cp861" + | "cp862" + | "cp863" + | "cp864" + | "cp865" + | "cp866" + | "cp869" + | "cp874" + | "cp922" + | "cp932" + | "cp936" + | "cp949" + | "cp950" + | "cpgr" + | "csascii" + | "csbig5" + | "cseuckr" + | "csgb2312" + | "cshproman8" + | "csibm1046" + | "csibm1124" + | "csibm1125" + | "csibm1129" + | "csibm1133" + | "csibm1161" + | "csibm1162" + | "csibm1163" + | "csibm437" + | "csibm737" + | "csibm775" + | "csibm850" + | "csibm852" + | "csibm855" + | "csibm856" + | "csibm857" + | "csibm858" + | "csibm860" + | "csibm861" + | "csibm862" + | "csibm863" + | "csibm864" + | "csibm865" + | "csibm866" + | "csibm869" + | "csibm922" + | "csiso14jisc6220ro" + | "csiso58gb231280" + | "csisolatin1" + | "csisolatin2" + | "csisolatin3" + | "csisolatin4" + | "csisolatin5" + | "csisolatin6" + | "csisolatinarabic" + | "csisolatincyrillic" + | "csisolatingreek" + | "csisolatinhebrew" + | "cskoi8r" + | "csksc56011987" + | "csmacintosh" + | "cspc775baltic" + | "cspc850multilingual" + | "cspc862latinhebrew" + | "cspc8codepage437" + | "cspcp852" + | "csshiftjis" + | "cyrillic" + | "ecma114" + | "ecma118" + | "elot928" + | "euccn" + | "eucjp" + | "euckr" + | "gb18030" + | "gb198880" + | "gb2312" + | "gb23121980" + | "gb231280" + | "gbk" + | "georgianacademy" + | "georgianps" + | "greek" + | "greek8" + | "hebrew" + | "hebrew8" + | "hex" + | "hproman8" + | "ibm1046" + | "ibm1051" + | "ibm1124" + | "ibm1125" + | "ibm1129" + | "ibm1133" + | "ibm1161" + | "ibm1162" + | "ibm1163" + | "ibm1168" + | "ibm367" + | "ibm437" + | "ibm737" + | "ibm775" + | "ibm808" + | "ibm819" + | "ibm850" + | "ibm852" + | "ibm855" + | "ibm856" + | "ibm857" + | "ibm858" + | "ibm860" + | "ibm861" + | "ibm862" + | "ibm863" + | "ibm864" + | "ibm865" + | "ibm866" + | "ibm869" + | "ibm878" + | "ibm922" + | "iso646cn" + | "iso646irv" + | "iso646jp" + | "iso646us" + | "iso88591" + | "iso885910" + | "iso885911" + | "iso885913" + | "iso885914" + | "iso885915" + | "iso885916" + | "iso88592" + | "iso88593" + | "iso88594" + | "iso88595" + | "iso88596" + | "iso88597" + | "iso88598" + | "iso88599" + | "isoceltic" + | "isoir100" + | "isoir101" + | "isoir109" + | "isoir110" + | "isoir126" + | "isoir127" + | "isoir138" + | "isoir14" + | "isoir144" + | "isoir148" + | "isoir149" + | "isoir157" + | "isoir166" + | "isoir179" + | "isoir199" + | "isoir203" + | "isoir226" + | "isoir57" + | "isoir58" + | "isoir6" + | "jisc62201969ro" + | "jp" + | "koi8r" + | "koi8ru" + | "koi8t" + | "koi8u" + | "korean" + | "ksc5601" + | "ksc56011987" + | "ksc56011989" + | "l1" + | "l10" + | "l2" + | "l3" + | "l4" + | "l5" + | "l6" + | "l7" + | "l8" + | "l9" + | "latin1" + | "latin10" + | "latin2" + | "latin3" + | "latin4" + | "latin5" + | "latin6" + | "latin7" + | "latin8" + | "latin9" + | "mac" + | "maccenteuro" + | "maccroatian" + | "maccyrillic" + | "macgreek" + | "maciceland" + | "macintosh" + | "macroman" + | "macromania" + | "macthai" + | "macturkish" + | "macukraine" + | "mik" + | "ms31j" + | "ms932" + | "ms936" + | "ms949" + | "ms950" + | "msansi" + | "msarab" + | "mscyrl" + | "msee" + | "msgreek" + | "mshebr" + | "mskanji" + | "msturk" + | "pt154" + | "r8" + | "rk1048" + | "roman8" + | "shiftjis" + | "sjis" + | "strk10482002" + | "tcvn" + | "tcvn5712" + | "tcvn57121" + | "thai" + | "thai8" + | "tis620" + | "tis6200" + | "tis62025291" + | "tis62025330" + | "turkish" + | "turkish8" + | "ucs2" + | "ucs4" + | "ucs4be" + | "ucs4le" + | "unicode11utf7" + | "unicode11utf8" + | "us" + | "usascii" + | "utf16" + | "utf16be" + | "utf16le" + | "utf32" + | "utf32be" + | "utf32le" + | "utf7" + | "utf7imap" + | "utf8" + | "viscii" + | "win1250" + | "win1251" + | "win1252" + | "win1253" + | "win1254" + | "win1255" + | "win1256" + | "win1257" + | "win1258" + | "win874" + | "winbaltrim" + | "windows1250" + | "windows1251" + | "windows1252" + | "windows1253" + | "windows1254" + | "windows1255" + | "windows1256" + | "windows1257" + | "windows1258" + | "windows31j" + | "windows874" + | "windows932" + | "windows936" + | "windows949" + | "windows950" + | "xgbk" + | "xroman8" + | "xsjis" + | "xxbig5" + | (string & {}) diff --git a/tools/ui/node_modules/idb/CHANGELOG.md b/tools/ui/node_modules/idb/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..92735dfbed4d0a92aa618c21e795c636ac363743 --- /dev/null +++ b/tools/ui/node_modules/idb/CHANGELOG.md @@ -0,0 +1,87 @@ +# Breaking changes in 7.x + +- No longer committing `build` to GitHub. +- Renamed files in dist. +- Added conditional exports. +- iife build is now a umd. + +# Breaking changes in 6.x + +Some TypeScript definitions changed so write-methods are missing from 'readonly' transactions. This might be backwards-incompatible with code that performs a lot of type wrangling. + +# Breaking changes in 5.x + +I moved some files around, so I bumped the major version for safety. + +# Changes in 4.x + +## Breaking changes + +### Opening a database + +```js +// Old 3.x way +import { openDb } from 'idb'; + +openDb('db-name', 1, (upgradeDb) => { + console.log(upgradeDb.oldVersion); + console.log(upgradeDb.transaction); +}); +``` + +```js +// New 4.x way +import { openDB } from 'idb'; + +openDB('db-name', 1, { + upgrade(db, oldVersion, newVersion, transaction) { + console.log(oldVersion); + console.log(transaction); + }, +}); +``` + +- `openDb` and `deleteDb` were renamed `openDB` and `deleteDB` to be more consistent with DOM naming. +- The signature of `openDB` changed. The third parameter used to be the upgrade callback, it's now an option object which can include an `upgrade` method. +- There's no `UpgradeDB` anymore. You get the same database `openDB` resolves with. Versions numbers and the upgrade transaction are included as additional parameters. + +### Promises & throwing + +The library turns all `IDBRequest` objects into promises, but it doesn't know in advance which methods may return promises. + +As a result, methods such as `store.put` may throw instead of returning a promise. + +If you're using async functions, there isn't a difference. + +### Other breaking changes + +- `iterateCursor` and `iterateKeyCursor` have been removed. These existed to work around browsers microtask issues which have since been fixed. Async iterators provide similar functionality. +- All pseudo-private properties (those beginning with an underscore) are gone. Use `unwrap()` to get access to bare IDB objects. +- `transaction.complete` was renamed to `transaction.done` to be shorter and more consistent with the DOM. +- `getAll` is no longer polyfilled on indexes and stores. +- The library no longer officially supports IE11. + +## New stuff + +- The library now uses proxies, so objects will include everything from their plain-IDB equivalents. +- TypeScript support has massively improved, including the ability to provide types for your database. +- Optional support for async iterators, which makes handling cursors much easier. +- Database objects now have shortcuts for single actions (like `get`, `put`, `add`, `getAll` etc etc). +- For transactions that cover a single store `transaction.store` is a reference to that store. +- `openDB` lets you add callbacks for when your database is blocking another connection, or when you're blocked by another connection. + +# Changes in 3.x + +The library became a module. + +```js +// Old 2.x way: +import idb from 'idb'; +idb.open(…); +idb.delete(…); + +// 3.x way: +import { openDb, deleteDb } from 'idb'; +openDb(…); +deleteDb(…); +``` diff --git a/tools/ui/node_modules/idb/LICENSE b/tools/ui/node_modules/idb/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f8b22cee1143cb62423718deeddc4ed898d08d8a --- /dev/null +++ b/tools/ui/node_modules/idb/LICENSE @@ -0,0 +1,6 @@ +ISC License (ISC) +Copyright (c) 2016, Jake Archibald + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/ui/node_modules/idb/README.md b/tools/ui/node_modules/idb/README.md new file mode 100644 index 0000000000000000000000000000000000000000..25cd83cbca6ab8a1f91af02efaf08273dcfee35d --- /dev/null +++ b/tools/ui/node_modules/idb/README.md @@ -0,0 +1,506 @@ +# IndexedDB with usability. + +This is a tiny (~1.06kB brotli'd) library that mostly mirrors the IndexedDB API, but with small improvements that make a big difference to usability. + +1. [Installation](#installation) +1. [Changes](#changes) +1. [Browser support](#browser-support) +1. [API](#api) + 1. [`openDB`](#opendb) + 1. [`deleteDB`](#deletedb) + 1. [`unwrap`](#unwrap) + 1. [`wrap`](#wrap) + 1. [General enhancements](#general-enhancements) + 1. [`IDBDatabase` enhancements](#idbdatabase-enhancements) + 1. [`IDBTransaction` enhancements](#idbtransaction-enhancements) + 1. [`IDBCursor` enhancements](#idbcursor-enhancements) + 1. [Async iterators](#async-iterators) +1. [Examples](#examples) +1. [TypeScript](#typescript) + +# Installation + +## Using npm + +```sh +npm install idb +``` + +Then, assuming you're using a module-compatible system (like webpack, Rollup etc): + +```js +import { openDB, deleteDB, wrap, unwrap } from 'idb'; + +async function doDatabaseStuff() { + const db = await openDB(…); +} +``` + +## Directly in a browser + +### Using the modules method directly via jsdelivr: + +```html + +``` + +### Using external script reference + +```html + + +``` + +A global, `idb`, will be created, containing all exports of the module version. + +# Changes + +[See details of (potentially) breaking changes](CHANGELOG.md). + +# Browser support + +This library targets modern browsers, as in Chrome, Firefox, Safari, and other browsers that use those engines, such as Edge. IE is not supported. + +If you want to target much older versions of those browsers, you can transpile the library using something like [Babel](https://babeljs.io/). You can't transpile the library for IE, as it relies on a proper implementation of [JavaScript proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy). + +# API + +## `openDB` + +This method opens a database, and returns a promise for an enhanced [`IDBDatabase`](https://w3c.github.io/IndexedDB/#database-interface). + +```js +const db = await openDB(name, version, { + upgrade(db, oldVersion, newVersion, transaction, event) { + // … + }, + blocked(currentVersion, blockedVersion, event) { + // … + }, + blocking(currentVersion, blockedVersion, event) { + // … + }, + terminated() { + // … + }, +}); +``` + +- `name`: Name of the database. +- `version` (optional): Schema version, or `undefined` to open the current version. +- `upgrade` (optional): Called if this version of the database has never been opened before. Use it to specify the schema for the database. This is similar to the [`upgradeneeded` event](https://developer.mozilla.org/en-US/docs/Web/API/IDBOpenDBRequest/upgradeneeded_event) in plain IndexedDB. + - `db`: An enhanced `IDBDatabase`. + - `oldVersion`: Last version of the database opened by the user. + - `newVersion`: Whatever new version you provided. + - `transaction`: An enhanced transaction for this upgrade. This is useful if you need to get data from other stores as part of a migration. + - `event`: The event object for the associated `upgradeneeded` event. +- `blocked` (optional): Called if there are older versions of the database open on the origin, so this version cannot open. This is similar to the [`blocked` event](https://developer.mozilla.org/en-US/docs/Web/API/IDBOpenDBRequest/blocked_event) in plain IndexedDB. + - `currentVersion`: Version of the database that's blocking this one. + - `blockedVersion`: The version of the database being blocked (whatever version you provided to `openDB`). + - `event`: The event object for the associated `blocked` event. +- `blocking` (optional): Called if this connection is blocking a future version of the database from opening. This is similar to the [`versionchange` event](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/versionchange_event) in plain IndexedDB. + - `currentVersion`: Version of the open database (whatever version you provided to `openDB`). + - `blockedVersion`: The version of the database that's being blocked. + - `event`: The event object for the associated `versionchange` event. +- `terminated` (optional): Called if the browser abnormally terminates the connection, but not on regular closures like calling `db.close()`. This is similar to the [`close` event](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/close_event) in plain IndexedDB. + +## `deleteDB` + +Deletes a database. + +```js +await deleteDB(name, { + blocked() { + // … + }, +}); +``` + +- `name`: Name of the database. +- `blocked` (optional): Called if the database already exists and there are open connections that don’t close in response to a versionchange event, the request will be blocked until they all close. + - `currentVersion`: Version of the database that's blocking the delete operation. + - `event`: The event object for the associated 'versionchange' event. + +## `unwrap` + +Takes an enhanced IndexedDB object and returns the plain unmodified one. + +```js +const unwrapped = unwrap(wrapped); +``` + +This is useful if, for some reason, you want to drop back into plain IndexedDB. Promises will also be converted back into `IDBRequest` objects. + +## `wrap` + +Takes an IDB object and returns a version enhanced by this library. + +```js +const wrapped = wrap(unwrapped); +``` + +This is useful if some third party code gives you an `IDBDatabase` object and you want it to have the features of this library. + +This doesn't work with `IDBCursor`, [due to missing primitives](https://github.com/w3c/IndexedDB/issues/255). Also, if you wrap an `IDBTransaction`, `tx.store` and `tx.objectStoreNames` won't work in Edge. To avoid these issues, wrap the `IDBDatabase` object, and use the wrapped object to create a new transaction. + +## General enhancements + +Once you've opened the database the API is the same as IndexedDB, except for a few changes to make things easier. + +Firstly, any method that usually returns an `IDBRequest` object will now return a promise for the result. + +```js +const store = db.transaction(storeName).objectStore(storeName); +const value = await store.get(key); +``` + +### Promises & throwing + +The library turns all `IDBRequest` objects into promises, but it doesn't know in advance which methods may return promises. + +As a result, methods such as `store.put` may throw instead of returning a promise. + +If you're using async functions, there's no observable difference. + +### Transaction lifetime + +TL;DR: **Do not `await` other things between the start and end of your transaction**, otherwise the transaction will close before you're done. + +An IDB transaction auto-closes if it doesn't have anything left do once microtasks have been processed. As a result, this works fine: + +```js +const tx = db.transaction('keyval', 'readwrite'); +const store = tx.objectStore('keyval'); +const val = (await store.get('counter')) || 0; +await store.put(val + 1, 'counter'); +await tx.done; +``` + +But this doesn't: + +```js +const tx = db.transaction('keyval', 'readwrite'); +const store = tx.objectStore('keyval'); +const val = (await store.get('counter')) || 0; +// This is where things go wrong: +const newVal = await fetch('/increment?val=' + val); +// And this throws an error: +await store.put(newVal, 'counter'); +await tx.done; +``` + +In this case, the transaction closes while the browser is fetching, so `store.put` fails. + +## `IDBDatabase` enhancements + +### Shortcuts to get/set from an object store + +It's common to create a transaction for a single action, so helper methods are included for this: + +```js +// Get a value from a store: +const value = await db.get(storeName, key); +// Set a value in a store: +await db.put(storeName, value, key); +``` + +The shortcuts are: `get`, `getKey`, `getAll`, `getAllKeys`, `count`, `put`, `add`, `delete`, and `clear`. Each method takes a `storeName` argument, the name of the object store, and the rest of the arguments are the same as the equivalent `IDBObjectStore` method. + +### Shortcuts to get from an index + +The shortcuts are: `getFromIndex`, `getKeyFromIndex`, `getAllFromIndex`, `getAllKeysFromIndex`, and `countFromIndex`. + +```js +// Get a value from an index: +const value = await db.getFromIndex(storeName, indexName, key); +``` + +Each method takes `storeName` and `indexName` arguments, followed by the rest of the arguments from the equivalent `IDBIndex` method. + +## `IDBTransaction` enhancements + +### `tx.store` + +If a transaction involves a single store, the `store` property will reference that store. + +```js +const tx = db.transaction('whatever'); +const store = tx.store; +``` + +If a transaction involves multiple stores, `tx.store` is undefined, you need to use `tx.objectStore(storeName)` to get the stores. + +### `tx.done` + +Transactions have a `.done` promise which resolves when the transaction completes successfully, and otherwise rejects with the [transaction error](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/error). + +```js +const tx = db.transaction(storeName, 'readwrite'); +await Promise.all([ + tx.store.put('bar', 'foo'), + tx.store.put('world', 'hello'), + tx.done, +]); +``` + +If you're writing to the database, `tx.done` is the signal that everything was successfully committed to the database. However, it's still beneficial to await the individual operations, as you'll see the error that caused the transaction to fail. + +## `IDBCursor` enhancements + +Cursor advance methods (`advance`, `continue`, `continuePrimaryKey`) return a promise for the cursor, or null if there are no further values to provide. + +```js +let cursor = await db.transaction(storeName).store.openCursor(); + +while (cursor) { + console.log(cursor.key, cursor.value); + cursor = await cursor.continue(); +} +``` + +## Async iterators + +Async iterator support isn't included by default (Edge doesn't support them). To include them, import `idb/with-async-ittr` instead of `idb` (this increases the library size to ~1.29kB brotli'd): + +```js +import { openDB } from 'idb/with-async-ittr'; +``` + +Or `https://cdn.jsdelivr.net/npm/idb@7/build/umd-with-async-ittr.js` if you're using the non-module version. + +Now you can iterate over stores, indexes, and cursors: + +```js +const tx = db.transaction(storeName); + +for await (const cursor of tx.store) { + // … +} +``` + +Each yielded object is an `IDBCursor`. You can optionally use the advance methods to skip items (within an async iterator they return void): + +```js +const tx = db.transaction(storeName); + +for await (const cursor of tx.store) { + console.log(cursor.value); + // Skip the next item + cursor.advance(2); +} +``` + +If you don't manually advance the cursor, `cursor.continue()` is called for you. + +Stores and indexes also have an `iterate` method which has the same signature as `openCursor`, but returns an async iterator: + +```js +const index = db.transaction('books').store.index('author'); + +for await (const cursor of index.iterate('Douglas Adams')) { + console.log(cursor.value); +} +``` + +# Examples + +## Keyval store + +This is very similar to `localStorage`, but async. If this is _all_ you need, you may be interested in [idb-keyval](https://www.npmjs.com/package/idb-keyval). You can always upgrade to this library later. + +```js +import { openDB } from 'idb'; + +const dbPromise = openDB('keyval-store', 1, { + upgrade(db) { + db.createObjectStore('keyval'); + }, +}); + +export async function get(key) { + return (await dbPromise).get('keyval', key); +} +export async function set(key, val) { + return (await dbPromise).put('keyval', val, key); +} +export async function del(key) { + return (await dbPromise).delete('keyval', key); +} +export async function clear() { + return (await dbPromise).clear('keyval'); +} +export async function keys() { + return (await dbPromise).getAllKeys('keyval'); +} +``` + +## Article store + +```js +import { openDB } from 'idb/with-async-ittr.js'; + +async function demo() { + const db = await openDB('Articles', 1, { + upgrade(db) { + // Create a store of objects + const store = db.createObjectStore('articles', { + // The 'id' property of the object will be the key. + keyPath: 'id', + // If it isn't explicitly set, create a value by auto incrementing. + autoIncrement: true, + }); + // Create an index on the 'date' property of the objects. + store.createIndex('date', 'date'); + }, + }); + + // Add an article: + await db.add('articles', { + title: 'Article 1', + date: new Date('2019-01-01'), + body: '…', + }); + + // Add multiple articles in one transaction: + { + const tx = db.transaction('articles', 'readwrite'); + await Promise.all([ + tx.store.add({ + title: 'Article 2', + date: new Date('2019-01-01'), + body: '…', + }), + tx.store.add({ + title: 'Article 3', + date: new Date('2019-01-02'), + body: '…', + }), + tx.done, + ]); + } + + // Get all the articles in date order: + console.log(await db.getAllFromIndex('articles', 'date')); + + // Add 'And, happy new year!' to all articles on 2019-01-01: + { + const tx = db.transaction('articles', 'readwrite'); + const index = tx.store.index('date'); + + for await (const cursor of index.iterate(new Date('2019-01-01'))) { + const article = { ...cursor.value }; + article.body += ' And, happy new year!'; + cursor.update(article); + } + + await tx.done; + } +} +``` + +# TypeScript + +This library is fully typed, and you can improve things by providing types for your database: + +```ts +import { openDB, DBSchema } from 'idb'; + +interface MyDB extends DBSchema { + 'favourite-number': { + key: string; + value: number; + }; + products: { + value: { + name: string; + price: number; + productCode: string; + }; + key: string; + indexes: { 'by-price': number }; + }; +} + +async function demo() { + const db = await openDB('my-db', 1, { + upgrade(db) { + db.createObjectStore('favourite-number'); + + const productStore = db.createObjectStore('products', { + keyPath: 'productCode', + }); + productStore.createIndex('by-price', 'price'); + }, + }); + + // This works + await db.put('favourite-number', 7, 'Jen'); + // This fails at compile time, as the 'favourite-number' store expects a number. + await db.put('favourite-number', 'Twelve', 'Jake'); +} +``` + +To define types for your database, extend `DBSchema` with an interface where the keys are the names of your object stores. + +For each value, provide an object where `value` is the type of values within the store, and `key` is the type of keys within the store. + +Optionally, `indexes` can contain a map of index names, to the type of key within that index. + +Provide this interface when calling `openDB`, and from then on your database will be strongly typed. This also allows your IDE to autocomplete the names of stores and indexes. + +## Opting out of types + +If you call `openDB` without providing types, your database will use basic types. However, sometimes you'll need to interact with stores that aren't in your schema, perhaps during upgrades. In that case you can cast. + +Let's say we were renaming the 'favourite-number' store to 'fave-nums': + +```ts +import { openDB, DBSchema, IDBPDatabase } from 'idb'; + +interface MyDBV1 extends DBSchema { + 'favourite-number': { key: string; value: number }; +} + +interface MyDBV2 extends DBSchema { + 'fave-num': { key: string; value: number }; +} + +const db = await openDB('my-db', 2, { + async upgrade(db, oldVersion) { + // Cast a reference of the database to the old schema. + const v1Db = db as unknown as IDBPDatabase; + + if (oldVersion < 1) { + v1Db.createObjectStore('favourite-number'); + } + if (oldVersion < 2) { + const store = v1Db.createObjectStore('favourite-number'); + store.name = 'fave-num'; + } + }, +}); +``` + +You can also cast to a typeless database by omitting the type, eg `db as IDBPDatabase`. + +Note: Types like `IDBPDatabase` are used by TypeScript only. The implementation uses proxies under the hood. + +# Developing + +```sh +npm run dev +``` + +This will also perform type testing. + +To test, navigate to `build/test/` in a browser. You'll need to set up a [basic web server](https://www.npmjs.com/package/serve) for this. diff --git a/tools/ui/node_modules/idb/build/async-iterators.cjs b/tools/ui/node_modules/idb/build/async-iterators.cjs new file mode 100644 index 0000000000000000000000000000000000000000..33a1f1a8ca6c22637d17a6153cfbad61de77cc41 --- /dev/null +++ b/tools/ui/node_modules/idb/build/async-iterators.cjs @@ -0,0 +1,57 @@ +'use strict'; + +var wrapIdbValue = require('./wrap-idb-value.cjs'); + +const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance']; +const methodMap = {}; +const advanceResults = new WeakMap(); +const ittrProxiedCursorToOriginalProxy = new WeakMap(); +const cursorIteratorTraps = { + get(target, prop) { + if (!advanceMethodProps.includes(prop)) + return target[prop]; + let cachedFunc = methodMap[prop]; + if (!cachedFunc) { + cachedFunc = methodMap[prop] = function (...args) { + advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args)); + }; + } + return cachedFunc; + }, +}; +async function* iterate(...args) { + // tslint:disable-next-line:no-this-assignment + let cursor = this; + if (!(cursor instanceof IDBCursor)) { + cursor = await cursor.openCursor(...args); + } + if (!cursor) + return; + cursor = cursor; + const proxiedCursor = new Proxy(cursor, cursorIteratorTraps); + ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor); + // Map this double-proxy back to the original, so other cursor methods work. + wrapIdbValue.reverseTransformCache.set(proxiedCursor, wrapIdbValue.unwrap(cursor)); + while (cursor) { + yield proxiedCursor; + // If one of the advancing methods was not called, call continue(). + cursor = await (advanceResults.get(proxiedCursor) || cursor.continue()); + advanceResults.delete(proxiedCursor); + } +} +function isIteratorProp(target, prop) { + return ((prop === Symbol.asyncIterator && + wrapIdbValue.instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) || + (prop === 'iterate' && wrapIdbValue.instanceOfAny(target, [IDBIndex, IDBObjectStore]))); +} +wrapIdbValue.replaceTraps((oldTraps) => ({ + ...oldTraps, + get(target, prop, receiver) { + if (isIteratorProp(target, prop)) + return iterate; + return oldTraps.get(target, prop, receiver); + }, + has(target, prop) { + return isIteratorProp(target, prop) || oldTraps.has(target, prop); + }, +})); diff --git a/tools/ui/node_modules/idb/build/async-iterators.d.ts b/tools/ui/node_modules/idb/build/async-iterators.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/idb/build/async-iterators.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/idb/build/async-iterators.js b/tools/ui/node_modules/idb/build/async-iterators.js new file mode 100644 index 0000000000000000000000000000000000000000..be84493bc0c1a004a3a07885b4fa98c2faff36bf --- /dev/null +++ b/tools/ui/node_modules/idb/build/async-iterators.js @@ -0,0 +1,55 @@ +import { r as replaceTraps, a as reverseTransformCache, u as unwrap, i as instanceOfAny } from './wrap-idb-value.js'; + +const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance']; +const methodMap = {}; +const advanceResults = new WeakMap(); +const ittrProxiedCursorToOriginalProxy = new WeakMap(); +const cursorIteratorTraps = { + get(target, prop) { + if (!advanceMethodProps.includes(prop)) + return target[prop]; + let cachedFunc = methodMap[prop]; + if (!cachedFunc) { + cachedFunc = methodMap[prop] = function (...args) { + advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args)); + }; + } + return cachedFunc; + }, +}; +async function* iterate(...args) { + // tslint:disable-next-line:no-this-assignment + let cursor = this; + if (!(cursor instanceof IDBCursor)) { + cursor = await cursor.openCursor(...args); + } + if (!cursor) + return; + cursor = cursor; + const proxiedCursor = new Proxy(cursor, cursorIteratorTraps); + ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor); + // Map this double-proxy back to the original, so other cursor methods work. + reverseTransformCache.set(proxiedCursor, unwrap(cursor)); + while (cursor) { + yield proxiedCursor; + // If one of the advancing methods was not called, call continue(). + cursor = await (advanceResults.get(proxiedCursor) || cursor.continue()); + advanceResults.delete(proxiedCursor); + } +} +function isIteratorProp(target, prop) { + return ((prop === Symbol.asyncIterator && + instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) || + (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore]))); +} +replaceTraps((oldTraps) => ({ + ...oldTraps, + get(target, prop, receiver) { + if (isIteratorProp(target, prop)) + return iterate; + return oldTraps.get(target, prop, receiver); + }, + has(target, prop) { + return isIteratorProp(target, prop) || oldTraps.has(target, prop); + }, +})); diff --git a/tools/ui/node_modules/idb/build/database-extras.d.ts b/tools/ui/node_modules/idb/build/database-extras.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/idb/build/database-extras.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/idb/build/entry.d.ts b/tools/ui/node_modules/idb/build/entry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..febdcf435a04038f9295dc61e084de3b117583ba --- /dev/null +++ b/tools/ui/node_modules/idb/build/entry.d.ts @@ -0,0 +1,627 @@ +export interface OpenDBCallbacks { + /** + * Called if this version of the database has never been opened before. Use it to specify the + * schema for the database. + * + * @param database A database instance that you can use to add/remove stores and indexes. + * @param oldVersion Last version of the database opened by the user. + * @param newVersion Whatever new version you provided. + * @param transaction The transaction for this upgrade. + * This is useful if you need to get data from other stores as part of a migration. + * @param event The event object for the associated 'upgradeneeded' event. + */ + upgrade?(database: IDBPDatabase, oldVersion: number, newVersion: number | null, transaction: IDBPTransaction[], 'versionchange'>, event: IDBVersionChangeEvent): void; + /** + * Called if there are older versions of the database open on the origin, so this version cannot + * open. + * + * @param currentVersion Version of the database that's blocking this one. + * @param blockedVersion The version of the database being blocked (whatever version you provided to `openDB`). + * @param event The event object for the associated `blocked` event. + */ + blocked?(currentVersion: number, blockedVersion: number | null, event: IDBVersionChangeEvent): void; + /** + * Called if this connection is blocking a future version of the database from opening. + * + * @param currentVersion Version of the open database (whatever version you provided to `openDB`). + * @param blockedVersion The version of the database that's being blocked. + * @param event The event object for the associated `versionchange` event. + */ + blocking?(currentVersion: number, blockedVersion: number | null, event: IDBVersionChangeEvent): void; + /** + * Called if the browser abnormally terminates the connection. + * This is not called when `db.close()` is called. + */ + terminated?(): void; +} +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +export declare function openDB(name: string, version?: number, { blocked, upgrade, blocking, terminated }?: OpenDBCallbacks): Promise>; +export interface DeleteDBCallbacks { + /** + * Called if there are connections to this database open, so it cannot be deleted. + * + * @param currentVersion Version of the database that's blocking the delete operation. + * @param event The event object for the associated `blocked` event. + */ + blocked?(currentVersion: number, event: IDBVersionChangeEvent): void; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +export declare function deleteDB(name: string, { blocked }?: DeleteDBCallbacks): Promise; +export { unwrap, wrap } from './wrap-idb-value.js'; +declare type KeyToKeyNoIndex = { + [K in keyof T]: string extends K ? never : number extends K ? never : K; +}; +declare type ValuesOf = T extends { + [K in keyof T]: infer U; +} ? U : never; +declare type KnownKeys = ValuesOf>; +declare type Omit = Pick>; +export interface DBSchema { + [s: string]: DBSchemaValue; +} +interface IndexKeys { + [s: string]: IDBValidKey; +} +interface DBSchemaValue { + key: IDBValidKey; + value: any; + indexes?: IndexKeys; +} +/** + * Extract known object store names from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + */ +export declare type StoreNames = DBTypes extends DBSchema ? KnownKeys : string; +/** + * Extract database value types from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type StoreValue> = DBTypes extends DBSchema ? DBTypes[StoreName]['value'] : any; +/** + * Extract database key types from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type StoreKey> = DBTypes extends DBSchema ? DBTypes[StoreName]['key'] : IDBValidKey; +/** + * Extract the names of indexes in certain object stores from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type IndexNames> = DBTypes extends DBSchema ? keyof DBTypes[StoreName]['indexes'] : string; +/** + * Extract the types of indexes in certain object stores from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + * @template IndexName Names of the indexes to get the types of. + */ +export declare type IndexKey, IndexName extends IndexNames> = DBTypes extends DBSchema ? IndexName extends keyof DBTypes[StoreName]['indexes'] ? DBTypes[StoreName]['indexes'][IndexName] : IDBValidKey : IDBValidKey; +declare type CursorSource>, StoreName extends StoreNames, IndexName extends IndexNames | unknown, Mode extends IDBTransactionMode = 'readonly'> = IndexName extends IndexNames ? IDBPIndex : IDBPObjectStore; +declare type CursorKey, IndexName extends IndexNames | unknown> = IndexName extends IndexNames ? IndexKey : StoreKey; +declare type IDBPDatabaseExtends = Omit; +/** + * A variation of DOMStringList with precise string types + */ +export interface TypedDOMStringList extends DOMStringList { + contains(string: T): boolean; + item(index: number): T | null; + [index: number]: T; + [Symbol.iterator](): IterableIterator; +} +interface IDBTransactionOptions { + /** + * The durability of the transaction. + * + * The default is "default". Using "relaxed" provides better performance, but with fewer + * guarantees. Web applications are encouraged to use "relaxed" for ephemeral data such as caches + * or quickly changing records, and "strict" in cases where reducing the risk of data loss + * outweighs the impact to performance and power. + */ + durability?: 'default' | 'strict' | 'relaxed'; +} +export interface IDBPDatabase extends IDBPDatabaseExtends { + /** + * The names of stores in the database. + */ + readonly objectStoreNames: TypedDOMStringList>; + /** + * Creates a new object store. + * + * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + createObjectStore>(name: Name, optionalParameters?: IDBObjectStoreParameters): IDBPObjectStore>, Name, 'versionchange'>; + /** + * Deletes the object store with the given name. + * + * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + deleteObjectStore(name: StoreNames): void; + /** + * Start a new transaction. + * + * @param storeNames The object store(s) this transaction needs. + * @param mode + * @param options + */ + transaction, Mode extends IDBTransactionMode = 'readonly'>(storeNames: Name, mode?: Mode, options?: IDBTransactionOptions): IDBPTransaction; + transaction>, Mode extends IDBTransactionMode = 'readonly'>(storeNames: Names, mode?: Mode, options?: IDBTransactionOptions): IDBPTransaction; + /** + * Add a value to a store. + * + * Rejects if an item of a given key already exists in the store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param value + * @param key + */ + add>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; + /** + * Deletes all records in a store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + */ + clear(name: StoreNames): Promise; + /** + * Retrieves the number of records matching the given query in a store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param key + */ + count>(storeName: Name, key?: StoreKey | IDBKeyRange | null): Promise; + /** + * Retrieves the number of records matching the given query in an index. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param key + */ + countFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, key?: IndexKey | IDBKeyRange | null): Promise; + /** + * Deletes records in a store matching the given query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param key + */ + delete>(storeName: Name, key: StoreKey | IDBKeyRange): Promise; + /** + * Retrieves the value of the first record in a store matching the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + */ + get>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves the value of the first record in an index matching the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + */ + getFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values in a store that match the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + * @param count Maximum number of values to return. + */ + getAll>(storeName: Name, query?: StoreKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves all values in an index that match the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + * @param count Maximum number of values to return. + */ + getAllFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves the keys of records in a store matching the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys>(storeName: Name, query?: StoreKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves the keys of records in an index matching the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeysFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves the key of the first record in a store that matches the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + */ + getKey>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves the key of the first record in an index that matches the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + */ + getKeyFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Put an item in the database. + * + * Replaces any item with the same key. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param value + * @param key + */ + put>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; +} +declare type IDBPTransactionExtends = Omit; +export interface IDBPTransaction> = ArrayLike>, Mode extends IDBTransactionMode = 'readonly'> extends IDBPTransactionExtends { + /** + * The transaction's mode. + */ + readonly mode: Mode; + /** + * The names of stores in scope for this transaction. + */ + readonly objectStoreNames: TypedDOMStringList; + /** + * The transaction's connection. + */ + readonly db: IDBPDatabase; + /** + * Promise for the completion of this transaction. + */ + readonly done: Promise; + /** + * The associated object store, if the transaction covers a single store, otherwise undefined. + */ + readonly store: TxStores[1] extends undefined ? IDBPObjectStore : undefined; + /** + * Returns an IDBObjectStore in the transaction's scope. + */ + objectStore(name: StoreName): IDBPObjectStore; +} +declare type IDBPObjectStoreExtends = Omit; +export interface IDBPObjectStore> = ArrayLike>, StoreName extends StoreNames = StoreNames, Mode extends IDBTransactionMode = 'readonly'> extends IDBPObjectStoreExtends { + /** + * The names of indexes in the store. + */ + readonly indexNames: TypedDOMStringList>; + /** + * The associated transaction. + */ + readonly transaction: IDBPTransaction; + /** + * Add a value to the store. + * + * Rejects if an item of a given key already exists in the store. + */ + add: Mode extends 'readonly' ? undefined : (value: StoreValue, key?: StoreKey | IDBKeyRange) => Promise>; + /** + * Deletes all records in store. + */ + clear: Mode extends 'readonly' ? undefined : () => Promise; + /** + * Retrieves the number of records matching the given query. + */ + count(key?: StoreKey | IDBKeyRange | null): Promise; + /** + * Creates a new index in store. + * + * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + createIndex: Mode extends 'versionchange' ? >(name: IndexName, keyPath: string | string[], options?: IDBIndexParameters) => IDBPIndex : undefined; + /** + * Deletes records in store matching the given query. + */ + delete: Mode extends 'readonly' ? undefined : (key: StoreKey | IDBKeyRange) => Promise; + /** + * Retrieves the value of the first record matching the query. + * + * Resolves with undefined if no match is found. + */ + get(query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values that match the query. + * + * @param query + * @param count Maximum number of values to return. + */ + getAll(query?: StoreKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves the keys of records matching the query. + * + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys(query?: StoreKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves the key of the first record that matches the query. + * + * Resolves with undefined if no match is found. + */ + getKey(query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Get a query of a given name. + */ + index>(name: IndexName): IDBPIndex; + /** + * Opens a cursor over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openCursor(query?: StoreKey | IDBKeyRange | null, direction?: IDBCursorDirection): Promise | null>; + /** + * Opens a cursor over the keys matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openKeyCursor(query?: StoreKey | IDBKeyRange | null, direction?: IDBCursorDirection): Promise | null>; + /** + * Put an item in the store. + * + * Replaces any item with the same key. + */ + put: Mode extends 'readonly' ? undefined : (value: StoreValue, key?: StoreKey | IDBKeyRange) => Promise>; + /** + * Iterate over the store. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + /** + * Iterate over the records matching the query. + * + * @param query If null, all records match. + * @param direction + */ + iterate(query?: StoreKey | IDBKeyRange | null, direction?: IDBCursorDirection): AsyncIterableIterator>; +} +declare type IDBPIndexExtends = Omit; +export interface IDBPIndex> = ArrayLike>, StoreName extends StoreNames = StoreNames, IndexName extends IndexNames = IndexNames, Mode extends IDBTransactionMode = 'readonly'> extends IDBPIndexExtends { + /** + * The IDBObjectStore the index belongs to. + */ + readonly objectStore: IDBPObjectStore; + /** + * Retrieves the number of records matching the given query. + */ + count(key?: IndexKey | IDBKeyRange | null): Promise; + /** + * Retrieves the value of the first record matching the query. + * + * Resolves with undefined if no match is found. + */ + get(query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values that match the query. + * + * @param query + * @param count Maximum number of values to return. + */ + getAll(query?: IndexKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves the keys of records matching the query. + * + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys(query?: IndexKey | IDBKeyRange | null, count?: number): Promise[]>; + /** + * Retrieves the key of the first record that matches the query. + * + * Resolves with undefined if no match is found. + */ + getKey(query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Opens a cursor over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openCursor(query?: IndexKey | IDBKeyRange | null, direction?: IDBCursorDirection): Promise | null>; + /** + * Opens a cursor over the keys matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openKeyCursor(query?: IndexKey | IDBKeyRange | null, direction?: IDBCursorDirection): Promise | null>; + /** + * Iterate over the index. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + /** + * Iterate over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + iterate(query?: IndexKey | IDBKeyRange | null, direction?: IDBCursorDirection): AsyncIterableIterator>; +} +declare type IDBPCursorExtends = Omit; +export interface IDBPCursor> = ArrayLike>, StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown, Mode extends IDBTransactionMode = 'readonly'> extends IDBPCursorExtends { + /** + * The key of the current index or object store item. + */ + readonly key: CursorKey; + /** + * The key of the current object store item. + */ + readonly primaryKey: StoreKey; + /** + * Returns the IDBObjectStore or IDBIndex the cursor was opened from. + */ + readonly source: CursorSource; + /** + * Advances the cursor a given number of records. + * + * Resolves to null if no matching records remain. + */ + advance(this: T, count: number): Promise; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * Resolves to null if no matching records remain. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): Promise; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * Resolves to null if no matching records remain. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): Promise; + /** + * Delete the current record. + */ + delete: Mode extends 'readonly' ? undefined : () => Promise; + /** + * Updated the current record. + */ + update: Mode extends 'readonly' ? undefined : (value: StoreValue) => Promise>; + /** + * Iterate over the cursor. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; +} +declare type IDBPCursorIteratorValueExtends> = ArrayLike>, StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown, Mode extends IDBTransactionMode = 'readonly'> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; +export interface IDBPCursorIteratorValue> = ArrayLike>, StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown, Mode extends IDBTransactionMode = 'readonly'> extends IDBPCursorIteratorValueExtends { + /** + * Advances the cursor a given number of records. + */ + advance(this: T, count: number): void; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): void; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; +} +export interface IDBPCursorWithValue> = ArrayLike>, StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown, Mode extends IDBTransactionMode = 'readonly'> extends IDBPCursor { + /** + * The value of the current item. + */ + readonly value: StoreValue; + /** + * Iterate over the cursor. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; +} +declare type IDBPCursorWithValueIteratorValueExtends> = ArrayLike>, StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown, Mode extends IDBTransactionMode = 'readonly'> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; +export interface IDBPCursorWithValueIteratorValue> = ArrayLike>, StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown, Mode extends IDBTransactionMode = 'readonly'> extends IDBPCursorWithValueIteratorValueExtends { + /** + * Advances the cursor a given number of records. + */ + advance(this: T, count: number): void; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): void; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; +} diff --git a/tools/ui/node_modules/idb/build/index.cjs b/tools/ui/node_modules/idb/build/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..64aef745cc59e21fae6375e6d9e6ed4f0d194608 --- /dev/null +++ b/tools/ui/node_modules/idb/build/index.cjs @@ -0,0 +1,101 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var wrapIdbValue = require('./wrap-idb-value.cjs'); + +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +function openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) { + const request = indexedDB.open(name, version); + const openPromise = wrapIdbValue.wrap(request); + if (upgrade) { + request.addEventListener('upgradeneeded', (event) => { + upgrade(wrapIdbValue.wrap(request.result), event.oldVersion, event.newVersion, wrapIdbValue.wrap(request.transaction), event); + }); + } + if (blocked) { + request.addEventListener('blocked', (event) => blocked( + // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405 + event.oldVersion, event.newVersion, event)); + } + openPromise + .then((db) => { + if (terminated) + db.addEventListener('close', () => terminated()); + if (blocking) { + db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event)); + } + }) + .catch(() => { }); + return openPromise; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +function deleteDB(name, { blocked } = {}) { + const request = indexedDB.deleteDatabase(name); + if (blocked) { + request.addEventListener('blocked', (event) => blocked( + // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405 + event.oldVersion, event)); + } + return wrapIdbValue.wrap(request).then(() => undefined); +} + +const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count']; +const writeMethods = ['put', 'add', 'delete', 'clear']; +const cachedMethods = new Map(); +function getMethod(target, prop) { + if (!(target instanceof IDBDatabase && + !(prop in target) && + typeof prop === 'string')) { + return; + } + if (cachedMethods.get(prop)) + return cachedMethods.get(prop); + const targetFuncName = prop.replace(/FromIndex$/, ''); + const useIndex = prop !== targetFuncName; + const isWrite = writeMethods.includes(targetFuncName); + if ( + // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. + !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || + !(isWrite || readMethods.includes(targetFuncName))) { + return; + } + const method = async function (storeName, ...args) { + // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :( + const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly'); + let target = tx.store; + if (useIndex) + target = target.index(args.shift()); + // Must reject if op rejects. + // If it's a write operation, must reject if tx.done rejects. + // Must reject with op rejection first. + // Must resolve with op value. + // Must handle both promises (no unhandled rejections) + return (await Promise.all([ + target[targetFuncName](...args), + isWrite && tx.done, + ]))[0]; + }; + cachedMethods.set(prop, method); + return method; +} +wrapIdbValue.replaceTraps((oldTraps) => ({ + ...oldTraps, + get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), + has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop), +})); + +exports.unwrap = wrapIdbValue.unwrap; +exports.wrap = wrapIdbValue.wrap; +exports.deleteDB = deleteDB; +exports.openDB = openDB; diff --git a/tools/ui/node_modules/idb/build/index.d.ts b/tools/ui/node_modules/idb/build/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de7d8ed475ae61d0adba8682ddbb3cab64e61566 --- /dev/null +++ b/tools/ui/node_modules/idb/build/index.d.ts @@ -0,0 +1,2 @@ +export * from './entry.js'; +import './database-extras.js'; diff --git a/tools/ui/node_modules/idb/build/index.js b/tools/ui/node_modules/idb/build/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d502fd37c981ee7e4772999dbaf2580922c97394 --- /dev/null +++ b/tools/ui/node_modules/idb/build/index.js @@ -0,0 +1,95 @@ +import { w as wrap, r as replaceTraps } from './wrap-idb-value.js'; +export { u as unwrap, w as wrap } from './wrap-idb-value.js'; + +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +function openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) { + const request = indexedDB.open(name, version); + const openPromise = wrap(request); + if (upgrade) { + request.addEventListener('upgradeneeded', (event) => { + upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event); + }); + } + if (blocked) { + request.addEventListener('blocked', (event) => blocked( + // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405 + event.oldVersion, event.newVersion, event)); + } + openPromise + .then((db) => { + if (terminated) + db.addEventListener('close', () => terminated()); + if (blocking) { + db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event)); + } + }) + .catch(() => { }); + return openPromise; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +function deleteDB(name, { blocked } = {}) { + const request = indexedDB.deleteDatabase(name); + if (blocked) { + request.addEventListener('blocked', (event) => blocked( + // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405 + event.oldVersion, event)); + } + return wrap(request).then(() => undefined); +} + +const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count']; +const writeMethods = ['put', 'add', 'delete', 'clear']; +const cachedMethods = new Map(); +function getMethod(target, prop) { + if (!(target instanceof IDBDatabase && + !(prop in target) && + typeof prop === 'string')) { + return; + } + if (cachedMethods.get(prop)) + return cachedMethods.get(prop); + const targetFuncName = prop.replace(/FromIndex$/, ''); + const useIndex = prop !== targetFuncName; + const isWrite = writeMethods.includes(targetFuncName); + if ( + // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. + !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || + !(isWrite || readMethods.includes(targetFuncName))) { + return; + } + const method = async function (storeName, ...args) { + // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :( + const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly'); + let target = tx.store; + if (useIndex) + target = target.index(args.shift()); + // Must reject if op rejects. + // If it's a write operation, must reject if tx.done rejects. + // Must reject with op rejection first. + // Must resolve with op value. + // Must handle both promises (no unhandled rejections) + return (await Promise.all([ + target[targetFuncName](...args), + isWrite && tx.done, + ]))[0]; + }; + cachedMethods.set(prop, method); + return method; +} +replaceTraps((oldTraps) => ({ + ...oldTraps, + get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), + has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop), +})); + +export { deleteDB, openDB }; diff --git a/tools/ui/node_modules/idb/build/umd-with-async-ittr.js b/tools/ui/node_modules/idb/build/umd-with-async-ittr.js new file mode 100644 index 0000000000000000000000000000000000000000..14540cf10bde3cebfa1f797f623da72d5cc3d4d8 --- /dev/null +++ b/tools/ui/node_modules/idb/build/umd-with-async-ittr.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).idb={})}(this,(function(e){"use strict";const t=(e,t)=>t.some((t=>e instanceof t));let n,r;const o=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,c=new WeakMap;let u={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("objectStoreNames"===t)return e.objectStoreNames||i.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return p(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){u=e(u)}function f(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(D(this),t),p(o.get(this))}:function(...t){return p(e.apply(D(this),t))}:function(t,...n){const r=e.call(D(this),t,...n);return i.set(r,t.sort?t.sort():[t]),p(r)}}function l(e){return"function"==typeof e?f(e):(e instanceof IDBTransaction&&function(e){if(s.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));s.set(e,t)}(e),t(e,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,u):e)}function p(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(p(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return t.then((t=>{t instanceof IDBCursor&&o.set(t,e)})).catch((()=>{})),c.set(t,e),t}(e);if(a.has(e))return a.get(e);const t=l(e);return t!==e&&(a.set(e,t),c.set(t,e)),t}const D=e=>c.get(e);const I=["get","getKey","getAll","getAllKeys","count"],b=["put","add","delete","clear"],y=new Map;function B(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(y.get(t))return y.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=b.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!I.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return y.set(t,s),s}d((e=>({...e,get:(t,n,r)=>B(t,n)||e.get(t,n,r),has:(t,n)=>!!B(t,n)||e.has(t,n)})));const g=["continue","continuePrimaryKey","advance"],h={},v=new WeakMap,m=new WeakMap,w={get(e,t){if(!g.includes(t))return e[t];let n=h[t];return n||(n=h[t]=function(...e){v.set(this,m.get(this)[t](...e))}),n}};async function*E(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,w);for(m.set(n,t),c.set(n,D(t));t;)yield n,t=await(v.get(n)||t.continue()),v.delete(n)}function L(e,n){return n===Symbol.asyncIterator&&t(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===n&&t(e,[IDBIndex,IDBObjectStore])}d((e=>({...e,get:(t,n,r)=>L(t,n)?E:e.get(t,n,r),has:(t,n)=>L(t,n)||e.has(t,n)}))),e.deleteDB=function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),p(n).then((()=>{}))},e.openDB=function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=p(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(p(i.result),e.oldVersion,e.newVersion,p(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},e.unwrap=D,e.wrap=p})); diff --git a/tools/ui/node_modules/idb/build/umd.js b/tools/ui/node_modules/idb/build/umd.js new file mode 100644 index 0000000000000000000000000000000000000000..5ae515b7f5870134f578cf8687798345e04b138f --- /dev/null +++ b/tools/ui/node_modules/idb/build/umd.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).idb={})}(this,(function(e){"use strict";let t,n;const r=new WeakMap,o=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap;let c={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return o.get(e);if("objectStoreNames"===t)return e.objectStoreNames||s.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return f(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(l(this),t),f(r.get(this))}:function(...t){return f(e.apply(l(this),t))}:function(t,...n){const r=e.call(l(this),t,...n);return s.set(r,t.sort?t.sort():[t]),f(r)}}function u(e){return"function"==typeof e?d(e):(e instanceof IDBTransaction&&function(e){if(o.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));o.set(e,t)}(e),n=e,(t||(t=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>n instanceof e))?new Proxy(e,c):e);var n}function f(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(f(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return t.then((t=>{t instanceof IDBCursor&&r.set(t,e)})).catch((()=>{})),a.set(t,e),t}(e);if(i.has(e))return i.get(e);const t=u(e);return t!==e&&(i.set(e,t),a.set(t,e)),t}const l=e=>a.get(e);const p=["get","getKey","getAll","getAllKeys","count"],D=["put","add","delete","clear"],b=new Map;function v(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(b.get(t))return b.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=D.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!p.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let i=s.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&s.done]))[0]};return b.set(t,s),s}c=(e=>({...e,get:(t,n,r)=>v(t,n)||e.get(t,n,r),has:(t,n)=>!!v(t,n)||e.has(t,n)}))(c),e.deleteDB=function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),f(n).then((()=>{}))},e.openDB=function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=f(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(f(i.result),e.oldVersion,e.newVersion,f(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},e.unwrap=l,e.wrap=f})); diff --git a/tools/ui/node_modules/idb/build/util.d.ts b/tools/ui/node_modules/idb/build/util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f699a8d10e68a4ea721610374a9c8a4d5c875a86 --- /dev/null +++ b/tools/ui/node_modules/idb/build/util.d.ts @@ -0,0 +1,3 @@ +export declare type Constructor = new (...args: any[]) => any; +export declare type Func = (...args: any[]) => any; +export declare const instanceOfAny: (object: any, constructors: Constructor[]) => boolean; diff --git a/tools/ui/node_modules/idb/build/wrap-idb-value.cjs b/tools/ui/node_modules/idb/build/wrap-idb-value.cjs new file mode 100644 index 0000000000000000000000000000000000000000..b70cde5bd7cbe7b096803c4aabd11f552ec5b1eb --- /dev/null +++ b/tools/ui/node_modules/idb/build/wrap-idb-value.cjs @@ -0,0 +1,191 @@ +'use strict'; + +const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c); + +let idbProxyableTypes; +let cursorAdvanceMethods; +// This is a function to prevent it throwing up in node environments. +function getIdbProxyableTypes() { + return (idbProxyableTypes || + (idbProxyableTypes = [ + IDBDatabase, + IDBObjectStore, + IDBIndex, + IDBCursor, + IDBTransaction, + ])); +} +// This is a function to prevent it throwing up in node environments. +function getCursorAdvanceMethods() { + return (cursorAdvanceMethods || + (cursorAdvanceMethods = [ + IDBCursor.prototype.advance, + IDBCursor.prototype.continue, + IDBCursor.prototype.continuePrimaryKey, + ])); +} +const cursorRequestMap = new WeakMap(); +const transactionDoneMap = new WeakMap(); +const transactionStoreNamesMap = new WeakMap(); +const transformCache = new WeakMap(); +const reverseTransformCache = new WeakMap(); +function promisifyRequest(request) { + const promise = new Promise((resolve, reject) => { + const unlisten = () => { + request.removeEventListener('success', success); + request.removeEventListener('error', error); + }; + const success = () => { + resolve(wrap(request.result)); + unlisten(); + }; + const error = () => { + reject(request.error); + unlisten(); + }; + request.addEventListener('success', success); + request.addEventListener('error', error); + }); + promise + .then((value) => { + // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval + // (see wrapFunction). + if (value instanceof IDBCursor) { + cursorRequestMap.set(value, request); + } + // Catching to avoid "Uncaught Promise exceptions" + }) + .catch(() => { }); + // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This + // is because we create many promises from a single IDBRequest. + reverseTransformCache.set(promise, request); + return promise; +} +function cacheDonePromiseForTransaction(tx) { + // Early bail if we've already created a done promise for this transaction. + if (transactionDoneMap.has(tx)) + return; + const done = new Promise((resolve, reject) => { + const unlisten = () => { + tx.removeEventListener('complete', complete); + tx.removeEventListener('error', error); + tx.removeEventListener('abort', error); + }; + const complete = () => { + resolve(); + unlisten(); + }; + const error = () => { + reject(tx.error || new DOMException('AbortError', 'AbortError')); + unlisten(); + }; + tx.addEventListener('complete', complete); + tx.addEventListener('error', error); + tx.addEventListener('abort', error); + }); + // Cache it for later retrieval. + transactionDoneMap.set(tx, done); +} +let idbProxyTraps = { + get(target, prop, receiver) { + if (target instanceof IDBTransaction) { + // Special handling for transaction.done. + if (prop === 'done') + return transactionDoneMap.get(target); + // Polyfill for objectStoreNames because of Edge. + if (prop === 'objectStoreNames') { + return target.objectStoreNames || transactionStoreNamesMap.get(target); + } + // Make tx.store return the only store in the transaction, or undefined if there are many. + if (prop === 'store') { + return receiver.objectStoreNames[1] + ? undefined + : receiver.objectStore(receiver.objectStoreNames[0]); + } + } + // Else transform whatever we get back. + return wrap(target[prop]); + }, + set(target, prop, value) { + target[prop] = value; + return true; + }, + has(target, prop) { + if (target instanceof IDBTransaction && + (prop === 'done' || prop === 'store')) { + return true; + } + return prop in target; + }, +}; +function replaceTraps(callback) { + idbProxyTraps = callback(idbProxyTraps); +} +function wrapFunction(func) { + // Due to expected object equality (which is enforced by the caching in `wrap`), we + // only create one new func per func. + // Edge doesn't support objectStoreNames (booo), so we polyfill it here. + if (func === IDBDatabase.prototype.transaction && + !('objectStoreNames' in IDBTransaction.prototype)) { + return function (storeNames, ...args) { + const tx = func.call(unwrap(this), storeNames, ...args); + transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); + return wrap(tx); + }; + } + // Cursor methods are special, as the behaviour is a little more different to standard IDB. In + // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the + // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense + // with real promises, so each advance methods returns a new promise for the cursor object, or + // undefined if the end of the cursor has been reached. + if (getCursorAdvanceMethods().includes(func)) { + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + func.apply(unwrap(this), args); + return wrap(cursorRequestMap.get(this)); + }; + } + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + return wrap(func.apply(unwrap(this), args)); + }; +} +function transformCachableValue(value) { + if (typeof value === 'function') + return wrapFunction(value); + // This doesn't return, it just creates a 'done' promise for the transaction, + // which is later returned for transaction.done (see idbObjectHandler). + if (value instanceof IDBTransaction) + cacheDonePromiseForTransaction(value); + if (instanceOfAny(value, getIdbProxyableTypes())) + return new Proxy(value, idbProxyTraps); + // Return the same value back if we're not going to transform it. + return value; +} +function wrap(value) { + // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because + // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached. + if (value instanceof IDBRequest) + return promisifyRequest(value); + // If we've already transformed this value before, reuse the transformed value. + // This is faster, but it also provides object equality. + if (transformCache.has(value)) + return transformCache.get(value); + const newValue = transformCachableValue(value); + // Not all types are transformed. + // These may be primitive types, so they can't be WeakMap keys. + if (newValue !== value) { + transformCache.set(value, newValue); + reverseTransformCache.set(newValue, value); + } + return newValue; +} +const unwrap = (value) => reverseTransformCache.get(value); + +exports.instanceOfAny = instanceOfAny; +exports.replaceTraps = replaceTraps; +exports.reverseTransformCache = reverseTransformCache; +exports.unwrap = unwrap; +exports.wrap = wrap; diff --git a/tools/ui/node_modules/idb/build/wrap-idb-value.d.ts b/tools/ui/node_modules/idb/build/wrap-idb-value.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8d8cd4e1b65dc4fe3f894ac6e9d286dec9d1772 --- /dev/null +++ b/tools/ui/node_modules/idb/build/wrap-idb-value.d.ts @@ -0,0 +1,34 @@ +import { IDBPCursor, IDBPCursorWithValue, IDBPDatabase, IDBPIndex, IDBPObjectStore, IDBPTransaction } from './entry.js'; +export declare const reverseTransformCache: WeakMap; +export declare function replaceTraps(callback: (currentTraps: ProxyHandler) => ProxyHandler): void; +/** + * Enhance an IDB object with helpers. + * + * @param value The thing to enhance. + */ +export declare function wrap(value: IDBDatabase): IDBPDatabase; +export declare function wrap(value: IDBIndex): IDBPIndex; +export declare function wrap(value: IDBObjectStore): IDBPObjectStore; +export declare function wrap(value: IDBTransaction): IDBPTransaction; +export declare function wrap(value: IDBOpenDBRequest): Promise; +export declare function wrap(value: IDBRequest): Promise; +/** + * Revert an enhanced IDB object to a plain old miserable IDB one. + * + * Will also revert a promise back to an IDBRequest. + * + * @param value The enhanced object to revert. + */ +interface Unwrap { + (value: IDBPCursorWithValue): IDBCursorWithValue; + (value: IDBPCursor): IDBCursor; + (value: IDBPDatabase): IDBDatabase; + (value: IDBPIndex): IDBIndex; + (value: IDBPObjectStore): IDBObjectStore; + (value: IDBPTransaction): IDBTransaction; + (value: Promise>): IDBOpenDBRequest; + (value: Promise): IDBOpenDBRequest; + (value: Promise): IDBRequest; +} +export declare const unwrap: Unwrap; +export {}; diff --git a/tools/ui/node_modules/idb/build/wrap-idb-value.js b/tools/ui/node_modules/idb/build/wrap-idb-value.js new file mode 100644 index 0000000000000000000000000000000000000000..7dcbe4c20dd8ac8dd14857cf209d0c8705215820 --- /dev/null +++ b/tools/ui/node_modules/idb/build/wrap-idb-value.js @@ -0,0 +1,185 @@ +const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c); + +let idbProxyableTypes; +let cursorAdvanceMethods; +// This is a function to prevent it throwing up in node environments. +function getIdbProxyableTypes() { + return (idbProxyableTypes || + (idbProxyableTypes = [ + IDBDatabase, + IDBObjectStore, + IDBIndex, + IDBCursor, + IDBTransaction, + ])); +} +// This is a function to prevent it throwing up in node environments. +function getCursorAdvanceMethods() { + return (cursorAdvanceMethods || + (cursorAdvanceMethods = [ + IDBCursor.prototype.advance, + IDBCursor.prototype.continue, + IDBCursor.prototype.continuePrimaryKey, + ])); +} +const cursorRequestMap = new WeakMap(); +const transactionDoneMap = new WeakMap(); +const transactionStoreNamesMap = new WeakMap(); +const transformCache = new WeakMap(); +const reverseTransformCache = new WeakMap(); +function promisifyRequest(request) { + const promise = new Promise((resolve, reject) => { + const unlisten = () => { + request.removeEventListener('success', success); + request.removeEventListener('error', error); + }; + const success = () => { + resolve(wrap(request.result)); + unlisten(); + }; + const error = () => { + reject(request.error); + unlisten(); + }; + request.addEventListener('success', success); + request.addEventListener('error', error); + }); + promise + .then((value) => { + // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval + // (see wrapFunction). + if (value instanceof IDBCursor) { + cursorRequestMap.set(value, request); + } + // Catching to avoid "Uncaught Promise exceptions" + }) + .catch(() => { }); + // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This + // is because we create many promises from a single IDBRequest. + reverseTransformCache.set(promise, request); + return promise; +} +function cacheDonePromiseForTransaction(tx) { + // Early bail if we've already created a done promise for this transaction. + if (transactionDoneMap.has(tx)) + return; + const done = new Promise((resolve, reject) => { + const unlisten = () => { + tx.removeEventListener('complete', complete); + tx.removeEventListener('error', error); + tx.removeEventListener('abort', error); + }; + const complete = () => { + resolve(); + unlisten(); + }; + const error = () => { + reject(tx.error || new DOMException('AbortError', 'AbortError')); + unlisten(); + }; + tx.addEventListener('complete', complete); + tx.addEventListener('error', error); + tx.addEventListener('abort', error); + }); + // Cache it for later retrieval. + transactionDoneMap.set(tx, done); +} +let idbProxyTraps = { + get(target, prop, receiver) { + if (target instanceof IDBTransaction) { + // Special handling for transaction.done. + if (prop === 'done') + return transactionDoneMap.get(target); + // Polyfill for objectStoreNames because of Edge. + if (prop === 'objectStoreNames') { + return target.objectStoreNames || transactionStoreNamesMap.get(target); + } + // Make tx.store return the only store in the transaction, or undefined if there are many. + if (prop === 'store') { + return receiver.objectStoreNames[1] + ? undefined + : receiver.objectStore(receiver.objectStoreNames[0]); + } + } + // Else transform whatever we get back. + return wrap(target[prop]); + }, + set(target, prop, value) { + target[prop] = value; + return true; + }, + has(target, prop) { + if (target instanceof IDBTransaction && + (prop === 'done' || prop === 'store')) { + return true; + } + return prop in target; + }, +}; +function replaceTraps(callback) { + idbProxyTraps = callback(idbProxyTraps); +} +function wrapFunction(func) { + // Due to expected object equality (which is enforced by the caching in `wrap`), we + // only create one new func per func. + // Edge doesn't support objectStoreNames (booo), so we polyfill it here. + if (func === IDBDatabase.prototype.transaction && + !('objectStoreNames' in IDBTransaction.prototype)) { + return function (storeNames, ...args) { + const tx = func.call(unwrap(this), storeNames, ...args); + transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); + return wrap(tx); + }; + } + // Cursor methods are special, as the behaviour is a little more different to standard IDB. In + // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the + // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense + // with real promises, so each advance methods returns a new promise for the cursor object, or + // undefined if the end of the cursor has been reached. + if (getCursorAdvanceMethods().includes(func)) { + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + func.apply(unwrap(this), args); + return wrap(cursorRequestMap.get(this)); + }; + } + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + return wrap(func.apply(unwrap(this), args)); + }; +} +function transformCachableValue(value) { + if (typeof value === 'function') + return wrapFunction(value); + // This doesn't return, it just creates a 'done' promise for the transaction, + // which is later returned for transaction.done (see idbObjectHandler). + if (value instanceof IDBTransaction) + cacheDonePromiseForTransaction(value); + if (instanceOfAny(value, getIdbProxyableTypes())) + return new Proxy(value, idbProxyTraps); + // Return the same value back if we're not going to transform it. + return value; +} +function wrap(value) { + // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because + // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached. + if (value instanceof IDBRequest) + return promisifyRequest(value); + // If we've already transformed this value before, reuse the transformed value. + // This is faster, but it also provides object equality. + if (transformCache.has(value)) + return transformCache.get(value); + const newValue = transformCachableValue(value); + // Not all types are transformed. + // These may be primitive types, so they can't be WeakMap keys. + if (newValue !== value) { + transformCache.set(value, newValue); + reverseTransformCache.set(newValue, value); + } + return newValue; +} +const unwrap = (value) => reverseTransformCache.get(value); + +export { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w }; diff --git a/tools/ui/node_modules/idb/package.json b/tools/ui/node_modules/idb/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3f5be28bc21e778cbbb30ccea947a1e068850779 --- /dev/null +++ b/tools/ui/node_modules/idb/package.json @@ -0,0 +1,58 @@ +{ + "name": "idb", + "version": "7.1.1", + "description": "A small wrapper that makes IndexedDB usable", + "main": "./build/index.cjs", + "module": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "module": "./build/index.js", + "import": "./build/index.js", + "default": "./build/index.cjs" + }, + "./with-async-ittr": { + "types": "./with-async-ittr.d.ts", + "module": "./with-async-ittr.js", + "import": "./with-async-ittr.js", + "default": "./with-async-ittr.cjs" + }, + "./build/*": "./build/*", + "./package.json": "./package.json" + }, + "files": [ + "build/**", + "with-*", + "CHANGELOG.md" + ], + "type": "module", + "scripts": { + "build": "PRODUCTION=1 rollup -c && node --experimental-modules lib/size-report.mjs", + "dev": "rollup -c --watch", + "prepack": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/jakearchibald/idb.git" + }, + "author": "Jake Archibald", + "license": "ISC", + "devDependencies": { + "@rollup/plugin-commonjs": "^22.0.2", + "@rollup/plugin-node-resolve": "^14.1.0", + "@types/chai": "^4.3.3", + "@types/estree": "^1.0.0", + "@types/mocha": "^9.1.1", + "chai": "^4.3.6", + "conditional-type-checks": "^1.0.6", + "del": "^7.0.0", + "filesize": "^9.0.11", + "glob": "^8.0.3", + "mocha": "^10.0.0", + "prettier": "^2.7.1", + "rollup": "^2.79.0", + "rollup-plugin-terser": "^7.0.2", + "typescript": "^4.8.3" + } +} diff --git a/tools/ui/node_modules/idb/with-async-ittr.cjs b/tools/ui/node_modules/idb/with-async-ittr.cjs new file mode 100644 index 0000000000000000000000000000000000000000..fcbbe708bf5e786909c389f99ba372e5b82dc80d --- /dev/null +++ b/tools/ui/node_modules/idb/with-async-ittr.cjs @@ -0,0 +1,2 @@ +module.exports = require('./build/index.cjs'); +require('./build/async-iterators.cjs'); diff --git a/tools/ui/node_modules/idb/with-async-ittr.d.ts b/tools/ui/node_modules/idb/with-async-ittr.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99d2da3b6d9fe3bbc8bdaa683c7b0dabf757481b --- /dev/null +++ b/tools/ui/node_modules/idb/with-async-ittr.d.ts @@ -0,0 +1 @@ +export * from './build/index.js'; diff --git a/tools/ui/node_modules/idb/with-async-ittr.js b/tools/ui/node_modules/idb/with-async-ittr.js new file mode 100644 index 0000000000000000000000000000000000000000..e413be8b7c9e42af112687566e2a564b32a7f100 --- /dev/null +++ b/tools/ui/node_modules/idb/with-async-ittr.js @@ -0,0 +1,2 @@ +export * from './build/index.js'; +import './build/async-iterators.js'; diff --git a/tools/ui/node_modules/ignore/LICENSE-MIT b/tools/ui/node_modules/ignore/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..825533e337fa1d8e6fccfe70318c4abf52600d25 --- /dev/null +++ b/tools/ui/node_modules/ignore/LICENSE-MIT @@ -0,0 +1,21 @@ +Copyright (c) 2013 Kael Zhang , contributors +http://kael.me/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tools/ui/node_modules/ignore/README.md b/tools/ui/node_modules/ignore/README.md new file mode 100644 index 0000000000000000000000000000000000000000..50d88822a9a25f7b1c154bae8c12c8a5bae62a66 --- /dev/null +++ b/tools/ui/node_modules/ignore/README.md @@ -0,0 +1,412 @@ + + + + + + + + + + + + + +
LinuxOS XWindowsCoverageDownloads
+ + Build Status + + + Windows Build Status + + + Coverage Status + + + npm module downloads per month +
+ +# ignore + +`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the [.gitignore spec 2.22.1](http://git-scm.com/docs/gitignore). + +`ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore). + +Pay **ATTENTION** that [`minimatch`](https://www.npmjs.org/package/minimatch) (which used by `fstream-ignore`) does not follow the gitignore spec. + +To filter filenames according to a .gitignore file, I recommend this npm package, `ignore`. + +To parse an `.npmignore` file, you should use `minimatch`, because an `.npmignore` file is parsed by npm using `minimatch` and it does not work in the .gitignore way. + +### Tested on + +`ignore` is fully tested, and has more than **five hundreds** of unit tests. + +- Linux + Node: `0.8` - `7.x` +- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. + +Actually, `ignore` does not rely on any versions of node specially. + +Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). + +## Table Of Main Contents + +- [Usage](#usage) +- [`Pathname` Conventions](#pathname-conventions) +- See Also: + - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. +- [Upgrade Guide](#upgrade-guide) + +## Install + +```sh +npm i ignore +``` + +## Usage + +```js +import ignore from 'ignore' +const ig = ignore().add(['.abc/*', '!.abc/d/']) +``` + +### Filter the given paths + +```js +const paths = [ + '.abc/a.js', // filtered out + '.abc/d/e.js' // included +] + +ig.filter(paths) // ['.abc/d/e.js'] +ig.ignores('.abc/a.js') // true +``` + +### As the filter function + +```js +paths.filter(ig.createFilter()); // ['.abc/d/e.js'] +``` + +### Win32 paths will be handled + +```js +ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) +// if the code above runs on windows, the result will be +// ['.abc\\d\\e.js'] +``` + +## Why another ignore? + +- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. + +- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so + - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. + - `ignore` don't cares about sub-modules of git projects. + +- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: + - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. + - '`**/foo`' should match '`foo`' anywhere. + - Prevent re-including a file if a parent directory of that file is excluded. + - Handle trailing whitespaces: + - `'a '`(one space) should not match `'a '`(two spaces). + - `'a \ '` matches `'a '` + - All test cases are verified with the result of `git check-ignore`. + +# Methods + +## .add(pattern: string | Ignore): this +## .add(patterns: Array): this + +- **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance +- **patterns** `Array` Array of ignore patterns. + +Adds a rule or several rules to the current manager. + +Returns `this` + +Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. + +```js +ignore().add('#abc').ignores('#abc') // false +ignore().add('\\#abc').ignores('#abc') // true +``` + +`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: + +```js +ignore() +.add(fs.readFileSync(filenameOfGitignore).toString()) +.filter(filenames) +``` + +`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. + +## .addIgnoreFile(path) + +REMOVED in `3.x` for now. + +To upgrade `ignore@2.x` up to `3.x`, use + +```js +import fs from 'fs' + +if (fs.existsSync(filename)) { + ignore().add(fs.readFileSync(filename).toString()) +} +``` + +instead. + +## .filter(paths: Array<Pathname>): Array<Pathname> + +```ts +type Pathname = string +``` + +Filters the given array of pathnames, and returns the filtered array. + +- **paths** `Array.` The array of `pathname`s to be filtered. + +### `Pathname` Conventions: + +#### 1. `Pathname` should be a `path.relative()`d pathname + +`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory, + +```js +// WRONG, an error will be thrown +ig.ignores('./abc') + +// WRONG, for it will never happen, and an error will be thrown +// If the gitignore rule locates at the root directory, +// `'/abc'` should be changed to `'abc'`. +// ``` +// path.relative('/', '/abc') -> 'abc' +// ``` +ig.ignores('/abc') + +// WRONG, that it is an absolute path on Windows, an error will be thrown +ig.ignores('C:\\abc') + +// Right +ig.ignores('abc') + +// Right +ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' +``` + +In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. + +Suppose the dir structure is: + +``` +/path/to/your/repo + |-- a + | |-- a.js + | + |-- .b + | + |-- .c + |-- .DS_store +``` + +Then the `paths` might be like this: + +```js +[ + 'a/a.js' + '.b', + '.c/.DS_store' +] +``` + +#### 2. filenames and dirnames + +`node-ignore` does NO `fs.stat` during path matching, so for the example below: + +```js +// First, we add a ignore pattern to ignore a directory +ig.add('config/') + +// `ig` does NOT know if 'config', in the real world, +// is a normal file, directory or something. + +ig.ignores('config') +// `ig` treats `config` as a file, so it returns `false` + +ig.ignores('config/') +// returns `true` +``` + +Specially for people who develop some library based on `node-ignore`, it is important to understand that. + +Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: + +```js +import glob from 'glob' + +glob('**', { + // Adds a / character to directory matches. + mark: true +}, (err, files) => { + if (err) { + return console.error(err) + } + + let filtered = ignore().add(patterns).filter(files) + console.log(filtered) +}) +``` + +## .ignores(pathname: Pathname): boolean + +> new in 3.2.0 + +Returns `Boolean` whether `pathname` should be ignored. + +```js +ig.ignores('.abc/a.js') // true +``` + +## .createFilter() + +Creates a filter function which could filter an array of paths with `Array.prototype.filter`. + +Returns `function(path)` the filter function. + +## .test(pathname: Pathname) since 5.0.0 + +Returns `TestResult` + +```ts +interface TestResult { + ignored: boolean + // true if the `pathname` is finally unignored by some negative pattern + unignored: boolean +} +``` + +- `{ignored: true, unignored: false}`: the `pathname` is ignored +- `{ignored: false, unignored: true}`: the `pathname` is unignored +- `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules. + +## static `ignore.isPathValid(pathname): boolean` since 5.0.0 + +Check whether the `pathname` is an valid `path.relative()`d path according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname). + +This method is **NOT** used to check if an ignore pattern is valid. + +```js +ignore.isPathValid('./foo') // false +``` + +## ignore(options) + +### `options.ignorecase` since 4.0.0 + +Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (the default value), otherwise case sensitive. + +```js +const ig = ignore({ + ignorecase: false +}) + +ig.add('*.png') + +ig.ignores('*.PNG') // false +``` + +### `options.ignoreCase?: boolean` since 5.2.0 + +Which is alternative to `options.ignoreCase` + +### `options.allowRelativePaths?: boolean` since 5.2.0 + +This option brings backward compatibility with projects which based on `ignore@4.x`. If `options.allowRelativePaths` is `true`, `ignore` will not check whether the given path to be tested is [`path.relative()`d](#pathname-conventions). + +However, passing a relative path, such as `'./foo'` or `'../foo'`, to test if it is ignored or not is not a good practise, which might lead to unexpected behavior + +```js +ignore({ + allowRelativePaths: true +}).ignores('../foo/bar.js') // And it will not throw +``` + +**** + +# Upgrade Guide + +## Upgrade 4.x -> 5.x + +Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory. + +While `ignore < 5.0.0` did not make sure what the return value was, as well as + +```ts +.ignores(pathname: Pathname): boolean + +.filter(pathnames: Array): Array + +.createFilter(): (pathname: Pathname) => boolean + +.test(pathname: Pathname): {ignored: boolean, unignored: boolean} +``` + +See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details. + +If there are invalid pathnames, the conversion and filtration should be done by users. + +```js +import {isPathValid} from 'ignore' // introduced in 5.0.0 + +const paths = [ + // invalid + ////////////////// + '', + false, + '../foo', + '.', + ////////////////// + + // valid + 'foo' +] +.filter(isValidPath) + +ig.filter(paths) +``` + +## Upgrade 3.x -> 4.x + +Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: + +```js +var ignore = require('ignore/legacy') +``` + +## Upgrade 2.x -> 3.x + +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. + +**** + +# Collaborators + +- [@whitecolor](https://github.com/whitecolor) *Alex* +- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* +- [@azproduction](https://github.com/azproduction) *Mikhail Davydov* +- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* +- [@JanMattner](https://github.com/JanMattner) *Jan Mattner* +- [@ntwb](https://github.com/ntwb) *Stephen Edgar* +- [@kasperisager](https://github.com/kasperisager) *Kasper Isager* +- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* diff --git a/tools/ui/node_modules/ignore/index.d.ts b/tools/ui/node_modules/ignore/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..970631e266e6d85875c6399b4dd98ec95cf34e4a --- /dev/null +++ b/tools/ui/node_modules/ignore/index.d.ts @@ -0,0 +1,61 @@ +type Pathname = string + +interface TestResult { + ignored: boolean + unignored: boolean +} + +export interface Ignore { + /** + * Adds one or several rules to the current manager. + * @param {string[]} patterns + * @returns IgnoreBase + */ + add(patterns: string | Ignore | readonly (string | Ignore)[]): this + + /** + * Filters the given array of pathnames, and returns the filtered array. + * NOTICE that each path here should be a relative path to the root of your repository. + * @param paths the array of paths to be filtered. + * @returns The filtered array of paths + */ + filter(pathnames: readonly Pathname[]): Pathname[] + + /** + * Creates a filter function which could filter + * an array of paths with Array.prototype.filter. + */ + createFilter(): (pathname: Pathname) => boolean + + /** + * Returns Boolean whether pathname should be ignored. + * @param {string} pathname a path to check + * @returns boolean + */ + ignores(pathname: Pathname): boolean + + /** + * Returns whether pathname should be ignored or unignored + * @param {string} pathname a path to check + * @returns TestResult + */ + test(pathname: Pathname): TestResult +} + +export interface Options { + ignorecase?: boolean + // For compatibility + ignoreCase?: boolean + allowRelativePaths?: boolean +} + +/** + * Creates new ignore manager. + */ +declare function ignore(options?: Options): Ignore + +declare namespace ignore { + export function isPathValid (pathname: string): boolean +} + +export default ignore diff --git a/tools/ui/node_modules/ignore/index.js b/tools/ui/node_modules/ignore/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9f0dbfebda0cd8d9f48ea8fe99380275fd4677dd --- /dev/null +++ b/tools/ui/node_modules/ignore/index.js @@ -0,0 +1,636 @@ +// A simple implementation of make-array +function makeArray (subject) { + return Array.isArray(subject) + ? subject + : [subject] +} + +const EMPTY = '' +const SPACE = ' ' +const ESCAPE = '\\' +const REGEX_TEST_BLANK_LINE = /^\s+$/ +const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/ +const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/ +const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/ +const REGEX_SPLITALL_CRLF = /\r?\n/g +// /foo, +// ./foo, +// ../foo, +// . +// .. +const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/ + +const SLASH = '/' + +// Do not use ternary expression here, since "istanbul ignore next" is buggy +let TMP_KEY_IGNORE = 'node-ignore' +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol.for('node-ignore') +} +const KEY_IGNORE = TMP_KEY_IGNORE + +const define = (object, key, value) => + Object.defineProperty(object, key, {value}) + +const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g + +const RETURN_FALSE = () => false + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +const sanitizeRange = range => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) + ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : EMPTY +) + +// See fixtures #59 +const cleanRangeBackSlash = slashes => { + const {length} = slashes + return slashes.slice(0, length - length % 2) +} + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +const REPLACERS = [ + + [ + // remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], + + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a ) -> (a) + // (a \ ) -> (a ) + /((?:\\\\)*?)(\\?\s+)$/, + (_, m1, m2) => m1 + ( + m2.indexOf('\\') === 0 + ? SPACE + : EMPTY + ) + ], + + // replace (\ ) with ' ' + // (\ ) -> ' ' + // (\\ ) -> '\\ ' + // (\\\ ) -> '\\ ' + [ + /(\\+?)\s/g, + (_, m1) => { + const {length} = m1 + return m1.slice(0, length - length % 2) + SPACE + } + ], + + // Escape metacharacters + // which is written down by users but means special for regular expressions. + + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\$.|*+(){^]/g, + match => `\\${match}` + ], + + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => '[^/]' + ], + + // leading slash + [ + + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => '^' + ], + + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => '\\/' + ], + + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + + // '**/foo' <-> 'foo' + () => '^(?:.*\\/)?' + ], + + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer () { + // If has a slash `/` at the beginning or middle + return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^' + } + ], + + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + + // Check if it is not the last `'/**'` + (_, index, str) => index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+' + ], + + // normal intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + + // 'abc.*/' -> go + // 'abc.*' -> skip this rule, + // coz trailing single wildcard will be handed by [trailing wildcard] + /(^|[^\\]+)(\\\*)+(?=.+)/g, + + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (_, p1, p2) => { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + const unescaped = p2.replace(/\\\*/g, '[^\\/]*') + return p1 + unescaped + } + ], + + [ + // unescape, revert step 3 except for back slash + // For example, if a user escape a '\\*', + // after step 3, the result will be '\\\\\\*' + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + + [ + // '\\\\' -> '\\' + /\\\\/g, + () => ESCAPE + ], + + [ + // > The range notation, e.g. [a-zA-Z], + // > can be used to match one of the characters in a range. + + // `\` is escaped by step 3 + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` + : close === ']' + ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? `[${sanitizeRange(range)}${endEscape}]` + // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' + : '[]' + ], + + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*])$/, + + // WTF! + // https://git-scm.com/docs/gitignore + // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) + // which re-fixes #24, #38 + + // > If there is a separator at the end of the pattern then the pattern + // > will only match directories, otherwise the pattern can match both + // > files and directories. + + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + match => /\/$/.test(match) + // foo/ will not match 'foo' + ? `${match}$` + // foo matches 'foo' and 'foo/' + : `${match}(?=$|\\/$)` + ], + + // trailing wildcard + [ + /(\^|\\\/)?\\\*$/, + (_, p1) => { + const prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' + + return `${prefix}(?=$|\\/$)` + } + ], +] + +// A simple cache, because an ignore rule only has only one certain meaning +const regexCache = Object.create(null) + +// @param {pattern} +const makeRegex = (pattern, ignoreCase) => { + let source = regexCache[pattern] + + if (!source) { + source = REPLACERS.reduce( + (prev, [matcher, replacer]) => + prev.replace(matcher, replacer.bind(pattern)), + pattern + ) + regexCache[pattern] = source + } + + return ignoreCase + ? new RegExp(source, 'i') + : new RegExp(source) +} + +const isString = subject => typeof subject === 'string' + +// > A blank line matches no files, so it can serve as a separator for readability. +const checkPattern = pattern => pattern + && isString(pattern) + && !REGEX_TEST_BLANK_LINE.test(pattern) + && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0 + +const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF) + +class IgnoreRule { + constructor ( + origin, + pattern, + negative, + regex + ) { + this.origin = origin + this.pattern = pattern + this.negative = negative + this.regex = regex + } +} + +const createRule = (pattern, ignoreCase) => { + const origin = pattern + let negative = false + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true + pattern = pattern.substr(1) + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#') + + const regex = makeRegex(pattern, ignoreCase) + + return new IgnoreRule( + origin, + pattern, + negative, + regex + ) +} + +const throwError = (message, Ctor) => { + throw new Ctor(message) +} + +const checkPath = (path, originalPath, doThrow) => { + if (!isString(path)) { + return doThrow( + `path must be a string, but got \`${originalPath}\``, + TypeError + ) + } + + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow(`path must not be empty`, TypeError) + } + + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + const r = '`path.relative()`d' + return doThrow( + `path should be a ${r} string, but got "${originalPath}"`, + RangeError + ) + } + + return true +} + +const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path) + +checkPath.isNotRelative = isNotRelative +checkPath.convert = p => p + +class Ignore { + constructor ({ + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false + } = {}) { + define(this, KEY_IGNORE, true) + + this._rules = [] + this._ignoreCase = ignoreCase + this._allowRelativePaths = allowRelativePaths + this._initCache() + } + + _initCache () { + this._ignoreCache = Object.create(null) + this._testCache = Object.create(null) + } + + _addPattern (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules) + this._added = true + return + } + + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignoreCase) + this._added = true + this._rules.push(rule) + } + } + + // @param {Array | string | Ignore} pattern + add (pattern) { + this._added = false + + makeArray( + isString(pattern) + ? splitPattern(pattern) + : pattern + ).forEach(this._addPattern, this) + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache() + } + + return this + } + + // legacy + addPattern (pattern) { + return this.add(pattern) + } + + // | ignored : unignored + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X + + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen + + // @param {boolean} whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + + // @returns {TestResult} true if a file is ignored + _testOne (path, checkUnignored) { + let ignored = false + let unignored = false + + this._rules.forEach(rule => { + const {negative} = rule + if ( + unignored === negative && ignored !== unignored + || negative && !ignored && !unignored && !checkUnignored + ) { + return + } + + const matched = rule.regex.test(path) + + if (matched) { + ignored = !negative + unignored = negative + } + }) + + return { + ignored, + unignored + } + } + + // @returns {TestResult} + _test (originalPath, cache, checkUnignored, slices) { + const path = originalPath + // Supports nullable path + && checkPath.convert(originalPath) + + checkPath( + path, + originalPath, + this._allowRelativePaths + ? RETURN_FALSE + : throwError + ) + + return this._t(path, cache, checkUnignored, slices) + } + + _t (path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path] + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH) + } + + slices.pop() + + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._testOne(path, checkUnignored) + } + + const parent = this._t( + slices.join(SLASH) + SLASH, + cache, + checkUnignored, + slices + ) + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + ? parent + : this._testOne(path, checkUnignored) + } + + ignores (path) { + return this._test(path, this._ignoreCache, false).ignored + } + + createFilter () { + return path => !this.ignores(path) + } + + filter (paths) { + return makeArray(paths).filter(this.createFilter()) + } + + // @returns {TestResult} + test (path) { + return this._test(path, this._testCache, true) + } +} + +const factory = options => new Ignore(options) + +const isPathValid = path => + checkPath(path && checkPath.convert(path), path, RETURN_FALSE) + +factory.isPathValid = isPathValid + +// Fixes typescript +factory.default = factory + +module.exports = factory + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ +if ( + // Detect `process` so that it can run in browsers. + typeof process !== 'undefined' + && ( + process.env && process.env.IGNORE_TEST_WIN32 + || process.platform === 'win32' + ) +) { + /* eslint no-control-regex: "off" */ + const makePosix = str => /^\\\\\?\\/.test(str) + || /["<>|\u0000-\u001F]+/u.test(str) + ? str + : str.replace(/\\/g, '/') + + checkPath.convert = makePosix + + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i + checkPath.isNotRelative = path => + REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) + || isNotRelative(path) +} diff --git a/tools/ui/node_modules/ignore/legacy.js b/tools/ui/node_modules/ignore/legacy.js new file mode 100644 index 0000000000000000000000000000000000000000..de3f66ce89151854cf3269eabf3080a6398c93f0 --- /dev/null +++ b/tools/ui/node_modules/ignore/legacy.js @@ -0,0 +1,559 @@ +"use strict"; + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +// A simple implementation of make-array +function makeArray(subject) { + return Array.isArray(subject) ? subject : [subject]; +} +var EMPTY = ''; +var SPACE = ' '; +var ESCAPE = '\\'; +var REGEX_TEST_BLANK_LINE = /^\s+$/; +var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; +var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; +var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; +var REGEX_SPLITALL_CRLF = /\r?\n/g; +// /foo, +// ./foo, +// ../foo, +// . +// .. +var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; +var SLASH = '/'; + +// Do not use ternary expression here, since "istanbul ignore next" is buggy +var TMP_KEY_IGNORE = 'node-ignore'; +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol["for"]('node-ignore'); +} +var KEY_IGNORE = TMP_KEY_IGNORE; +var define = function define(object, key, value) { + return Object.defineProperty(object, key, { + value: value + }); +}; +var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; +var RETURN_FALSE = function RETURN_FALSE() { + return false; +}; + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +var sanitizeRange = function sanitizeRange(range) { + return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) { + return from.charCodeAt(0) <= to.charCodeAt(0) ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : EMPTY; + }); +}; + +// See fixtures #59 +var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) { + var length = slashes.length; + return slashes.slice(0, length - length % 2); +}; + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +var REPLACERS = [[ +// remove BOM +// TODO: +// Other similar zero-width characters? +/^\uFEFF/, function () { + return EMPTY; +}], +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a ) -> (a) +// (a \ ) -> (a ) +/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) { + return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY); +}], +// replace (\ ) with ' ' +// (\ ) -> ' ' +// (\\ ) -> '\\ ' +// (\\\ ) -> '\\ ' +[/(\\+?)\s/g, function (_, m1) { + var length = m1.length; + return m1.slice(0, length - length % 2) + SPACE; +}], +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\$.|*+(){^]/g, function (match) { + return "\\".concat(match); +}], [ +// > a question mark (?) matches a single character +/(?!\\)\?/g, function () { + return '[^/]'; +}], +// leading slash +[ +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly +// > under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, +// '**/foo' <-> 'foo' +function () { + return '^(?:.*\\/)?'; +}], +// starting +[ +// there will be no leading '/' +// (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^^])/, function startingReplacer() { + // If has a slash `/` at the beginning or middle + return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^'; +}], +// two globstars +[ +// Use lookahead assertions so that we could match more than one `'/**'` +/\\\/\\\*\\\*(?=\\\/|$)/g, +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer + +// Check if it is not the last `'/**'` +function (_, index, str) { + return index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+'; +}], +// normal intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule, +// coz trailing single wildcard will be handed by [trailing wildcard] +/(^|[^\\]+)(\\\*)+(?=.+)/g, +// '*.js' matches '.js' +// '*.js' doesn't match 'abc' +function (_, p1, p2) { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + var unescaped = p2.replace(/\\\*/g, '[^\\/]*'); + return p1 + unescaped; +}], [ +// unescape, revert step 3 except for back slash +// For example, if a user escape a '\\*', +// after step 3, the result will be '\\\\\\*' +/\\\\\\(?=[$.|*+(){^])/g, function () { + return ESCAPE; +}], [ +// '\\\\' -> '\\' +/\\\\/g, function () { + return ESCAPE; +}], [ +// > The range notation, e.g. [a-zA-Z], +// > can be used to match one of the characters in a range. + +// `\` is escaped by step 3 +/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) { + return leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' : '[]'; +}], +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*])$/, +// WTF! +// https://git-scm.com/docs/gitignore +// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) +// which re-fixes #24, #38 + +// > If there is a separator at the end of the pattern then the pattern +// > will only match directories, otherwise the pattern can match both +// > files and directories. + +// 'js*' will not match 'a.js' +// 'js/' will not match 'a.js' +// 'js' will match 'a.js' and 'a.js/' +function (match) { + return /\/$/.test(match) + // foo/ will not match 'foo' + ? "".concat(match, "$") // foo matches 'foo' and 'foo/' + : "".concat(match, "(?=$|\\/$)"); +}], +// trailing wildcard +[/(\^|\\\/)?\\\*$/, function (_, p1) { + var prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? "".concat(p1, "[^/]+") // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + return "".concat(prefix, "(?=$|\\/$)"); +}]]; + +// A simple cache, because an ignore rule only has only one certain meaning +var regexCache = Object.create(null); + +// @param {pattern} +var makeRegex = function makeRegex(pattern, ignoreCase) { + var source = regexCache[pattern]; + if (!source) { + source = REPLACERS.reduce(function (prev, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + matcher = _ref2[0], + replacer = _ref2[1]; + return prev.replace(matcher, replacer.bind(pattern)); + }, pattern); + regexCache[pattern] = source; + } + return ignoreCase ? new RegExp(source, 'i') : new RegExp(source); +}; +var isString = function isString(subject) { + return typeof subject === 'string'; +}; + +// > A blank line matches no files, so it can serve as a separator for readability. +var checkPattern = function checkPattern(pattern) { + return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; +}; +var splitPattern = function splitPattern(pattern) { + return pattern.split(REGEX_SPLITALL_CRLF); +}; +var IgnoreRule = /*#__PURE__*/_createClass(function IgnoreRule(origin, pattern, negative, regex) { + _classCallCheck(this, IgnoreRule); + this.origin = origin; + this.pattern = pattern; + this.negative = negative; + this.regex = regex; +}); +var createRule = function createRule(pattern, ignoreCase) { + var origin = pattern; + var negative = false; + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true; + pattern = pattern.substr(1); + } + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#'); + var regex = makeRegex(pattern, ignoreCase); + return new IgnoreRule(origin, pattern, negative, regex); +}; +var throwError = function throwError(message, Ctor) { + throw new Ctor(message); +}; +var checkPath = function checkPath(path, originalPath, doThrow) { + if (!isString(path)) { + return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError); + } + + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow("path must not be empty", TypeError); + } + + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + var r = '`path.relative()`d'; + return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError); + } + return true; +}; +var isNotRelative = function isNotRelative(path) { + return REGEX_TEST_INVALID_PATH.test(path); +}; +checkPath.isNotRelative = isNotRelative; +checkPath.convert = function (p) { + return p; +}; +var Ignore = /*#__PURE__*/function () { + function Ignore() { + var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref3$ignorecase = _ref3.ignorecase, + ignorecase = _ref3$ignorecase === void 0 ? true : _ref3$ignorecase, + _ref3$ignoreCase = _ref3.ignoreCase, + ignoreCase = _ref3$ignoreCase === void 0 ? ignorecase : _ref3$ignoreCase, + _ref3$allowRelativePa = _ref3.allowRelativePaths, + allowRelativePaths = _ref3$allowRelativePa === void 0 ? false : _ref3$allowRelativePa; + _classCallCheck(this, Ignore); + define(this, KEY_IGNORE, true); + this._rules = []; + this._ignoreCase = ignoreCase; + this._allowRelativePaths = allowRelativePaths; + this._initCache(); + } + _createClass(Ignore, [{ + key: "_initCache", + value: function _initCache() { + this._ignoreCache = Object.create(null); + this._testCache = Object.create(null); + } + }, { + key: "_addPattern", + value: function _addPattern(pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + if (checkPattern(pattern)) { + var rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } + } + + // @param {Array | string | Ignore} pattern + }, { + key: "add", + value: function add(pattern) { + this._added = false; + makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this); + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache(); + } + return this; + } + + // legacy + }, { + key: "addPattern", + value: function addPattern(pattern) { + return this.add(pattern); + } + + // | ignored : unignored + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X + + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen + + // @param {boolean} whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + + // @returns {TestResult} true if a file is ignored + }, { + key: "_testOne", + value: function _testOne(path, checkUnignored) { + var ignored = false; + var unignored = false; + this._rules.forEach(function (rule) { + var negative = rule.negative; + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + var matched = rule.regex.test(path); + if (matched) { + ignored = !negative; + unignored = negative; + } + }); + return { + ignored: ignored, + unignored: unignored + }; + } + + // @returns {TestResult} + }, { + key: "_test", + value: function _test(originalPath, cache, checkUnignored, slices) { + var path = originalPath + // Supports nullable path + && checkPath.convert(originalPath); + checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError); + return this._t(path, cache, checkUnignored, slices); + } + }, { + key: "_t", + value: function _t(path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path]; + } + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH); + } + slices.pop(); + + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._testOne(path, checkUnignored); + } + var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + ? parent : this._testOne(path, checkUnignored); + } + }, { + key: "ignores", + value: function ignores(path) { + return this._test(path, this._ignoreCache, false).ignored; + } + }, { + key: "createFilter", + value: function createFilter() { + var _this = this; + return function (path) { + return !_this.ignores(path); + }; + } + }, { + key: "filter", + value: function filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } + + // @returns {TestResult} + }, { + key: "test", + value: function test(path) { + return this._test(path, this._testCache, true); + } + }]); + return Ignore; +}(); +var factory = function factory(options) { + return new Ignore(options); +}; +var isPathValid = function isPathValid(path) { + return checkPath(path && checkPath.convert(path), path, RETURN_FALSE); +}; +factory.isPathValid = isPathValid; + +// Fixes typescript +factory["default"] = factory; +module.exports = factory; + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ +if ( +// Detect `process` so that it can run in browsers. +typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { + /* eslint no-control-regex: "off" */ + var makePosix = function makePosix(str) { + return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/'); + }; + checkPath.convert = makePosix; + + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + var REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = function (path) { + return REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path); + }; +} diff --git a/tools/ui/node_modules/ignore/package.json b/tools/ui/node_modules/ignore/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b7f684e98b5bd90035f08415c3187be330d43b52 --- /dev/null +++ b/tools/ui/node_modules/ignore/package.json @@ -0,0 +1,74 @@ +{ + "name": "ignore", + "version": "5.3.2", + "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.", + "files": [ + "legacy.js", + "index.js", + "index.d.ts", + "LICENSE-MIT" + ], + "scripts": { + "prepublishOnly": "npm run build", + "build": "babel -o legacy.js index.js", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts --lib ES6", + "test:ts": "node ./test/ts/simple.js", + "tap": "tap --reporter classic", + "test:git": "npm run tap test/git-check-ignore.js", + "test:ignore": "npm run tap test/ignore.js", + "test:ignore:only": "IGNORE_ONLY_IGNORES=1 npm run tap test/ignore.js", + "test:others": "npm run tap test/others.js", + "test:cases": "npm run tap test/*.js -- --coverage", + "test:no-coverage": "npm run tap test/*.js -- --no-check-coverage", + "test:only": "npm run test:lint && npm run test:tsc && npm run test:ts && npm run test:cases", + "test": "npm run test:only", + "test:win32": "IGNORE_TEST_WIN32=1 npm run test", + "report": "tap --coverage-report=html", + "posttest": "npm run report && codecov" + }, + "repository": { + "type": "git", + "url": "git@github.com:kaelzhang/node-ignore.git" + }, + "keywords": [ + "ignore", + ".gitignore", + "gitignore", + "npmignore", + "rules", + "manager", + "filter", + "regexp", + "regex", + "fnmatch", + "glob", + "asterisks", + "regular-expression" + ], + "author": "kael", + "license": "MIT", + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "devDependencies": { + "@babel/cli": "^7.22.9", + "@babel/core": "^7.22.9", + "@babel/preset-env": "^7.22.9", + "codecov": "^3.8.2", + "debug": "^4.3.4", + "eslint": "^8.46.0", + "eslint-config-ostai": "^3.0.0", + "eslint-plugin-import": "^2.28.0", + "mkdirp": "^3.0.1", + "pre-suf": "^1.1.1", + "rimraf": "^6.0.1", + "spawn-sync": "^2.0.0", + "tap": "^16.3.9", + "tmp": "0.2.3", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">= 4" + } +} diff --git a/tools/ui/node_modules/immutable/LICENSE b/tools/ui/node_modules/immutable/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1e3c4f39c0e70dfb4ebf2cf7e29a6048a42e0a86 --- /dev/null +++ b/tools/ui/node_modules/immutable/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2014-present, Lee Byron and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/immutable/README.md b/tools/ui/node_modules/immutable/README.md new file mode 100644 index 0000000000000000000000000000000000000000..76cda05a5aa3917a48cc7304a17326063f6f3935 --- /dev/null +++ b/tools/ui/node_modules/immutable/README.md @@ -0,0 +1,731 @@ +# Immutable collections for JavaScript + +[![Build Status](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com) + +[Read the docs](https://immutable-js.com/docs/) and eat your vegetables. + +Docs are automatically generated from [README.md][] and [immutable.d.ts][]. +Please contribute! Also, don't miss the [wiki][] which contains articles on +additional specific topics. Can't find something? Open an [issue][]. + +**Table of contents:** + +- [Introduction](#introduction) +- [Getting started](#getting-started) +- [The case for Immutability](#the-case-for-immutability) +- [JavaScript-first API](#javascript-first-api) +- [Nested Structures](#nested-structures) +- [Equality treats Collections as Values](#equality-treats-collections-as-values) +- [Batching Mutations](#batching-mutations) +- [Lazy Seq](#lazy-seq) +- [Additional Tools and Resources](#additional-tools-and-resources) +- [Contributing](#contributing) + +## Introduction + +[Immutable][] data cannot be changed once created, leading to much simpler +application development, no defensive copying, and enabling advanced memoization +and change detection techniques with simple logic. [Persistent][] data presents +a mutative API which does not update the data in-place, but instead always +yields new updated data. + +Immutable.js provides many Persistent Immutable data structures including: +`List`, `Stack`, `Map`, `OrderedMap`, `Set`, `OrderedSet` and `Record`. + +These data structures are highly efficient on modern JavaScript VMs by using +structural sharing via [hash maps tries][] and [vector tries][] as popularized +by Clojure and Scala, minimizing the need to copy or cache data. + +Immutable.js also provides a lazy `Seq`, allowing efficient +chaining of collection methods like `map` and `filter` without creating +intermediate representations. Create some `Seq` with `Range` and `Repeat`. + +Want to hear more? Watch the presentation about Immutable.js: + +[![Immutable Data and React](website/public/Immutable-Data-and-React-YouTube.png)](https://youtu.be/I7IdS-PbEgI) + +[README.md]: https://github.com/immutable-js/immutable-js/blob/main/README.md +[immutable.d.ts]: https://github.com/immutable-js/immutable-js/blob/main/type-definitions/immutable.d.ts +[wiki]: https://github.com/immutable-js/immutable-js/wiki +[issue]: https://github.com/immutable-js/immutable-js/issues +[Persistent]: https://en.wikipedia.org/wiki/Persistent_data_structure +[Immutable]: https://en.wikipedia.org/wiki/Immutable_object +[hash maps tries]: https://en.wikipedia.org/wiki/Hash_array_mapped_trie +[vector tries]: https://hypirion.com/musings/understanding-persistent-vector-pt-1 + +## Getting started + +Install `immutable` using npm. + +```shell +# using npm +npm install immutable + +# using Yarn +yarn add immutable + +# using pnpm +pnpm add immutable + +# using Bun +bun add immutable +``` + +Then require it into any module. + +```js +import { Map } from 'immutable'; +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 50); +map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50 +``` + +### Browser + +Immutable.js has no dependencies, which makes it predictable to include in a Browser. + +It's highly recommended to use a module bundler like [webpack](https://webpack.js.org/), +[rollup](https://rollupjs.org/), or +[browserify](https://browserify.org/). The `immutable` npm module works +without any additional consideration. All examples throughout the documentation +will assume use of this kind of tool. + +Alternatively, Immutable.js may be directly included as a script tag. Download +or link to a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable) +or [jsDelivr](https://www.jsdelivr.com/package/npm/immutable). + +Use a script tag to directly add `Immutable` to the global scope: + +```html + + +``` + +Or use an AMD-style loader (such as [RequireJS](https://requirejs.org/)): + +```js +require(['./immutable.min.js'], function (Immutable) { + var map1 = Immutable.Map({ a: 1, b: 2, c: 3 }); + var map2 = map1.set('b', 50); + map1.get('b'); // 2 + map2.get('b'); // 50 +}); +``` + +### Flow & TypeScript + +Use these Immutable collections and sequences as you would use native +collections in your [Flowtype](https://flowtype.org/) or [TypeScript](https://typescriptlang.org) programs while still taking +advantage of type generics, error detection, and auto-complete in your IDE. + +Installing `immutable` via npm brings with it type definitions for Flow (v0.55.0 or higher) +and TypeScript (v4.5 or higher), so you shouldn't need to do anything at all! + +#### Using TypeScript with Immutable.js v4+ + +Immutable.js type definitions embrace ES2015. While Immutable.js itself supports +legacy browsers and environments, its type definitions require TypeScript's 2015 +lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your +`tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the +`tsc` command. + +```js +import { Map } from 'immutable'; +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 50); +map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50 +``` + +#### Using TypeScript with Immutable.js v3 and earlier: + +Previous versions of Immutable.js include a reference file which you can include +via relative path to the type definitions at the top of your file. + +```js +/// +import { Map } from 'immutable'; +var map1: Map; +map1 = Map({ a: 1, b: 2, c: 3 }); +var map2 = map1.set('b', 50); +map1.get('b'); // 2 +map2.get('b'); // 50 +``` + +## The case for Immutability + +Much of what makes application development difficult is tracking mutation and +maintaining state. Developing with immutable data encourages you to think +differently about how data flows through your application. + +Subscribing to data events throughout your application creates a huge overhead of +book-keeping which can hurt performance, sometimes dramatically, and creates +opportunities for areas of your application to get out of sync with each other +due to easy to make programmer error. Since immutable data never changes, +subscribing to changes throughout the model is a dead-end and new data can only +ever be passed from above. + +This model of data flow aligns well with the architecture of [React][] +and especially well with an application designed using the ideas of [Flux][]. + +When data is passed from above rather than being subscribed to, and you're only +interested in doing work when something has changed, you can use equality. + +Immutable collections should be treated as _values_ rather than _objects_. While +objects represent some thing which could change over time, a value represents +the state of that thing at a particular instance of time. This principle is most +important to understanding the appropriate use of immutable data. In order to +treat Immutable.js collections as values, it's important to use the +`Immutable.is()` function or `.equals()` method to determine _value equality_ +instead of the `===` operator which determines object _reference identity_. + +```js +import { Map } from 'immutable'; +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +map1.equals(map2); // true +map1 === map2; // false +``` + +Note: As a performance optimization Immutable.js attempts to return the existing +collection when an operation would result in an identical collection, allowing +for using `===` reference equality to determine if something definitely has not +changed. This can be extremely useful when used within a memoization function +which would prefer to re-run the function if a deeper equality check could +potentially be more costly. The `===` equality check is also used internally by +`Immutable.is` and `.equals()` as a performance optimization. + +```js +import { Map } from 'immutable'; +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 2); // Set to same value +map1 === map2; // true +``` + +If an object is immutable, it can be "copied" simply by making another reference +to it instead of copying the entire object. Because a reference is much smaller +than the object itself, this results in memory savings and a potential boost in +execution speed for programs which rely on copies (such as an undo-stack). + +```js +import { Map } from 'immutable'; +const map = Map({ a: 1, b: 2, c: 3 }); +const mapCopy = map; // Look, "copies" are free! +``` + +[React]: https://reactjs.org/ +[Flux]: https://facebook.github.io/flux/docs/in-depth-overview/ + +## JavaScript-first API + +While Immutable.js is inspired by Clojure, Scala, Haskell and other functional +programming environments, it's designed to bring these powerful concepts to +JavaScript, and therefore has an Object-Oriented API that closely mirrors that +of [ES2015][] [Array][], [Map][], and [Set][]. + +[es2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla +[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array +[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map +[set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set + +The difference for the immutable collections is that methods which would mutate +the collection, like `push`, `set`, `unshift` or `splice`, instead return a new +immutable collection. Methods which return new arrays, like `slice` or `concat`, +instead return new immutable collections. + +```js +import { List } from 'immutable'; +const list1 = List([1, 2]); +const list2 = list1.push(3, 4, 5); +const list3 = list2.unshift(0); +const list4 = list1.concat(list2, list3); +assert.equal(list1.size, 2); +assert.equal(list2.size, 5); +assert.equal(list3.size, 6); +assert.equal(list4.size, 13); +assert.equal(list4.get(0), 1); +``` + +Almost all of the methods on [Array][] will be found in similar form on +`Immutable.List`, those of [Map][] found on `Immutable.Map`, and those of [Set][] +found on `Immutable.Set`, including collection operations like `forEach()` +and `map()`. + +```js +import { Map } from 'immutable'; +const alpha = Map({ a: 1, b: 2, c: 3, d: 4 }); +alpha.map((v, k) => k.toUpperCase()).join(); +// 'A,B,C,D' +``` + +### Convert from raw JavaScript objects and arrays. + +Designed to inter-operate with your existing JavaScript, Immutable.js +accepts plain JavaScript Arrays and Objects anywhere a method expects a +`Collection`. + +```js +import { Map, List } from 'immutable'; +const map1 = Map({ a: 1, b: 2, c: 3, d: 4 }); +const map2 = Map({ c: 10, a: 20, t: 30 }); +const obj = { d: 100, o: 200, g: 300 }; +const map3 = map1.merge(map2, obj); +// Map { a: 20, b: 2, c: 10, d: 100, t: 30, o: 200, g: 300 } +const list1 = List([1, 2, 3]); +const list2 = List([4, 5, 6]); +const array = [7, 8, 9]; +const list3 = list1.concat(list2, array); +// List [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] +``` + +This is possible because Immutable.js can treat any JavaScript Array or Object +as a Collection. You can take advantage of this in order to get sophisticated +collection methods on JavaScript Objects, which otherwise have a very sparse +native API. Because Seq evaluates lazily and does not cache intermediate +results, these operations can be extremely efficient. + +```js +import { Seq } from 'immutable'; +const myObject = { a: 1, b: 2, c: 3 }; +Seq(myObject) + .map((x) => x * x) + .toObject(); +// { a: 1, b: 4, c: 9 } +``` + +Keep in mind, when using JS objects to construct Immutable Maps, that +JavaScript Object properties are always strings, even if written in a quote-less +shorthand, while Immutable Maps accept keys of any type. + +```js +import { fromJS } from 'immutable'; + +const obj = { 1: 'one' }; +console.log(Object.keys(obj)); // [ "1" ] +console.log(obj['1'], obj[1]); // "one", "one" + +const map = fromJS(obj); +console.log(map.get('1'), map.get(1)); // "one", undefined +``` + +Property access for JavaScript Objects first converts the key to a string, but +since Immutable Map keys can be of any type the argument to `get()` is +not altered. + +### Converts back to raw JavaScript objects. + +All Immutable.js Collections can be converted to plain JavaScript Arrays and +Objects shallowly with `toArray()` and `toObject()` or deeply with `toJS()`. +All Immutable Collections also implement `toJSON()` allowing them to be passed +to `JSON.stringify` directly. They also respect the custom `toJSON()` methods of +nested objects. + +```js +import { Map, List } from 'immutable'; +const deep = Map({ a: 1, b: 2, c: List([3, 4, 5]) }); +console.log(deep.toObject()); // { a: 1, b: 2, c: List [ 3, 4, 5 ] } +console.log(deep.toArray()); // [ 1, 2, List [ 3, 4, 5 ] ] +console.log(deep.toJS()); // { a: 1, b: 2, c: [ 3, 4, 5 ] } +JSON.stringify(deep); // '{"a":1,"b":2,"c":[3,4,5]}' +``` + +### Embraces ES2015 + +Immutable.js supports all JavaScript environments, including legacy +browsers (even IE11). However it also takes advantage of features added to +JavaScript in [ES2015][], the latest standard version of JavaScript, including +[Iterators][], [Arrow Functions][], [Classes][], and [Modules][]. It's inspired +by the native [Map][] and [Set][] collections added to ES2015. + +All examples in the Documentation are presented in ES2015. To run in all +browsers, they need to be translated to ES5. + +```js +// ES2015 +const mapped = foo.map((x) => x * x); +// ES5 +var mapped = foo.map(function (x) { + return x * x; +}); +``` + +All Immutable.js collections are [Iterable][iterators], which allows them to be +used anywhere an Iterable is expected, such as when spreading into an Array. + +```js +import { List } from 'immutable'; +const aList = List([1, 2, 3]); +const anArray = [0, ...aList, 4, 5]; // [ 0, 1, 2, 3, 4, 5 ] +``` + +Note: A Collection is always iterated in the same order, however that order may +not always be well defined, as is the case for the `Map` and `Set`. + +[Iterators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol +[Arrow Functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions +[Classes]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes +[Modules]: https://www.2ality.com/2014/09/es6-modules-final.html + +## Nested Structures + +The collections in Immutable.js are intended to be nested, allowing for deep +trees of data, similar to JSON. + +```js +import { fromJS } from 'immutable'; +const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); +// Map { a: Map { b: Map { c: List [ 3, 4, 5 ] } } } +``` + +A few power-tools allow for reading and operating on nested data. The +most useful are `mergeDeep`, `getIn`, `setIn`, and `updateIn`, found on `List`, +`Map` and `OrderedMap`. + +```js +import { fromJS } from 'immutable'; +const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); + +const nested2 = nested.mergeDeep({ a: { b: { d: 6 } } }); +// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 6 } } } + +console.log(nested2.getIn(['a', 'b', 'd'])); // 6 + +const nested3 = nested2.updateIn(['a', 'b', 'd'], (value) => value + 1); +console.log(nested3); +// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } } + +const nested4 = nested3.updateIn(['a', 'b', 'c'], (list) => list.push(6)); +// Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } } +``` + +## Equality treats Collections as Values + +Immutable.js collections are treated as pure data _values_. Two immutable +collections are considered _value equal_ (via `.equals()` or `is()`) if they +represent the same collection of values. This differs from JavaScript's typical +_reference equal_ (via `===` or `==`) for Objects and Arrays which only +determines if two variables represent references to the same object instance. + +Consider the example below where two identical `Map` instances are not +_reference equal_ but are _value equal_. + +```js +// First consider: +const obj1 = { a: 1, b: 2, c: 3 }; +const obj2 = { a: 1, b: 2, c: 3 }; +obj1 !== obj2; // two different instances are always not equal with === + +import { Map, is } from 'immutable'; +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +map1 !== map2; // two different instances are not reference-equal +map1.equals(map2); // but are value-equal if they have the same values +is(map1, map2); // alternatively can use the is() function +``` + +Value equality allows Immutable.js collections to be used as keys in Maps or +values in Sets, and retrieved with different but equivalent collections: + +```js +import { Map, Set } from 'immutable'; +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +const set = Set().add(map1); +set.has(map2); // true because these are value-equal +``` + +Note: `is()` uses the same measure of equality as [Object.is][] for scalar +strings and numbers, but uses value equality for Immutable collections, +determining if both are immutable and all keys and values are equal +using the same measure of equality. + +[object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + +#### Performance tradeoffs + +While value equality is useful in many circumstances, it has different +performance characteristics than reference equality. Understanding these +tradeoffs may help you decide which to use in each case, especially when used +to memoize some operation. + +When comparing two collections, value equality may require considering every +item in each collection, on an `O(N)` time complexity. For large collections of +values, this could become a costly operation. Though if the two are not equal +and hardly similar, the inequality is determined very quickly. In contrast, when +comparing two collections with reference equality, only the initial references +to memory need to be compared which is not based on the size of the collections, +which has an `O(1)` time complexity. Checking reference equality is always very +fast, however just because two collections are not reference-equal does not rule +out the possibility that they may be value-equal. + +#### Return self on no-op optimization + +When possible, Immutable.js avoids creating new objects for updates where no +change in _value_ occurred, to allow for efficient _reference equality_ checking +to quickly determine if no change occurred. + +```js +import { Map } from 'immutable'; +const originalMap = Map({ a: 1, b: 2, c: 3 }); +const updatedMap = originalMap.set('b', 2); +updatedMap === originalMap; // No-op .set() returned the original reference. +``` + +However updates which do result in a change will return a new reference. Each +of these operations occur independently, so two similar updates will not return +the same reference: + +```js +import { Map } from 'immutable'; +const originalMap = Map({ a: 1, b: 2, c: 3 }); +const updatedMap = originalMap.set('b', 1000); +// New instance, leaving the original immutable. +updatedMap !== originalMap; +const anotherUpdatedMap = originalMap.set('b', 1000); +// Despite both the results of the same operation, each created a new reference. +anotherUpdatedMap !== updatedMap; +// However the two are value equal. +anotherUpdatedMap.equals(updatedMap); +``` + +## Batching Mutations + +> If a tree falls in the woods, does it make a sound? +> +> If a pure function mutates some local data in order to produce an immutable +> return value, is that ok? +> +> — Rich Hickey, Clojure + +Applying a mutation to create a new immutable object results in some overhead, +which can add up to a minor performance penalty. If you need to apply a series +of mutations locally before returning, Immutable.js gives you the ability to +create a temporary mutable (transient) copy of a collection and apply a batch of +mutations in a performant manner by using `withMutations`. In fact, this is +exactly how Immutable.js applies complex mutations itself. + +As an example, building `list2` results in the creation of 1, not 3, new +immutable Lists. + +```js +import { List } from 'immutable'; +const list1 = List([1, 2, 3]); +const list2 = list1.withMutations(function (list) { + list.push(4).push(5).push(6); +}); +assert.equal(list1.size, 3); +assert.equal(list2.size, 6); +``` + +Note: Immutable.js also provides `asMutable` and `asImmutable`, but only +encourages their use when `withMutations` will not suffice. Use caution to not +return a mutable copy, which could result in undesired behavior. + +_Important!_: Only a select few methods can be used in `withMutations` including +`set`, `push` and `pop`. These methods can be applied directly against a +persistent data-structure where other methods like `map`, `filter`, `sort`, +and `splice` will always return new immutable data-structures and never mutate +a mutable collection. + +## Lazy Seq + +`Seq` describes a lazy operation, allowing them to efficiently chain +use of all the higher-order collection methods (such as `map` and `filter`) +by not creating intermediate collections. + +**Seq is immutable** — Once a Seq is created, it cannot be +changed, appended to, rearranged or otherwise modified. Instead, any mutative +method called on a `Seq` will return a new `Seq`. + +**Seq is lazy** — `Seq` does as little work as necessary to respond to any +method call. Values are often created during iteration, including implicit +iteration when reducing or converting to a concrete data structure such as +a `List` or JavaScript `Array`. + +For example, the following performs no work, because the resulting +`Seq`'s values are never iterated: + +```js +import { Seq } from 'immutable'; +const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8]) + .filter((x) => x % 2 !== 0) + .map((x) => x * x); +``` + +Once the `Seq` is used, it performs only the work necessary. In this +example, no intermediate arrays are ever created, filter is called three +times, and map is only called once: + +```js +oddSquares.get(1); // 9 +``` + +Any collection can be converted to a lazy Seq with `Seq()`. + +```js +import { Map, Seq } from 'immutable'; +const map = Map({ a: 1, b: 2, c: 3 }); +const lazySeq = Seq(map); +``` + +`Seq` allows for the efficient chaining of operations, allowing for the +expression of logic that can otherwise be very tedious: + +```js +lazySeq + .flip() + .map((key) => key.toUpperCase()) + .flip(); +// Seq { A: 1, B: 2, C: 3 } +``` + +As well as expressing logic that would otherwise seem memory or time +limited, for example `Range` is a special kind of Lazy sequence. + +```js +import { Range } from 'immutable'; +Range(1, Infinity) + .skip(1000) + .map((n) => -n) + .filter((n) => n % 2 === 0) + .take(2) + .reduce((r, n) => r * n, 1); +// 1006008 +``` + +## Comparison of filter(), groupBy(), and partition() + +The `filter()`, `groupBy()`, and `partition()` methods are similar in that they +all divide a collection into parts based on applying a function to each element. +All three call the predicate or grouping function once for each item in the +input collection. All three return zero or more collections of the same type as +their input. The returned collections are always distinct from the input +(according to `===`), even if the contents are identical. + +Of these methods, `filter()` is the only one that is lazy and the only one which +discards items from the input collection. It is the simplest to use, and the +fact that it returns exactly one collection makes it easy to combine with other +methods to form a pipeline of operations. + +The `partition()` method is similar to an eager version of `filter()`, but it +returns two collections; the first contains the items that would have been +discarded by `filter()`, and the second contains the items that would have been +kept. It always returns an array of exactly two collections, which can make it +easier to use than `groupBy()`. Compared to making two separate calls to +`filter()`, `partition()` makes half as many calls it the predicate passed to +it. + +The `groupBy()` method is a more generalized version of `partition()` that can +group by an arbitrary function rather than just a predicate. It returns a map +with zero or more entries, where the keys are the values returned by the +grouping function, and the values are nonempty collections of the corresponding +arguments. Although `groupBy()` is more powerful than `partition()`, it can be +harder to use because it is not always possible predict in advance how many +entries the returned map will have and what their keys will be. + +| Summary | `filter` | `partition` | `groupBy` | +| :---------------------------- | :------- | :---------- | :------------- | +| ease of use | easiest | moderate | hardest | +| generality | least | moderate | most | +| laziness | lazy | eager | eager | +| # of returned sub-collections | 1 | 2 | 0 or more | +| sub-collections may be empty | yes | yes | no | +| can discard items | yes | no | no | +| wrapping container | none | array | Map/OrderedMap | + +## Additional Tools and Resources + +- [Atom-store](https://github.com/jameshopkins/atom-store/) + + - A Clojure-inspired atom implementation in Javascript with configurability + for external persistance. + +- [Chai Immutable](https://github.com/astorije/chai-immutable) + + - If you are using the [Chai Assertion Library](https://chaijs.com/), this + provides a set of assertions to use against Immutable.js collections. + +- [Fantasy-land](https://github.com/fantasyland/fantasy-land) + + - Specification for interoperability of common algebraic structures in JavaScript. + +- [Immutagen](https://github.com/pelotom/immutagen) + + - A library for simulating immutable generators in JavaScript. + +- [Immutable-cursor](https://github.com/redbadger/immutable-cursor) + + - Immutable cursors incorporating the Immutable.js interface over + Clojure-inspired atom. + +- [Immutable-ext](https://github.com/DrBoolean/immutable-ext) + + - Fantasyland extensions for immutablejs + +- [Immutable-js-tools](https://github.com/madeinfree/immutable-js-tools) + + - Util tools for immutable.js + +- [Immutable-Redux](https://github.com/gajus/redux-immutable) + + - redux-immutable is used to create an equivalent function of Redux + combineReducers that works with Immutable.js state. + +- [Immutable-Treeutils](https://github.com/lukasbuenger/immutable-treeutils) + + - Functional tree traversal helpers for ImmutableJS data structures. + +- [Irecord](https://github.com/ericelliott/irecord) + + - An immutable store that exposes an RxJS observable. Great for React. + +- [Mudash](https://github.com/brianneisler/mudash) + + - Lodash wrapper providing Immutable.JS support. + +- [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes) + + - PropType validators that work with Immutable.js. + +- [Redux-Immutablejs](https://github.com/indexiatech/redux-immutablejs) + + - Redux Immutable facilities. + +- [Rxstate](https://github.com/yamalight/rxstate) + + - Simple opinionated state management library based on RxJS and Immutable.js. + +- [Transit-Immutable-js](https://github.com/glenjamin/transit-immutable-js) + - Transit serialisation for Immutable.js. + - See also: [Transit-js](https://github.com/cognitect/transit-js) + +Have an additional tool designed to work with Immutable.js? +Submit a PR to add it to this list in alphabetical order. + +## Contributing + +Use [Github issues](https://github.com/immutable-js/immutable-js/issues) for requests. + +We actively welcome pull requests, learn how to [contribute](https://github.com/immutable-js/immutable-js/blob/main/.github/CONTRIBUTING.md). + +Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). + +### Changelog + +Changes are tracked as [Github releases](https://github.com/immutable-js/immutable-js/releases). + +### License + +Immutable.js is [MIT-licensed](./LICENSE). + +### Thanks + +[Phil Bagwell](https://www.youtube.com/watch?v=K2NYwP90bNs), for his inspiration +and research in persistent data structures. + +[Hugh Jackson](https://github.com/hughfdjackson/), for providing the npm package +name. If you're looking for his unsupported package, see [this repository](https://github.com/hughfdjackson/immutable). diff --git a/tools/ui/node_modules/immutable/dist/immutable.d.ts b/tools/ui/node_modules/immutable/dist/immutable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..06ae94587286481184b94e26dc05b3a11f8483fb --- /dev/null +++ b/tools/ui/node_modules/immutable/dist/immutable.d.ts @@ -0,0 +1,5128 @@ +/** @ignore we should disable this rules, but let's activate it to enable eslint first */ +/** + * Immutable data encourages pure functions (data-in, data-out) and lends itself + * to much simpler application development and enabling techniques from + * functional programming such as lazy evaluation. + * + * While designed to bring these powerful functional concepts to JavaScript, it + * presents an Object-Oriented API familiar to Javascript engineers and closely + * mirroring that of Array, Map, and Set. It is easy and efficient to convert to + * and from plain Javascript types. + * + * ## How to read these docs + * + * In order to better explain what kinds of values the Immutable.js API expects + * and produces, this documentation is presented in a statically typed dialect of + * JavaScript (like [Flow][] or [TypeScript][]). You *don't need* to use these + * type checking tools in order to use Immutable.js, however becoming familiar + * with their syntax will help you get a deeper understanding of this API. + * + * **A few examples and how to read them.** + * + * All methods describe the kinds of data they accept and the kinds of data + * they return. For example a function which accepts two numbers and returns + * a number would look like this: + * + * ```js + * sum(first: number, second: number): number + * ``` + * + * Sometimes, methods can accept different kinds of data or return different + * kinds of data, and this is described with a *type variable*, which is + * typically in all-caps. For example, a function which always returns the same + * kind of data it was provided would look like this: + * + * ```js + * identity(value: T): T + * ``` + * + * Type variables are defined with classes and referred to in methods. For + * example, a class that holds onto a value for you might look like this: + * + * ```js + * class Box { + * constructor(value: T) + * getValue(): T + * } + * ``` + * + * In order to manipulate Immutable data, methods that we're used to affecting + * a Collection instead return a new Collection of the same type. The type + * `this` refers to the same kind of class. For example, a List which returns + * new Lists when you `push` a value onto it might look like: + * + * ```js + * class List { + * push(value: T): this + * } + * ``` + * + * Many methods in Immutable.js accept values which implement the JavaScript + * [Iterable][] protocol, and might appear like `Iterable` for something + * which represents sequence of strings. Typically in JavaScript we use plain + * Arrays (`[]`) when an Iterable is expected, but also all of the Immutable.js + * collections are iterable themselves! + * + * For example, to get a value deep within a structure of data, we might use + * `getIn` which expects an `Iterable` path: + * + * ``` + * getIn(path: Iterable): unknown + * ``` + * + * To use this method, we could pass an array: `data.getIn([ "key", 2 ])`. + * + * + * Note: All examples are presented in the modern [ES2015][] version of + * JavaScript. Use tools like Babel to support older browsers. + * + * For example: + * + * ```js + * // ES2015 + * const mappedFoo = foo.map(x => x * x); + * // ES5 + * var mappedFoo = foo.map(function (x) { return x * x; }); + * ``` + * + * [ES2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla + * [TypeScript]: https://www.typescriptlang.org/ + * [Flow]: https://flowtype.org/ + * [Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + */ + +declare namespace Immutable { + /** @ignore */ + type OnlyObject = Extract; + + /** @ignore */ + type ContainObject = + OnlyObject extends object + ? OnlyObject extends never + ? false + : true + : false; + + /** + * @ignore + * + * Used to convert deeply all immutable types to a plain TS type. + * Using `unknown` on object instead of recursive call as we have a circular reference issue + */ + export type DeepCopy = + T extends Record + ? // convert Record to DeepCopy plain JS object + { + [key in keyof R]: ContainObject extends true + ? unknown + : R[key]; + } + : T extends MapOf + ? // convert MapOf to DeepCopy plain JS object + { + [key in keyof R]: ContainObject extends true + ? unknown + : R[key]; + } + : T extends Collection.Keyed + ? // convert KeyedCollection to DeepCopy plain JS object + { + [key in KeyedKey extends PropertyKey + ? KeyedKey + : string]: V extends object ? unknown : V; + } + : // convert IndexedCollection or Immutable.Set to DeepCopy plain JS array + // eslint-disable-next-line @typescript-eslint/no-unused-vars + T extends Collection + ? Array> + : T extends string | number // Iterable scalar types : should be kept as is + ? T + : T extends Iterable // Iterable are converted to plain JS array + ? Array> + : T extends object // plain JS object are converted deeply + ? { + [ObjectKey in keyof T]: ContainObject< + T[ObjectKey] + > extends true + ? unknown + : T[ObjectKey]; + } + : // other case : should be kept as is + T; + + /** + * Describes which item in a pair should be placed first when sorting + * + * @ignore + */ + export enum PairSorting { + LeftThenRight = -1, + RightThenLeft = +1, + } + + /** + * Function comparing two items of the same type. It can return: + * + * * a PairSorting value, to indicate whether the left-hand item or the right-hand item should be placed before the other + * + * * the traditional numeric return value - especially -1, 0, or 1 + * + * @ignore + */ + export type Comparator = (left: T, right: T) => PairSorting | number; + + /** + * @ignore + * + * KeyPath allowed for `xxxIn` methods + */ + export type KeyPath = OrderedCollection | ArrayLike; + + /** + * Lists are ordered indexed dense collections, much like a JavaScript + * Array. + * + * Lists are immutable and fully persistent with O(log32 N) gets and sets, + * and O(1) push and pop. + * + * Lists implement Deque, with efficient addition and removal from both the + * end (`push`, `pop`) and beginning (`unshift`, `shift`). + * + * Unlike a JavaScript Array, there is no distinction between an + * "unset" index and an index set to `undefined`. `List#forEach` visits all + * indices from 0 to size, regardless of whether they were explicitly defined. + */ + namespace List { + /** + * True if the provided value is a List + */ + function isList(maybeList: unknown): maybeList is List; + + /** + * Creates a new List containing `values`. + * + * Note: Values are not altered or converted in any way. + */ + function of(...values: Array): List; + } + + /** + * Create a new immutable List containing the values of the provided + * collection-like. + * + * Note: `List` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function List(collection?: Iterable | ArrayLike): List; + + interface List extends Collection.Indexed { + /** + * The number of items in this List. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new List which includes `value` at `index`. If `index` already + * exists in this List, it will be replaced. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.set(-1, "value")` sets the last item in the List. + * + * If `index` larger than `size`, the returned List's `size` will be large + * enough to include the `index`. + * + * Note: `set` can be used in `withMutations`. + */ + set(index: number, value: T): List; + + /** + * Returns a new List which excludes this `index` and with a size 1 less + * than this List. Values at indices above `index` are shifted down by 1 to + * fill the position. + * + * This is synonymous with `list.splice(index, 1)`. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.delete(-1)` deletes the last item in the List. + * + * Note: `delete` cannot be safely used in IE8 + * + * Since `delete()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `delete` *cannot* be used in `withMutations`. + * + * @alias remove + */ + delete(index: number): List; + remove(index: number): List; + + /** + * Returns a new List with `value` at `index` with a size 1 more than this + * List. Values at indices above `index` are shifted over by 1. + * + * This is synonymous with `list.splice(index, 0, value)`. + * + * Since `insert()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `insert` *cannot* be used in `withMutations`. + */ + insert(index: number, value: T): List; + + /** + * Returns a new List with 0 size and no values in constant time. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): List; + + /** + * Returns a new List with the provided `values` appended, starting at this + * List's `size`. + * + * Note: `push` can be used in `withMutations`. + */ + push(...values: Array): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the last index in this List. + * + * Note: this differs from `Array#pop` because it returns a new + * List rather than the removed value. Use `last()` to get the last value + * in this List. + * + * ```js + * List([ 1, 2, 3, 4 ]).pop() + * // List[ 1, 2, 3 ] + * ``` + * + * Note: `pop` can be used in `withMutations`. + */ + pop(): List; + + /** + * Returns a new List with the provided `values` prepended, shifting other + * values ahead to higher indices. + * + * Note: `unshift` can be used in `withMutations`. + */ + unshift(...values: Array): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the first index in this List, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * List rather than the removed value. Use `first()` to get the first + * value in this List. + * + * Note: `shift` can be used in `withMutations`. + */ + shift(): List; + + /** + * Returns a new List with an updated value at `index` with the return + * value of calling `updater` with the existing value, or `notSetValue` if + * `index` was not set. If called with a single argument, `updater` is + * called with the List itself. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.update(-1)` updates the last item in the List. + * + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum a List after mapping and filtering: + * + * Note: `update(index)` can be used in `withMutations`. + * + * @see `Map#update` + */ + update(index: number, notSetValue: T, updater: (value: T) => T): this; + update( + index: number, + updater: (value: T | undefined) => T | undefined + ): this; + update(updater: (value: this) => R): R; + + /** + * Returns a new List with size `size`. If `size` is less than this + * List's size, the new List will exclude values at the higher indices. + * If `size` is greater than this List's size, the new List will have + * undefined values for the newly available indices. + * + * When building a new List and the final size is known up front, `setSize` + * used in conjunction with `withMutations` may result in the more + * performant construction. + */ + setSize(size: number): List; + + // Deep persistent changes + + /** + * Returns a new List having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + * + * Index numbers are used as keys to determine the path to follow in + * the List. + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and setIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * Note: `setIn` can be used in `withMutations`. + */ + setIn(keyPath: Iterable, value: unknown): this; + + /** + * Returns a new List having removed the value at this `keyPath`. If any + * keys in `keyPath` do not exist, no change will occur. + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and removeIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * Note: `deleteIn` *cannot* be safely used in `withMutations`. + * + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + /** + * Note: `updateIn` can be used in `withMutations`. + * + * @see `Map#updateIn` + */ + updateIn( + keyPath: Iterable, + notSetValue: unknown, + updater: (value: unknown) => unknown + ): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + + /** + * Note: `mergeIn` can be used in `withMutations`. + * + * @see `Map#mergeIn` + */ + mergeIn(keyPath: Iterable, ...collections: Array): this; + + /** + * Note: `mergeDeepIn` can be used in `withMutations`. + * + * @see `Map#mergeDeepIn` + */ + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + // Transient changes + + /** + * Note: Not all methods can be safely used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * allows being used in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * An alternative API for withMutations() + * + * Note: Not all methods can be safely used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * allows being used in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new List with other values or collections concatenated to this one. + * + * Note: `concat` can be used in `withMutations`. + * + * @alias merge + */ + concat(...valuesOrCollections: Array | C>): List; + merge(...collections: Array>): List; + + /** + * Returns a new List with values passed through a + * `mapper` function. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): List; + + /** + * Flat-maps the List, returning a new List. + * + * Similar to `list.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): List; + + /** + * Returns a new List with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): List; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new List with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [List, List]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a List "zipped" with the provided collection. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + */ + zip(other: Collection): List<[T, U]>; + zip( + other: Collection, + other2: Collection + ): List<[T, U, V]>; + zip(...collections: Array>): List; + + /** + * Returns a List "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): List<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): List<[T, U, V]>; + zipAll(...collections: Array>): List; + + /** + * Returns a List "zipped" with the provided collections by using a + * custom `zipper` function. + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): List; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): List; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): List; + + /** + * Returns a new List with its values shuffled thanks to the + * [Fisher–Yates](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) + * algorithm. + * It uses Math.random, but you can provide your own random number generator. + */ + shuffle(random?: () => number): this; + } + + /** + * Immutable Map is an unordered Collection.Keyed of (key, value) pairs with + * `O(log32 N)` gets and `O(log32 N)` persistent sets. + * + * Iteration order of a Map is undefined, however is stable. Multiple + * iterations of the same Map will iterate in the same order. + * + * Map's keys can be of any type, and use `Immutable.is` to determine key + * equality. This allows the use of any value (including NaN) as a key. + * + * Because `Immutable.is` returns equality based on value semantics, and + * Immutable collections are treated as values, any Immutable collection may + * be used as a key. + * + * Any JavaScript object may be used as a key, however strict identity is used + * to evaluate key equality. Two similar looking objects will represent two + * different keys. + * + * Implemented by a hash-array mapped trie. + */ + namespace Map { + /** + * True if the provided value is a Map + */ + function isMap(maybeMap: unknown): maybeMap is Map; + } + + /** + * Creates a new Immutable Map. + * + * Created with the same key value pairs as the provided Collection.Keyed or + * JavaScript Object or expects a Collection of [K, V] tuple entries. + * + * Note: `Map` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + */ + function Map(collection?: Iterable): Map; + function Map(obj: R): MapOf; + function Map(obj: { [key: string]: V }): Map; + function Map(obj: { [P in K]?: V }): Map; + + /** + * Represent a Map constructed by an object + * + * @ignore + */ + interface MapOf + extends Map { + /** + * Returns the value associated with the provided key, or notSetValue if + * the Collection does not contain this key. + * + * Note: it is possible a key may be associated with an `undefined` value, + * so if `notSetValue` is not provided and this method returns `undefined`, + * that does not guarantee the key was not found. + */ + get(key: K, notSetValue?: unknown): R[K]; + get(key: unknown, notSetValue: NSV): NSV; + + // TODO `` can be used after dropping support for TypeScript 4.x + // reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters + // after this change, `as const` assertions can be remove from the type tests + getIn

>( + searchKeyPath: [...P], + notSetValue?: unknown + ): RetrievePath; + + set(key: K, value: R[K]): this; + + update(updater: (value: this) => this): this; + update(key: K, updater: (value: R[K]) => R[K]): this; + update( + key: K, + notSetValue: NSV, + updater: (value: R[K]) => R[K] + ): this; + + // Possible best type is MapOf> but Omit seems to broke other function calls + // and generate recursion error with other methods (update, merge, etc.) until those functions are defined in MapOf + delete( + key: K + ): Extract extends never ? never : this; + remove( + key: K + ): Extract extends never ? never : this; + + toJS(): { [K in keyof R]: DeepCopy }; + + toJSON(): { [K in keyof R]: R[K] }; + } + + // Loosely based off of this work. + // https://github.com/immutable-js/immutable-js/issues/1462#issuecomment-584123268 + + /** + * @ignore + * Convert an immutable type to the equivalent plain TS type + * - MapOf -> object + * - List -> Array + */ + type GetNativeType = + S extends MapOf ? T : S extends List ? Array : S; + + /** @ignore */ + type Head> = T extends [ + infer H, + ...Array, + ] + ? H + : never; + /** @ignore */ + type Tail> = T extends [unknown, ...infer I] + ? I + : Array; + /** @ignore */ + type RetrievePathReducer< + T, + C, + L extends ReadonlyArray, + NT = GetNativeType, + > = + // we can not retrieve a path from a primitive type + T extends string | number | boolean | null | undefined + ? never + : C extends keyof NT + ? L extends [] // L extends [] means we are at the end of the path, lets return the current type + ? NT[C] + : // we are not at the end of the path, lets continue with the next key + RetrievePathReducer, Tail> + : // C is not a "key" of NT, so the path is invalid + never; + + /** @ignore */ + type RetrievePath> = P extends [] + ? P + : RetrievePathReducer, Tail

>; + + interface Map extends Collection.Keyed { + /** + * The number of entries in this Map. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new Map also containing the new key, value pair. If an equivalent + * key already exists in this Map, it will be replaced. + * + * Note: `set` can be used in `withMutations`. + */ + set(key: K, value: V): this; + + /** + * Returns a new Map which excludes this `key`. + * + * Note: `delete` cannot be safely used in IE8, but is provided to mirror + * the ES6 collection API. + * + * Note: `delete` can be used in `withMutations`. + * + * @alias remove + */ + delete(key: K): this; + remove(key: K): this; + + /** + * Returns a new Map which excludes the provided `keys`. + * + * Note: `deleteAll` can be used in `withMutations`. + * + * @alias removeAll + */ + deleteAll(keys: Iterable): this; + removeAll(keys: Iterable): this; + + /** + * Returns a new Map containing no keys or values. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): this; + + /** + * Returns a new Map having updated the value at this `key` with the return + * value of calling `updater` with the existing value. + * + * Similar to: `map.set(key, updater(map.get(key)))`. + * + * This is most commonly used to call methods on collections within a + * structure of data. For example, in order to `.push()` onto a nested `List`, + * `update` and `push` can be used together: + * + * When a `notSetValue` is provided, it is provided to the `updater` + * function when the value at the key does not exist in the Map. + * + * However, if the `updater` function returns the same value it was called + * with, then no change will occur. This is still true if `notSetValue` + * is provided. + * + * For code using ES2015 or later, using `notSetValue` is discourged in + * favor of function parameter default values. This helps to avoid any + * potential confusion with identify functions as described above. + * + * The previous example behaves differently when written with default values: + * + * If no key is provided, then the `updater` function return value is + * returned as well. + * + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum the values in a Map + * + * Note: `update(key)` can be used in `withMutations`. + */ + update(key: K, notSetValue: V, updater: (value: V) => V): this; + update(key: K, updater: (value: V | undefined) => V | undefined): this; + update(updater: (value: this) => R): R; + + /** + * Returns a new Map resulting from merging the provided Collections + * (or JS objects) into this Map. In other words, this takes each entry of + * each collection and sets it on this Map. + * + * Note: Values provided to `merge` are shallowly converted before being + * merged. No nested values are altered. + * ``` + * + * Note: `merge` can be used in `withMutations`. + * + * @alias concat + */ + merge( + ...collections: Array> + ): Map | VC>; + merge( + ...collections: Array<{ [key: string]: C }> + ): Map | C>; + + concat( + ...collections: Array> + ): Map | VC>; + concat( + ...collections: Array<{ [key: string]: C }> + ): Map | C>; + + /** + * Like `merge()`, `mergeWith()` returns a new Map resulting from merging + * the provided Collections (or JS objects) into this Map, but uses the + * `merger` function for dealing with conflicts. + * + * Note: `mergeWith` can be used in `withMutations`. + */ + mergeWith( + merger: (oldVal: V, newVal: VC, key: K) => VCC, + ...collections: Array> + ): Map; + mergeWith( + merger: (oldVal: V, newVal: C, key: string) => CC, + ...collections: Array<{ [key: string]: C }> + ): Map; + + /** + * Like `merge()`, but when two compatible collections are encountered with + * the same key, it merges them as well, recursing deeply through the nested + * data. Two collections are considered to be compatible (and thus will be + * merged together) if they both fall into one of three categories: keyed + * (e.g., `Map`s, `Record`s, and objects), indexed (e.g., `List`s and + * arrays), or set-like (e.g., `Set`s). If they fall into separate + * categories, `mergeDeep` will replace the existing collection with the + * collection being merged in. This behavior can be customized by using + * `mergeDeepWith()`. + * + * Note: Indexed and set-like collections are merged using + * `concat()`/`union()` and therefore do not recurse. + * + * Note: `mergeDeep` can be used in `withMutations`. + */ + mergeDeep( + ...collections: Array> + ): Map; + mergeDeep( + ...collections: Array<{ [key: string]: C }> + ): Map; + + /** + * Like `mergeDeep()`, but when two non-collections or incompatible + * collections are encountered at the same key, it uses the `merger` + * function to determine the resulting value. Collections are considered + * incompatible if they fall into separate categories between keyed, + * indexed, and set-like. + * + * Note: `mergeDeepWith` can be used in `withMutations`. + */ + mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + ...collections: Array | { [key: string]: V }> + ): this; + + // Deep persistent changes + + /** + * Returns a new Map having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and setIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * If any key in the path exists but cannot be updated (such as a primitive + * like number or a custom Object like Date), an error will be thrown. + * + * Note: `setIn` can be used in `withMutations`. + */ + setIn(keyPath: Iterable, value: unknown): this; + + /** + * Returns a new Map having removed the value at this `keyPath`. If any keys + * in `keyPath` do not exist, no change will occur. + * + * Note: `deleteIn` can be used in `withMutations`. + * + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + /** + * Returns a new Map having applied the `updater` to the entry found at the + * keyPath. + * + * This is most commonly used to call methods on collections nested within a + * structure of data. For example, in order to `.push()` onto a nested `List`, + * `updateIn` and `push` can be used together: + + * + * If any keys in `keyPath` do not exist, new Immutable `Map`s will + * be created at those keys. If the `keyPath` does not already contain a + * value, the `updater` function will be called with `notSetValue`, if + * provided, otherwise `undefined`. + * + * If the `updater` function returns the same value it was called with, then + * no change will occur. This is still true if `notSetValue` is provided. + * + * For code using ES2015 or later, using `notSetValue` is discourged in + * favor of function parameter default values. This helps to avoid any + * potential confusion with identify functions as described above. + * + * The previous example behaves differently when written with default values: + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and updateIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * If any key in the path exists but cannot be updated (such as a primitive + * like number or a custom Object like Date), an error will be thrown. + * + * Note: `updateIn` can be used in `withMutations`. + */ + updateIn( + keyPath: Iterable, + notSetValue: unknown, + updater: (value: unknown) => unknown + ): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + + /** + * A combination of `updateIn` and `merge`, returning a new Map, but + * performing the merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * ```js + * map.updateIn(['a', 'b', 'c'], abc => abc.merge(y)) + * map.mergeIn(['a', 'b', 'c'], y) + * ``` + * + * Note: `mergeIn` can be used in `withMutations`. + */ + mergeIn(keyPath: Iterable, ...collections: Array): this; + + /** + * A combination of `updateIn` and `mergeDeep`, returning a new Map, but + * performing the deep merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * ```js + * map.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)) + * map.mergeDeepIn(['a', 'b', 'c'], y) + * ``` + * + * Note: `mergeDeepIn` can be used in `withMutations`. + */ + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + // Transient changes + + /** + * Every time you call one of the above functions, a new immutable Map is + * created. If a pure function calls a number of these to produce a final + * return value, then a penalty on performance and memory has been paid by + * creating all of the intermediate immutable Maps. + * + * If you need to apply a series of mutations to produce a new immutable + * Map, `withMutations()` creates a temporary mutable copy of the Map which + * can apply mutations in a highly performant manner. In fact, this is + * exactly how complex mutations like `merge` are done. + * + * As an example, this results in the creation of 2, not 4, new Maps: + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Read the documentation for each method to see if it + * is safe to use in `withMutations`. + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Another way to avoid creation of intermediate Immutable maps is to create + * a mutable copy of this collection. Mutable copies *always* return `this`, + * and thus shouldn't be used for equality. Your function should never return + * a mutable copy of a collection, only use it internally to create a new + * collection. + * + * If possible, use `withMutations` to work with temporary mutable copies as + * it provides an easier to use API and considers many common optimizations. + * + * Note: if the collection is already mutable, `asMutable` returns itself. + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Read the documentation for each method to see if it + * is safe to use in `withMutations`. + * + * @see `Map#asImmutable` + */ + asMutable(): this; + + /** + * Returns true if this is a mutable copy (see `asMutable()`) and mutative + * alterations have been applied. + * + * @see `Map#asMutable` + */ + wasAltered(): boolean; + + /** + * The yin to `asMutable`'s yang. Because it applies to mutable collections, + * this operation is *mutable* and may return itself (though may not + * return itself, i.e. if the result is an empty collection). Once + * performed, the original mutable copy must no longer be mutated since it + * may be the immutable result. + * + * If possible, use `withMutations` to work with temporary mutable copies as + * it provides an easier to use API and considers many common optimizations. + * + * @see `Map#asMutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Map with values passed through a + * `mapper` function. + * + * Map({ a: 1, b: 2 }).map(x => 10 * x) + * // Map { a: 10, b: 20 } + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Map; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Map; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Map; + + /** + * Flat-maps the Map, returning a new Map. + * + * Similar to `data.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Map; + + /** + * Returns a new Map with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Map; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Map with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Map, Map]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): Map; + + /** + * Returns an OrderedMap of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this & OrderedMap; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): this & OrderedMap; + } + + /** + * A type of Map that has the additional guarantee that the iteration order of + * entries will be the order in which they were set(). + * + * The iteration behavior of OrderedMap is the same as native ES6 Map and + * JavaScript Object. + * + * Note that `OrderedMap` are more expensive than non-ordered `Map` and may + * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not + * stable. + */ + namespace OrderedMap { + /** + * True if the provided value is an OrderedMap. + */ + function isOrderedMap( + maybeOrderedMap: unknown + ): maybeOrderedMap is OrderedMap; + } + + /** + * Creates a new Immutable OrderedMap. + * + * Created with the same key value pairs as the provided Collection.Keyed or + * JavaScript Object or expects a Collection of [K, V] tuple entries. + * + * The iteration order of key-value pairs provided to this constructor will + * be preserved in the OrderedMap. + * + * let newOrderedMap = OrderedMap({key: "value"}) + * let newOrderedMap = OrderedMap([["key", "value"]]) + * + * Note: `OrderedMap` is a factory function and not a class, and does not use + * the `new` keyword during construction. + */ + function OrderedMap(collection?: Iterable<[K, V]>): OrderedMap; + function OrderedMap(obj: { [key: string]: V }): OrderedMap; + + interface OrderedMap extends Map, OrderedCollection<[K, V]> { + /** + * The number of entries in this OrderedMap. + */ + readonly size: number; + + /** + * Returns a new OrderedMap also containing the new key, value pair. If an + * equivalent key already exists in this OrderedMap, it will be replaced + * while maintaining the existing order. + * + * Note: `set` can be used in `withMutations`. + */ + set(key: K, value: V): this; + + /** + * Returns a new OrderedMap resulting from merging the provided Collections + * (or JS objects) into this OrderedMap. In other words, this takes each + * entry of each collection and sets it on this OrderedMap. + * + * Note: Values provided to `merge` are shallowly converted before being + * merged. No nested values are altered. + * + * Note: `merge` can be used in `withMutations`. + * + * @alias concat + */ + merge( + ...collections: Array> + ): OrderedMap | VC>; + merge( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap | C>; + + concat( + ...collections: Array> + ): OrderedMap | VC>; + concat( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap | C>; + + mergeWith( + merger: (oldVal: V, newVal: VC, key: K) => VCC, + ...collections: Array> + ): OrderedMap; + mergeWith( + merger: (oldVal: V, newVal: C, key: string) => CC, + ...collections: Array<{ [key: string]: C }> + ): OrderedMap; + + mergeDeep( + ...collections: Array> + ): OrderedMap; + mergeDeep( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap; + + // Sequence algorithms + + /** + * Returns a new OrderedMap with values passed through a + * `mapper` function. + * + * OrderedMap({ a: 1, b: 2 }).map(x => 10 * x) + * // OrderedMap { "a": 10, "b": 20 } + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): OrderedMap; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): OrderedMap; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): OrderedMap; + + /** + * Flat-maps the OrderedMap, returning a new OrderedMap. + * + * Similar to `data.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): OrderedMap; + + /** + * Returns a new OrderedMap with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): OrderedMap; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new OrderedMap with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [OrderedMap, OrderedMap]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): OrderedMap; + } + + /** + * A Collection of unique values with `O(log32 N)` adds and has. + * + * When iterating a Set, the entries will be (value, value) pairs. Iteration + * order of a Set is undefined, however is stable. Multiple iterations of the + * same Set will iterate in the same order. + * + * Set values, like Map keys, may be of any type. Equality is determined using + * `Immutable.is`, enabling Sets to uniquely include other Immutable + * collections, custom value types, and NaN. + */ + namespace Set { + /** + * True if the provided value is a Set + */ + function isSet(maybeSet: unknown): maybeSet is Set; + + /** + * Creates a new Set containing `values`. + */ + function of(...values: Array): Set; + + /** + * `Set.fromKeys()` creates a new immutable Set containing the keys from + * this Collection or JavaScript Object. + */ + function fromKeys(iter: Collection.Keyed): Set; + function fromKeys(iter: Collection): Set; + function fromKeys(obj: { [key: string]: unknown }): Set; + + /** + * `Set.intersect()` creates a new immutable Set that is the intersection of + * a collection of other sets. + * + * ```js + * import { Set } from 'immutable' + * const intersected = Set.intersect([ + * Set([ 'a', 'b', 'c' ]) + * Set([ 'c', 'a', 't' ]) + * ]) + * // Set [ "a", "c" ] + * ``` + */ + function intersect(sets: Iterable>): Set; + + /** + * `Set.union()` creates a new immutable Set that is the union of a + * collection of other sets. + * + * ```js + * import { Set } from 'immutable' + * const unioned = Set.union([ + * Set([ 'a', 'b', 'c' ]) + * Set([ 'c', 'a', 't' ]) + * ]) + * // Set [ "a", "b", "c", "t" ] + * ``` + */ + function union(sets: Iterable>): Set; + } + + /** + * Create a new immutable Set containing the values of the provided + * collection-like. + * + * Note: `Set` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Set; + + interface Set extends Collection.Set { + /** + * The number of items in this Set. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new Set which also includes this value. + * + * Note: `add` can be used in `withMutations`. + */ + add(value: T): this; + + /** + * Returns a new Set which excludes this value. + * + * Note: `delete` can be used in `withMutations`. + * + * Note: `delete` **cannot** be safely used in IE8, use `remove` if + * supporting old browsers. + * + * @alias remove + */ + delete(value: T): this; + remove(value: T): this; + + /** + * Returns a new Set containing no values. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): this; + + /** + * Returns a Set including any value from `collections` that does not already + * exist in this Set. + * + * Note: `union` can be used in `withMutations`. + * @alias merge + * @alias concat + */ + union(...collections: Array>): Set; + merge(...collections: Array>): Set; + concat(...collections: Array>): Set; + + /** + * Returns a Set which has removed any values not also contained + * within `collections`. + * + * Note: `intersect` can be used in `withMutations`. + */ + intersect(...collections: Array>): this; + + /** + * Returns a Set excluding any values contained within `collections`. + * + * Note: `subtract` can be used in `withMutations`. + */ + subtract(...collections: Array>): this; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Set with values passed through a + * `mapper` function. + * + * Set([1,2]).map(x => 10 * x) + * // Set [10,20] + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Set; + + /** + * Flat-maps the Set, returning a new Set. + * + * Similar to `set.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Set; + + /** + * Returns a new Set with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Set with the values for which the `predicate` function + * returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Set, Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns an OrderedSet of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this & OrderedSet; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: T, key: T, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): this & OrderedSet; + } + + /** + * A type of Set that has the additional guarantee that the iteration order of + * values will be the order in which they were `add`ed. + * + * The iteration behavior of OrderedSet is the same as native ES6 Set. + * + * Note that `OrderedSet` are more expensive than non-ordered `Set` and may + * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not + * stable. + */ + namespace OrderedSet { + /** + * True if the provided value is an OrderedSet. + */ + function isOrderedSet( + maybeOrderedSet: unknown + ): maybeOrderedSet is OrderedSet; + + /** + * Creates a new OrderedSet containing `values`. + */ + function of(...values: Array): OrderedSet; + + /** + * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing + * the keys from this Collection or JavaScript Object. + */ + function fromKeys(iter: Collection.Keyed): OrderedSet; + function fromKeys(iter: Collection): OrderedSet; + function fromKeys(obj: { [key: string]: unknown }): OrderedSet; + } + + /** + * Create a new immutable OrderedSet containing the values of the provided + * collection-like. + * + * Note: `OrderedSet` is a factory function and not a class, and does not use + * the `new` keyword during construction. + */ + function OrderedSet( + collection?: Iterable | ArrayLike + ): OrderedSet; + + interface OrderedSet extends Set, OrderedCollection { + /** + * The number of items in this OrderedSet. + */ + readonly size: number; + + /** + * Returns an OrderedSet including any value from `collections` that does + * not already exist in this OrderedSet. + * + * Note: `union` can be used in `withMutations`. + * @alias merge + * @alias concat + */ + union(...collections: Array>): OrderedSet; + merge(...collections: Array>): OrderedSet; + concat(...collections: Array>): OrderedSet; + + // Sequence algorithms + + /** + * Returns a new Set with values passed through a + * `mapper` function. + * + * OrderedSet([ 1, 2 ]).map(x => 10 * x) + * // OrderedSet [10, 20] + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): OrderedSet; + + /** + * Flat-maps the OrderedSet, returning a new OrderedSet. + * + * Similar to `set.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): OrderedSet; + + /** + * Returns a new OrderedSet with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): OrderedSet; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new OrderedSet with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [OrderedSet, OrderedSet]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns an OrderedSet of the same type "zipped" with the provided + * collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = OrderedSet([ 1, 2, 3 ]) + * const b = OrderedSet([ 4, 5, 6 ]) + * const c = a.zip(b) + * // OrderedSet [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): OrderedSet<[T, U]>; + zip( + other1: Collection, + other2: Collection + ): OrderedSet<[T, U, V]>; + zip( + ...collections: Array> + ): OrderedSet; + + /** + * Returns a OrderedSet of the same type "zipped" with the provided + * collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = OrderedSet([ 1, 2 ]); + * const b = OrderedSet([ 3, 4, 5 ]); + * const c = a.zipAll(b); // OrderedSet [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): OrderedSet<[T, U]>; + zipAll( + other1: Collection, + other2: Collection + ): OrderedSet<[T, U, V]>; + zipAll( + ...collections: Array> + ): OrderedSet; + + /** + * Returns an OrderedSet of the same type "zipped" with the provided + * collections by using a custom `zipper` function. + * + * @see Seq.Indexed.zipWith + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): OrderedSet; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): OrderedSet; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): OrderedSet; + } + + /** + * Stacks are indexed collections which support very efficient O(1) addition + * and removal from the front using `unshift(v)` and `shift()`. + * + * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but + * be aware that they also operate on the front of the list, unlike List or + * a JavaScript Array. + * + * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, + * `lastIndexOf`, etc.) is not efficient with a Stack. + * + * Stack is implemented with a Single-Linked List. + */ + namespace Stack { + /** + * True if the provided value is a Stack + */ + function isStack(maybeStack: unknown): maybeStack is Stack; + + /** + * Creates a new Stack containing `values`. + */ + function of(...values: Array): Stack; + } + + /** + * Create a new immutable Stack containing the values of the provided + * collection-like. + * + * The iteration order of the provided collection is preserved in the + * resulting `Stack`. + * + * Note: `Stack` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Stack(collection?: Iterable | ArrayLike): Stack; + + interface Stack extends Collection.Indexed { + /** + * The number of items in this Stack. + */ + readonly size: number; + + // Reading values + + /** + * Alias for `Stack.first()`. + */ + peek(): T | undefined; + + // Persistent changes + + /** + * Returns a new Stack with 0 size and no values. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): Stack; + + /** + * Returns a new Stack with the provided `values` prepended, shifting other + * values ahead to higher indices. + * + * This is very efficient for Stack. + * + * Note: `unshift` can be used in `withMutations`. + */ + unshift(...values: Array): Stack; + + /** + * Like `Stack#unshift`, but accepts a collection rather than varargs. + * + * Note: `unshiftAll` can be used in `withMutations`. + */ + unshiftAll(iter: Iterable): Stack; + + /** + * Returns a new Stack with a size ones less than this Stack, excluding + * the first item in this Stack, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * Stack rather than the removed value. Use `first()` or `peek()` to get the + * first value in this Stack. + * + * Note: `shift` can be used in `withMutations`. + */ + shift(): Stack; + + /** + * Alias for `Stack#unshift` and is not equivalent to `List#push`. + */ + push(...values: Array): Stack; + + /** + * Alias for `Stack#unshiftAll`. + */ + pushAll(iter: Iterable): Stack; + + /** + * Alias for `Stack#shift` and is not equivalent to `List#pop`. + */ + pop(): Stack; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Stack with other collections concatenated to this one. + */ + concat(...valuesOrCollections: Array | C>): Stack; + + /** + * Returns a new Stack with values passed through a + * `mapper` function. + * + * Stack([ 1, 2 ]).map(x => 10 * x) + * // Stack [ 10, 20 ] + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Stack; + + /** + * Flat-maps the Stack, returning a new Stack. + * + * Similar to `stack.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Stack; + + /** + * Returns a new Set with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Set; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a Stack "zipped" with the provided collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = Stack([ 1, 2, 3 ]); + * const b = Stack([ 4, 5, 6 ]); + * const c = a.zip(b); // Stack [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Stack<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Stack<[T, U, V]>; + zip(...collections: Array>): Stack; + + /** + * Returns a Stack "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = Stack([ 1, 2 ]); + * const b = Stack([ 3, 4, 5 ]); + * const c = a.zipAll(b); // Stack [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): Stack<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Stack<[T, U, V]>; + zipAll(...collections: Array>): Stack; + + /** + * Returns a Stack "zipped" with the provided collections by using a + * custom `zipper` function. + * + * ```js + * const a = Stack([ 1, 2, 3 ]); + * const b = Stack([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // Stack [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Stack; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Stack; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Stack; + } + + /** + * Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` + * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to + * infinity. When `start` is equal to `end`, returns empty range. + * + * Note: `Range` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * ```js + * import { Range } from 'immutable' + * Range(10, 15) // [ 10, 11, 12, 13, 14 ] + * Range(10, 30, 5) // [ 10, 15, 20, 25 ] + * Range(30, 10, 5) // [ 30, 25, 20, 15 ] + * Range(30, 30, 5) // [] + * ``` + */ + function Range( + start: number, + end: number, + step?: number + ): Seq.Indexed; + + /** + * Returns a Seq.Indexed of `value` repeated `times` times. When `times` is + * not defined, returns an infinite `Seq` of `value`. + * + * Note: `Repeat` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * ```js + * import { Repeat } from 'immutable' + * Repeat('foo') // [ 'foo', 'foo', 'foo', ... ] + * Repeat('bar', 4) // [ 'bar', 'bar', 'bar', 'bar' ] + * ``` + */ + function Repeat(value: T, times?: number): Seq.Indexed; + + /** + * A record is similar to a JS object, but enforces a specific set of allowed + * string keys, and has default values. + * + * The `Record()` function produces new Record Factories, which when called + * create Record instances. + * + * ```js + * import { Record } from 'immutable' + * const ABRecord = Record({ a: 1, b: 2 }) + * const myRecord = ABRecord({ b: 3 }) + * ``` + * + * Records always have a value for the keys they define. `remove`ing a key + * from a record simply resets it to the default value for that key. + * + * ```js + * myRecord.get('a') // 1 + * myRecord.get('b') // 3 + * const myRecordWithoutB = myRecord.remove('b') + * myRecordWithoutB.get('b') // 2 + * ``` + * + * Values provided to the constructor not found in the Record type will + * be ignored. For example, in this case, ABRecord is provided a key "x" even + * though only "a" and "b" have been defined. The value for "x" will be + * ignored for this record. + * + * ```js + * const myRecord = ABRecord({ b: 3, x: 10 }) + * myRecord.get('x') // undefined + * ``` + * + * Because Records have a known set of string keys, property get access works + * as expected, however property sets will throw an Error. + * + * Note: IE8 does not support property access. Only use `get()` when + * supporting IE8. + * + * ```js + * myRecord.b // 3 + * myRecord.b = 5 // throws Error + * ``` + * + * Record Types can be extended as well, allowing for custom methods on your + * Record. This is not a common pattern in functional environments, but is in + * many JS programs. + * + * However Record Types are more restricted than typical JavaScript classes. + * They do not use a class constructor, which also means they cannot use + * class properties (since those are technically part of a constructor). + * + * While Record Types can be syntactically created with the JavaScript `class` + * form, the resulting Record function is actually a factory function, not a + * class constructor. Even though Record Types are not classes, JavaScript + * currently requires the use of `new` when creating new Record instances if + * they are defined as a `class`. + * + * ``` + * class ABRecord extends Record({ a: 1, b: 2 }) { + * getAB() { + * return this.a + this.b; + * } + * } + * + * var myRecord = new ABRecord({b: 3}) + * myRecord.getAB() // 4 + * ``` + * + * + * **Flow Typing Records:** + * + * Immutable.js exports two Flow types designed to make it easier to use + * Records with flow typed code, `RecordOf` and `RecordFactory`. + * + * When defining a new kind of Record factory function, use a flow type that + * describes the values the record contains along with `RecordFactory`. + * To type instances of the Record (which the factory function returns), + * use `RecordOf`. + * + * Typically, new Record definitions will export both the Record factory + * function as well as the Record instance type for use in other code. + * + * ```js + * import type { RecordFactory, RecordOf } from 'immutable'; + * + * // Use RecordFactory for defining new Record factory functions. + * type Point3DProps = { x: number, y: number, z: number }; + * const defaultValues: Point3DProps = { x: 0, y: 0, z: 0 }; + * const makePoint3D: RecordFactory = Record(defaultValues); + * export makePoint3D; + * + * // Use RecordOf for defining new instances of that Record. + * export type Point3D = RecordOf; + * const some3DPoint: Point3D = makePoint3D({ x: 10, y: 20, z: 30 }); + * ``` + * + * **Flow Typing Record Subclasses:** + * + * Records can be subclassed as a means to add additional methods to Record + * instances. This is generally discouraged in favor of a more functional API, + * since Subclasses have some minor overhead. However the ability to create + * a rich API on Record types can be quite valuable. + * + * When using Flow to type Subclasses, do not use `RecordFactory`, + * instead apply the props type when subclassing: + * + * ```js + * type PersonProps = {name: string, age: number}; + * const defaultValues: PersonProps = {name: 'Aristotle', age: 2400}; + * const PersonRecord = Record(defaultValues); + * class Person extends PersonRecord { + * getName(): string { + * return this.get('name') + * } + * + * setName(name: string): this { + * return this.set('name', name); + * } + * } + * ``` + * + * **Choosing Records vs plain JavaScript objects** + * + * Records offer a persistently immutable alternative to plain JavaScript + * objects, however they're not required to be used within Immutable.js + * collections. In fact, the deep-access and deep-updating functions + * like `getIn()` and `setIn()` work with plain JavaScript Objects as well. + * + * Deciding to use Records or Objects in your application should be informed + * by the tradeoffs and relative benefits of each: + * + * - *Runtime immutability*: plain JS objects may be carefully treated as + * immutable, however Record instances will *throw* if attempted to be + * mutated directly. Records provide this additional guarantee, however at + * some marginal runtime cost. While JS objects are mutable by nature, the + * use of type-checking tools like [Flow](https://medium.com/@gcanti/immutability-with-flow-faa050a1aef4) + * can help gain confidence in code written to favor immutability. + * + * - *Value equality*: Records use value equality when compared with `is()` + * or `record.equals()`. That is, two Records with the same keys and values + * are equal. Plain objects use *reference equality*. Two objects with the + * same keys and values are not equal since they are different objects. + * This is important to consider when using objects as keys in a `Map` or + * values in a `Set`, which use equality when retrieving values. + * + * - *API methods*: Records have a full featured API, with methods like + * `.getIn()`, and `.equals()`. These can make working with these values + * easier, but comes at the cost of not allowing keys with those names. + * + * - *Default values*: Records provide default values for every key, which + * can be useful when constructing Records with often unchanging values. + * However default values can make using Flow and TypeScript more laborious. + * + * - *Serialization*: Records use a custom internal representation to + * efficiently store and update their values. Converting to and from this + * form isn't free. If converting Records to plain objects is common, + * consider sticking with plain objects to begin with. + */ + namespace Record { + /** + * True if `maybeRecord` is an instance of a Record. + */ + function isRecord(maybeRecord: unknown): maybeRecord is Record; + + /** + * Records allow passing a second parameter to supply a descriptive name + * that appears when converting a Record to a string or in any error + * messages. A descriptive name for any record can be accessed by using this + * method. If one was not provided, the string "Record" is returned. + * + * ```js + * import { Record } from 'immutable' + * const Person = Record({ + * name: null + * }, 'Person') + * + * var me = Person({ name: 'My Name' }) + * me.toString() // "Person { "name": "My Name" }" + * Record.getDescriptiveName(me) // "Person" + * ``` + */ + function getDescriptiveName( + record: RecordOf + ): string; + + /** + * A Record.Factory is created by the `Record()` function. Record instances + * are created by passing it some of the accepted values for that Record + * type: + * + * Note that Record Factories return `Record & Readonly`, + * this allows use of both the Record instance API, and direct property + * access on the resulting instances: + */ + namespace Factory {} + + interface Factory { + ( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + new ( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + + /** + * The name provided to `Record(values, name)` can be accessed with + * `displayName`. + */ + displayName: string; + } + + function Factory( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + } + + /** + * Unlike other types in Immutable.js, the `Record()` function creates a new + * Record Factory, which is a function that creates Record instances. + * + * See above for examples of using `Record()`. + * + * Note: `Record` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Record( + defaultValues: TProps, + name?: string + ): Record.Factory; + + interface Record { + // Reading values + + has(key: string): key is keyof TProps & string; + + /** + * Returns the value associated with the provided key, which may be the + * default value defined when creating the Record factory function. + * + * If the requested key is not defined by this Record type, then + * notSetValue will be returned if provided. Note that this scenario would + * produce an error when using Flow or TypeScript. + */ + get(key: K, notSetValue?: unknown): TProps[K]; + get(key: string, notSetValue: T): T; + + // Reading deep values + + hasIn(keyPath: Iterable): boolean; + getIn(keyPath: Iterable): unknown; + + // Value equality + + equals(other: unknown): boolean; + hashCode(): number; + + // Persistent changes + + set(key: K, value: TProps[K]): this; + update( + key: K, + updater: (value: TProps[K]) => TProps[K] + ): this; + merge( + ...collections: Array | Iterable<[string, unknown]>> + ): this; + mergeDeep( + ...collections: Array | Iterable<[string, unknown]>> + ): this; + + mergeWith( + merger: (oldVal: unknown, newVal: unknown, key: keyof TProps) => unknown, + ...collections: Array | Iterable<[string, unknown]>> + ): this; + mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + ...collections: Array | Iterable<[string, unknown]>> + ): this; + + /** + * Returns a new instance of this Record type with the value for the + * specific key set to its default value. + * + * @alias remove + */ + delete(key: K): this; + remove(key: K): this; + + /** + * Returns a new instance of this Record type with all values set + * to their default values. + */ + clear(): this; + + // Deep persistent changes + + setIn(keyPath: Iterable, value: unknown): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + /** + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + // Conversion to JavaScript types + + /** + * Deeply converts this Record to equivalent native JavaScript Object. + * + * Note: This method may not be overridden. Objects with custom + * serialization to plain JS may override toJSON() instead. + */ + toJS(): DeepCopy; + + /** + * Shallowly converts this Record to equivalent native JavaScript Object. + */ + toJSON(): TProps; + + /** + * Shallowly converts this Record to equivalent JavaScript Object. + */ + toObject(): TProps; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `set` may be used mutatively. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + toSeq(): Seq.Keyed; + + [Symbol.iterator](): IterableIterator<[keyof TProps, TProps[keyof TProps]]>; + } + + /** + * RecordOf is used in TypeScript to define interfaces expecting an + * instance of record with type T. + * + * This is equivalent to an instance of a record created by a Record Factory. + */ + type RecordOf = Record & Readonly; + + /** + * `Seq` describes a lazy operation, allowing them to efficiently chain + * use of all the higher-order collection methods (such as `map` and `filter`) + * by not creating intermediate collections. + * + * **Seq is immutable** — Once a Seq is created, it cannot be + * changed, appended to, rearranged or otherwise modified. Instead, any + * mutative method called on a `Seq` will return a new `Seq`. + * + * **Seq is lazy** — `Seq` does as little work as necessary to respond to any + * method call. Values are often created during iteration, including implicit + * iteration when reducing or converting to a concrete data structure such as + * a `List` or JavaScript `Array`. + * + * For example, the following performs no work, because the resulting + * `Seq`'s values are never iterated: + * + * ```js + * import { Seq } from 'immutable' + * const oddSquares = Seq([ 1, 2, 3, 4, 5, 6, 7, 8 ]) + * .filter(x => x % 2 !== 0) + * .map(x => x * x) + * ``` + * + * Once the `Seq` is used, it performs only the work necessary. In this + * example, no intermediate arrays are ever created, filter is called three + * times, and map is only called once: + * + * ```js + * oddSquares.get(1); // 9 + * ``` + * + * Any collection can be converted to a lazy Seq with `Seq()`. + * + * `Seq` allows for the efficient chaining of operations, allowing for the + * expression of logic that can otherwise be very tedious: + * + * ```js + * lazySeq + * .flip() + * .map(key => key.toUpperCase()) + * .flip() + * // Seq { A: 1, B: 1, C: 1 } + * ``` + * + * As well as expressing logic that would otherwise seem memory or time + * limited, for example `Range` is a special kind of Lazy sequence. + * + * Seq is often used to provide a rich collection API to JavaScript Object. + * + * ```js + * Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); + * // { x: 0, y: 2, z: 4 } + * ``` + */ + + namespace Seq { + /** + * True if `maybeSeq` is a Seq, it is not backed by a concrete + * structure such as Map, List, or Set. + */ + function isSeq( + maybeSeq: unknown + ): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set; + + /** + * `Seq` which represents key-value pairs. + */ + namespace Keyed {} + + /** + * Always returns a Seq.Keyed, if input is not keyed, expects an + * collection of [K, V] tuples. + * + * Note: `Seq.Keyed` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Keyed(collection?: Iterable<[K, V]>): Seq.Keyed; + function Keyed(obj: { [key: string]: V }): Seq.Keyed; + + interface Keyed extends Seq, Collection.Keyed { + /** + * Deeply converts this Keyed Seq to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJS(): { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Keyed Seq to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array<[K, V]>; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat( + ...collections: Array> + ): Seq.Keyed; + concat( + ...collections: Array<{ [key: string]: C }> + ): Seq.Keyed; + + /** + * Returns a new Seq.Keyed with values passed through a + * `mapper` function. + * + * ```js + * import { Seq } from 'immutable' + * Seq.Keyed({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq.Keyed; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Seq.Keyed; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Seq.Keyed; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Seq.Keyed; + + /** + * Returns a new Seq with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Seq.Keyed; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new keyed Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Seq.Keyed, Seq.Keyed]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): Seq.Keyed; + + [Symbol.iterator](): IterableIterator<[K, V]>; + } + + /** + * `Seq` which represents an ordered indexed list of values. + */ + namespace Indexed { + /** + * Provides an Seq.Indexed of the values provided. + */ + function of(...values: Array): Seq.Indexed; + } + + /** + * Always returns Seq.Indexed, discarding associated keys and + * supplying incrementing indices. + * + * Note: `Seq.Indexed` is a conversion function and not a class, and does + * not use the `new` keyword during construction. + */ + function Indexed( + collection?: Iterable | ArrayLike + ): Seq.Indexed; + + interface Indexed extends Seq, Collection.Indexed { + /** + * Deeply converts this Indexed Seq to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Indexed Seq to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + */ + concat( + ...valuesOrCollections: Array | C> + ): Seq.Indexed; + + /** + * Returns a new Seq.Indexed with values passed through a + * `mapper` function. + * + * ```js + * import { Seq } from 'immutable' + * Seq.Indexed([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Seq.Indexed; + + /** + * Flat-maps the Seq, returning a a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Seq.Indexed; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Seq.Indexed; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new indexed Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [Seq.Indexed, Seq.Indexed]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a Seq "zipped" with the provided collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = Seq([ 1, 2, 3 ]); + * const b = Seq([ 4, 5, 6 ]); + * const c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Seq.Indexed<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Seq.Indexed<[T, U, V]>; + zip( + ...collections: Array> + ): Seq.Indexed; + + /** + * Returns a Seq "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = Seq([ 1, 2 ]); + * const b = Seq([ 3, 4, 5 ]); + * const c = a.zipAll(b); // Seq [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + */ + zipAll(other: Collection): Seq.Indexed<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Seq.Indexed<[T, U, V]>; + zipAll( + ...collections: Array> + ): Seq.Indexed; + + /** + * Returns a Seq "zipped" with the provided collections by using a + * custom `zipper` function. + * + * ```js + * const a = Seq([ 1, 2, 3 ]); + * const b = Seq([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // Seq [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Seq.Indexed; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Seq.Indexed; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Seq.Indexed; + + [Symbol.iterator](): IterableIterator; + } + + /** + * `Seq` which represents a set of values. + * + * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee + * of value uniqueness as the concrete `Set`. + */ + namespace Set { + /** + * Returns a Seq.Set of the provided values + */ + function of(...values: Array): Seq.Set; + } + + /** + * Always returns a Seq.Set, discarding associated indices or keys. + * + * Note: `Seq.Set` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Seq.Set; + + interface Set extends Seq, Collection.Set { + /** + * Deeply converts this Set Seq to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Set Seq to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * are duplicates. + */ + concat(...collections: Array>): Seq.Set; + + /** + * Returns a new Seq.Set with values passed through a + * `mapper` function. + * + * ```js + * Seq.Set([ 1, 2 ]).map(x => 10 * x) + * // Seq { 10, 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Seq.Set; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Seq.Set; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Seq.Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new set Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Seq.Set, Seq.Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + } + + /** + * Creates a Seq. + * + * Returns a particular kind of `Seq` based on the input. + * + * * If a `Seq`, that same `Seq`. + * * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set). + * * If an Array-like, an `Seq.Indexed`. + * * If an Iterable Object, an `Seq.Indexed`. + * * If an Object, a `Seq.Keyed`. + * + * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, + * which is usually not what you want. You should turn your Iterator Object into + * an iterable object by defining a Symbol.iterator (or @@iterator) method which + * returns `this`. + * + * Note: `Seq` is a conversion function and not a class, and does not use the + * `new` keyword during construction. + */ + function Seq>(seq: S): S; + function Seq(collection: Collection.Keyed): Seq.Keyed; + function Seq(collection: Collection.Set): Seq.Set; + function Seq( + collection: Collection.Indexed | Iterable | ArrayLike + ): Seq.Indexed; + function Seq(obj: { [key: string]: V }): Seq.Keyed; + function Seq(): Seq; + + interface Seq extends Collection { + /** + * Some Seqs can describe their size lazily. When this is the case, + * size will be an integer. Otherwise it will be undefined. + * + * For example, Seqs returned from `map()` or `reverse()` + * preserve the size of the original `Seq` while `filter()` does not. + * + * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will + * always have a size. + */ + readonly size: number | undefined; + + // Force evaluation + + /** + * Because Sequences are lazy and designed to be chained together, they do + * not cache their results. For example, this map function is called a total + * of 6 times, as each `join` iterates the Seq of three values. + * + * var squares = Seq([ 1, 2, 3 ]).map(x => x * x) + * squares.join() + squares.join() + * + * If you know a `Seq` will be used multiple times, it may be more + * efficient to first cache it in memory. Here, the map function is called + * only 3 times. + * + * var squares = Seq([ 1, 2, 3 ]).map(x => x * x).cacheResult() + * squares.join() + squares.join() + * + * Use this method judiciously, as it must fully evaluate a Seq which can be + * a burden on memory and possibly performance. + * + * Note: after calling `cacheResult`, a Seq will always have a `size`. + */ + cacheResult(): this; + + // Sequence algorithms + + /** + * Returns a new Seq with values passed through a + * `mapper` function. + * + * ```js + * import { Seq } from 'immutable' + * Seq([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq; + + /** + * Returns a new Seq with values passed through a + * `mapper` function. + * + * ```js + * import { Seq } from 'immutable' + * Seq([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + * Note: used only for sets. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Seq; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + * Note: Used only for sets. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Seq; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Seq; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Seq with the values for which the `predicate` function + * returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Seq, Seq]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a new Sequence of the same type with other values and + * collection-like concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat(...valuesOrCollections: Array): Seq; + } + + /** + * The `Collection` is a set of (key, value) entries which can be iterated, and + * is the base class for all collections in `immutable`, allowing them to + * make use of all the Collection methods (such as `map` and `filter`). + * + * Note: A collection is always iterated in the same order, however that order + * may not always be well defined, as is the case for the `Map` and `Set`. + * + * Collection is the abstract base class for concrete data structures. It + * cannot be constructed directly. + * + * Implementations should extend one of the subclasses, `Collection.Keyed`, + * `Collection.Indexed`, or `Collection.Set`. + */ + namespace Collection { + /** + * Keyed Collections have discrete keys tied to each value. + * + * When iterating `Collection.Keyed`, each iteration will yield a `[K, V]` + * tuple, in other words, `Collection#entries` is the default iterator for + * Keyed Collections. + */ + namespace Keyed {} + + /** + * Creates a Collection.Keyed + * + * Similar to `Collection()`, however it expects collection-likes of [K, V] + * tuples if not constructed from a Collection.Keyed or JS Object. + * + * Note: `Collection.Keyed` is a conversion function and not a class, and + * does not use the `new` keyword during construction. + */ + function Keyed(collection?: Iterable<[K, V]>): Collection.Keyed; + function Keyed(obj: { [key: string]: V }): Collection.Keyed; + + interface Keyed extends Collection { + /** + * Deeply converts this Keyed collection to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJS(): { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Keyed collection to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array<[K, V]>; + + /** + * Returns Seq.Keyed. + * @override + */ + toSeq(): Seq.Keyed; + + // Sequence functions + + /** + * Returns a new Collection.Keyed of the same type where the keys and values + * have been flipped. + */ + flip(): Collection.Keyed; + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat( + ...collections: Array> + ): Collection.Keyed; + concat( + ...collections: Array<{ [key: string]: C }> + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed with values passed through a + * `mapper` function. + * + * ```js + * import { Collection } from 'immutable' + * Collection.Keyed({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed of the same type with keys passed through + * a `mapper` function. + * + * Note: `mapKeys()` always returns a new instance, even if it produced + * the same key at every step. + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed of the same type with entries + * ([key, value] tuples) passed through a `mapper` function. + * + * Note: `mapEntries()` always returns a new instance, even if it produced + * the same entry at every step. + * + * If the mapper function returns `undefined`, then the entry will be filtered + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Collection.Keyed; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Collection.Keyed; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new keyed Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Collection.Keyed, Collection.Keyed]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator<[K, V]>; + } + + /** + * Indexed Collections have incrementing numeric keys. They exhibit + * slightly different behavior than `Collection.Keyed` for some methods in order + * to better mirror the behavior of JavaScript's `Array`, and add methods + * which do not make sense on non-indexed Collections such as `indexOf`. + * + * Unlike JavaScript arrays, `Collection.Indexed`s are always dense. "Unset" + * indices and `undefined` indices are indistinguishable, and all indices from + * 0 to `size` are visited when iterated. + * + * All Collection.Indexed methods return re-indexed Collections. In other words, + * indices always start at 0 and increment until size. If you wish to + * preserve indices, using them as keys, convert to a Collection.Keyed by + * calling `toKeyedSeq`. + */ + namespace Indexed {} + + /** + * Creates a new Collection.Indexed. + * + * Note: `Collection.Indexed` is a conversion function and not a class, and + * does not use the `new` keyword during construction. + */ + function Indexed( + collection?: Iterable | ArrayLike + ): Collection.Indexed; + + interface Indexed extends Collection, OrderedCollection { + /** + * Deeply converts this Indexed collection to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Indexed collection to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + // Reading values + + /** + * Returns the value associated with the provided index, or notSetValue if + * the index is beyond the bounds of the Collection. + * + * `index` may be a negative number, which indexes back from the end of the + * Collection. `s.get(-1)` gets the last item in the Collection. + */ + get(index: number, notSetValue: NSV): T | NSV; + get(index: number): T | undefined; + + // Conversion to Seq + + /** + * Returns Seq.Indexed. + * @override + */ + toSeq(): Seq.Indexed; + + /** + * If this is a collection of [key, value] entry tuples, it will return a + * Seq.Keyed of those entries. + */ + fromEntrySeq(): Seq.Keyed; + + // Combination + + /** + * Returns a Collection of the same type with `separator` between each item + * in this Collection. + */ + interpose(separator: T): this; + + /** + * Returns a Collection of the same type with the provided `collections` + * interleaved into this collection. + * + * The resulting Collection includes the first item from each, then the + * second from each, etc. + * + * The shortest Collection stops interleave. + * + * Since `interleave()` re-indexes values, it produces a complete copy, + * which has `O(N)` complexity. + * + * Note: `interleave` *cannot* be used in `withMutations`. + */ + interleave(...collections: Array>): this; + + /** + * Splice returns a new indexed Collection by replacing a region of this + * Collection with new values. If values are not provided, it only skips the + * region to be removed. + * + * `index` may be a negative number, which indexes back from the end of the + * Collection. `s.splice(-2)` splices after the second to last item. + * + * Since `splice()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `splice` *cannot* be used in `withMutations`. + */ + splice(index: number, removeNum: number, ...values: Array): this; + + /** + * Returns a Collection of the same type "zipped" with the provided + * collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + */ + zip(other: Collection): Collection.Indexed<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Collection.Indexed<[T, U, V]>; + zip( + ...collections: Array> + ): Collection.Indexed; + + /** + * Returns a Collection "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = List([ 1, 2 ]); + * const b = List([ 3, 4, 5 ]); + * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + */ + zipAll(other: Collection): Collection.Indexed<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Collection.Indexed<[T, U, V]>; + zipAll( + ...collections: Array> + ): Collection.Indexed; + + /** + * Returns a Collection of the same type "zipped" with the provided + * collections by using a custom `zipper` function. + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Collection.Indexed; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Collection.Indexed; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Collection.Indexed; + + // Search for value + + /** + * Returns the first index at which a given value can be found in the + * Collection, or -1 if it is not present. + */ + indexOf(searchValue: T): number; + + /** + * Returns the last index at which a given value can be found in the + * Collection, or -1 if it is not present. + */ + lastIndexOf(searchValue: T): number; + + /** + * Returns the first index in the Collection where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findIndex( + predicate: (value: T, index: number, iter: this) => boolean, + context?: unknown + ): number; + + /** + * Returns the last index in the Collection where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findLastIndex( + predicate: (value: T, index: number, iter: this) => boolean, + context?: unknown + ): number; + + // Sequence algorithms + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat( + ...valuesOrCollections: Array | C> + ): Collection.Indexed; + + /** + * Returns a new Collection.Indexed with values passed through a + * `mapper` function. + * + * ```js + * import { Collection } from 'immutable' + * Collection.Indexed([1,2]).map(x => 10 * x) + * // Seq [ 1, 2 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Collection.Indexed; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Collection.Indexed; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Collection.Indexed; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new indexed Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [Collection.Indexed, Collection.Indexed]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + + /** + * Set Collections only represent values. They have no associated keys or + * indices. Duplicate values are possible in the lazy `Seq.Set`s, however + * the concrete `Set` Collection does not allow duplicate values. + * + * Collection methods on Collection.Set such as `map` and `forEach` will provide + * the value as both the first and second arguments to the provided function. + * + * ```js + * import { Collection } from 'immutable' + * const seq = Collection.Set([ 'A', 'B', 'C' ]) + * // Seq { "A", "B", "C" } + * seq.forEach((v, k) => + * assert.equal(v, k) + * ) + * ``` + */ + namespace Set {} + + /** + * Similar to `Collection()`, but always returns a Collection.Set. + * + * Note: `Collection.Set` is a factory function and not a class, and does + * not use the `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Collection.Set; + + interface Set extends Collection { + /** + * Deeply converts this Set collection to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Set collection to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns Seq.Set. + * @override + */ + toSeq(): Seq.Set; + + // Sequence algorithms + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat(...collections: Array>): Collection.Set; + + /** + * Returns a new Collection.Set with values passed through a + * `mapper` function. + * + * ``` + * Collection.Set([ 1, 2 ]).map(x => 10 * x) + * // Seq { 1, 2 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Collection.Set; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Collection.Set; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Collection.Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new set Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Collection.Set, Collection.Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + } + + /** + * Creates a Collection. + * + * The type of Collection created is based on the input. + * + * * If an `Collection`, that same `Collection`. + * * If an Array-like, an `Collection.Indexed`. + * * If an Object with an Iterator defined, an `Collection.Indexed`. + * * If an Object, an `Collection.Keyed`. + * + * This methods forces the conversion of Objects and Strings to Collections. + * If you want to ensure that a Collection of one item is returned, use + * `Seq.of`. + * + * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, + * which is usually not what you want. You should turn your Iterator Object into + * an iterable object by defining a Symbol.iterator (or @@iterator) method which + * returns `this`. + * + * Note: `Collection` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Collection>(collection: I): I; + function Collection( + collection: Iterable | ArrayLike + ): Collection.Indexed; + function Collection(obj: { + [key: string]: V; + }): Collection.Keyed; + function Collection(): Collection; + + interface Collection extends ValueObject { + // Value equality + + /** + * True if this and the other Collection have value equality, as defined + * by `Immutable.is()`. + * + * Note: This is equivalent to `Immutable.is(this, other)`, but provided to + * allow for chained expressions. + */ + equals(other: unknown): boolean; + + /** + * Computes and returns the hashed identity for this Collection. + * + * The `hashCode` of a Collection is used to determine potential equality, + * and is used when adding this to a `Set` or as a key in a `Map`, enabling + * lookup via a different instance. + * + * If two values have the same `hashCode`, they are [not guaranteed + * to be equal][Hash Collision]. If two values have different `hashCode`s, + * they must not be equal. + * + * [Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + */ + hashCode(): number; + + // Reading values + + /** + * Returns the value associated with the provided key, or notSetValue if + * the Collection does not contain this key. + * + * Note: it is possible a key may be associated with an `undefined` value, + * so if `notSetValue` is not provided and this method returns `undefined`, + * that does not guarantee the key was not found. + */ + get(key: K, notSetValue: NSV): V | NSV; + get(key: K): V | undefined; + + /** + * True if a key exists within this `Collection`, using `Immutable.is` + * to determine equality + */ + has(key: K): boolean; + + /** + * True if a value exists within this `Collection`, using `Immutable.is` + * to determine equality + * @alias contains + */ + includes(value: V): boolean; + contains(value: V): boolean; + + /** + * In case the `Collection` is not empty returns the first element of the + * `Collection`. + * In case the `Collection` is empty returns the optional default + * value if provided, if no default value is provided returns undefined. + */ + first(notSetValue: NSV): V | NSV; + first(): V | undefined; + + /** + * In case the `Collection` is not empty returns the last element of the + * `Collection`. + * In case the `Collection` is empty returns the optional default + * value if provided, if no default value is provided returns undefined. + */ + last(notSetValue: NSV): V | NSV; + last(): V | undefined; + + // Reading deep values + + /** + * Returns the value found by following a path of keys or indices through + * nested Collections. + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and getIn() can access those values as well: + */ + getIn(searchKeyPath: Iterable, notSetValue?: unknown): unknown; + + /** + * True if the result of following a path of keys or indices through nested + * Collections results in a set value. + */ + hasIn(searchKeyPath: Iterable): boolean; + + // Persistent changes + + /** + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum a Seq after mapping and filtering: + */ + update(updater: (value: this) => R): R; + + // Conversion to JavaScript types + + /** + * Deeply converts this Collection to equivalent native JavaScript Array or Object. + * + * `Collection.Indexed`, and `Collection.Set` become `Array`, while + * `Collection.Keyed` become `Object`, converting keys to Strings. + */ + toJS(): Array> | { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Collection to equivalent native JavaScript Array or Object. + * + * `Collection.Indexed`, and `Collection.Set` become `Array`, while + * `Collection.Keyed` become `Object`, converting keys to Strings. + */ + toJSON(): Array | { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + * + * `Collection.Indexed`, and `Collection.Set` produce an Array of values. + * `Collection.Keyed` produce an Array of [key, value] tuples. + */ + toArray(): Array | Array<[K, V]>; + + /** + * Shallowly converts this Collection to an Object. + * + * Converts keys to Strings. + */ + toObject(): { [key: string]: V }; + + // Conversion to Collections + + /** + * Converts this Collection to a Map, Throws if keys are not hashable. + * + * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toMap(): Map; + + /** + * Converts this Collection to a Map, maintaining the order of iteration. + * + * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but + * provided for convenience and to allow for chained expressions. + */ + toOrderedMap(): OrderedMap; + + /** + * Converts this Collection to a Set, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Set(this)`, but provided to allow for + * chained expressions. + */ + toSet(): Set; + + /** + * Converts this Collection to a Set, maintaining the order of iteration and + * discarding keys. + * + * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toOrderedSet(): OrderedSet; + + /** + * Converts this Collection to a List, discarding keys. + * + * This is similar to `List(collection)`, but provided to allow for chained + * expressions. However, when called on `Map` or other keyed collections, + * `collection.toList()` discards the keys and creates a list of only the + * values, whereas `List(collection)` creates a list of entry tuples. + */ + toList(): List; + + /** + * Converts this Collection to a Stack, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Stack(this)`, but provided to allow for + * chained expressions. + */ + toStack(): Stack; + + // Conversion to Seq + + /** + * Converts this Collection to a Seq of the same kind (indexed, + * keyed, or set). + */ + toSeq(): Seq; + + /** + * Returns a Seq.Keyed from this Collection where indices are treated as keys. + * + * This is useful if you want to operate on an + * Collection.Indexed and preserve the [index, value] pairs. + * + * The returned Seq will have identical iteration order as + * this Collection. + */ + toKeyedSeq(): Seq.Keyed; + + /** + * Returns an Seq.Indexed of the values of this Collection, discarding keys. + */ + toIndexedSeq(): Seq.Indexed; + + /** + * Returns a Seq.Set of the values of this Collection, discarding keys. + */ + toSetSeq(): Seq.Set; + + // Iterators + + /** + * An iterator of this `Collection`'s keys. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `keySeq` instead, if this is + * what you want. + */ + keys(): IterableIterator; + + /** + * An iterator of this `Collection`'s values. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `valueSeq` instead, if this is + * what you want. + */ + values(): IterableIterator; + + /** + * An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `entrySeq` instead, if this is + * what you want. + */ + entries(): IterableIterator<[K, V]>; + + [Symbol.iterator](): IterableIterator; + + // Collections (Seq) + + /** + * Returns a new Seq.Indexed of the keys of this Collection, + * discarding values. + */ + keySeq(): Seq.Indexed; + + /** + * Returns an Seq.Indexed of the values of this Collection, discarding keys. + */ + valueSeq(): Seq.Indexed; + + /** + * Returns a new Seq.Indexed of [key, value] tuples. + */ + entrySeq(): Seq.Indexed<[K, V]>; + + // Sequence algorithms + + /** + * Returns a new Collection of the same type with values passed through a + * `mapper` function. + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Collection; + + /** + * Note: used only for sets, which return Collection but are otherwise + * identical to normal `map()`. + * + * @ignore + */ + map(...args: Array): unknown; + + /** + * Returns a new Collection of the same type with only the entries for which + * the `predicate` function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Collection; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type with only the entries for which + * the `predicate` function returns false. + * + * Note: `filterNot()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filterNot( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Collection, Collection]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a new Collection of the same type in reverse order. + */ + reverse(): this; + + /** + * Returns a new Collection of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * When sorting collections which have no defined order, their ordered + * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): this; + + /** + * Returns a `Map` of `Collection`, grouped by the return + * value of the `grouper` function. + * + * Note: This is always an eager operation. + */ + groupBy( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map; + + // Side effects + + /** + * The `sideEffect` is executed for every entry in the Collection. + * + * Unlike `Array#forEach`, if any call of `sideEffect` returns + * `false`, the iteration will stop. Returns the number of entries iterated + * (including the last iteration which returned false). + */ + forEach( + sideEffect: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): number; + + // Creating subsets + + /** + * Returns a new Collection of the same type representing a portion of this + * Collection from start up to but not including end. + * + * If begin is negative, it is offset from the end of the Collection. e.g. + * `slice(-2)` returns a Collection of the last two entries. If it is not + * provided the new Collection will begin at the beginning of this Collection. + * + * If end is negative, it is offset from the end of the Collection. e.g. + * `slice(0, -1)` returns a Collection of everything but the last entry. If + * it is not provided, the new Collection will continue through the end of + * this Collection. + * + * If the requested slice is equivalent to the current Collection, then it + * will return itself. + */ + slice(begin?: number, end?: number): this; + + /** + * Returns a new Collection of the same type containing all entries except + * the first. + */ + rest(): this; + + /** + * Returns a new Collection of the same type containing all entries except + * the last. + */ + butLast(): this; + + /** + * Returns a new Collection of the same type which excludes the first `amount` + * entries from this Collection. + */ + skip(amount: number): this; + + /** + * Returns a new Collection of the same type which excludes the last `amount` + * entries from this Collection. + */ + skipLast(amount: number): this; + + /** + * Returns a new Collection of the same type which includes entries starting + * from when `predicate` first returns false. + */ + skipWhile( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes entries starting + * from when `predicate` first returns true. + */ + skipUntil( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes the first `amount` + * entries from this Collection. + */ + take(amount: number): this; + + /** + * Returns a new Collection of the same type which includes the last `amount` + * entries from this Collection. + */ + takeLast(amount: number): this; + + /** + * Returns a new Collection of the same type which includes entries from this + * Collection as long as the `predicate` returns true. + */ + takeWhile( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes entries from this + * Collection as long as the `predicate` returns false. + */ + takeUntil( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + // Combination + + /** + * Returns a new Collection of the same type with other values and + * collection-like concatenated to this one. + * + * For Seqs, all entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat( + ...valuesOrCollections: Array + ): Collection; + + /** + * Flattens nested Collections. + * + * Will deeply flatten the Collection by default, returning a Collection of the + * same type, but a `depth` can be provided in the form of a number or + * boolean (where true means to shallowly flatten one level). A depth of 0 + * (or shallow: false) will deeply flatten. + * + * Flattens only others Collection, not Arrays or Objects. + * + * Note: `flatten(true)` operates on Collection> and + * returns Collection + */ + flatten(depth?: number): Collection; + flatten(shallow?: boolean): Collection; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Collection; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + * Used for Dictionaries only. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Collection; + + // Reducing a value + + /** + * Reduces the Collection to a value by calling the `reducer` for every entry + * in the Collection and passing along the reduced value. + * + * If `initialReduction` is not provided, the first item in the + * Collection will be used. + * + * @see `Array#reduce`. + */ + reduce(reducer: (reduction: V, value: V, key: K, iter: this) => V): V; + reduce( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: unknown + ): R; + reduce( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + /** + * Reduces the Collection in reverse (from the right side). + * + * Note: Similar to this.reverse().reduce(), and provided for parity + * with `Array#reduceRight`. + */ + reduceRight(reducer: (reduction: V, value: V, key: K, iter: this) => V): V; + reduceRight( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: unknown + ): R; + reduceRight( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + /** + * True if `predicate` returns true for all entries in the Collection. + */ + every( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): boolean; + + /** + * True if `predicate` returns true for any entry in the Collection. + */ + some( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): boolean; + + /** + * Joins values together as a string, inserting a separator between each. + * The default separator is `","`. + */ + join(separator?: string): string; + + /** + * Returns true if this Collection includes no values. + * + * For some lazy `Seq`, `isEmpty` might need to iterate to determine + * emptiness. At most one iteration will occur. + */ + isEmpty(): boolean; + + /** + * Returns the size of this Collection. + * + * Regardless of if this Collection can describe its size lazily (some Seqs + * cannot), this method will always return the correct size. E.g. it + * evaluates a lazy `Seq` if necessary. + * + * If `predicate` is provided, then this returns the count of entries in the + * Collection for which the `predicate` returns true. + */ + count(): number; + count( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): number; + + /** + * Returns a `Seq.Keyed` of counts, grouped by the return value of + * the `grouper` function. + * + * Note: This is not a lazy operation. + */ + countBy( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map; + + // Search for value + + /** + * Returns the first value for which the `predicate` returns true. + */ + find( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): V | undefined; + + /** + * Returns the last value for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLast( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): V | undefined; + + /** + * Returns the first [key, value] entry for which the `predicate` returns true. + */ + findEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined; + + /** + * Returns the last [key, value] entry for which the `predicate` + * returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined; + + /** + * Returns the key for which the `predicate` returns true. + */ + findKey( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): K | undefined; + + /** + * Returns the last key for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastKey( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): K | undefined; + + /** + * Returns the key associated with the search value, or undefined. + */ + keyOf(searchValue: V): K | undefined; + + /** + * Returns the last key associated with the search value, or undefined. + */ + lastKeyOf(searchValue: V): K | undefined; + + /** + * Returns the maximum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Collection#sort`. If it is not + * provided, the default comparator is `>`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `max` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `>` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + max(comparator?: Comparator): V | undefined; + + /** + * Like `max`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + */ + maxBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined; + + /** + * Returns the minimum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Collection#sort`. If it is not + * provided, the default comparator is `<`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `min` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `<` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + min(comparator?: Comparator): V | undefined; + + /** + * Like `min`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + */ + minBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined; + + // Comparison + + /** + * True if `iter` includes every value in this Collection. + */ + isSubset(iter: Iterable): boolean; + + /** + * True if this Collection includes every value in `iter`. + */ + isSuperset(iter: Iterable): boolean; + } + + /** + * The interface to fulfill to qualify as a Value Object. + */ + interface ValueObject { + /** + * True if this and the other Collection have value equality, as defined + * by `Immutable.is()`. + * + * Note: This is equivalent to `Immutable.is(this, other)`, but provided to + * allow for chained expressions. + */ + equals(other: unknown): boolean; + + /** + * Computes and returns the hashed identity for this Collection. + * + * The `hashCode` of a Collection is used to determine potential equality, + * and is used when adding this to a `Set` or as a key in a `Map`, enabling + * lookup via a different instance. + * + * Note: hashCode() MUST return a Uint32 number. The easiest way to + * guarantee this is to return `myHash | 0` from a custom implementation. + * + * If two values have the same `hashCode`, they are [not guaranteed + * to be equal][Hash Collision]. If two values have different `hashCode`s, + * they must not be equal. + * + * Note: `hashCode()` is not guaranteed to always be called before + * `equals()`. Most but not all Immutable.js collections use hash codes to + * organize their internal data structures, while all Immutable.js + * collections use equality during lookups. + * + * [Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + */ + hashCode(): number; + } + + /** + * Interface representing all oredered collections. + * This includes `List`, `Stack`, `Map`, `OrderedMap`, `Set`, and `OrderedSet`. + * return of `isOrdered()` return true in that case. + */ + interface OrderedCollection { + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + [Symbol.iterator](): IterableIterator; + } + + /** + * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. + * + * `fromJS` will convert Arrays and [array-like objects][2] to a List, and + * plain objects (without a custom prototype) to a Map. [Iterable objects][3] + * may be converted to List, Map, or Set. + * + * If a `reviver` is optionally provided, it will be called with every + * collection as a Seq (beginning with the most nested collections + * and proceeding to the top-level collection itself), along with the key + * referring to each collection and the parent JS object provided as `this`. + * For the top level, object, the key will be `""`. This `reviver` is expected + * to return a new Immutable Collection, allowing for custom conversions from + * deep JS objects. Finally, a `path` is provided which is the sequence of + * keys to this value from the starting value. + * + * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. + * + * If `reviver` is not provided, the default behavior will convert Objects + * into Maps and Arrays into Lists like so: + * + * Accordingly, this example converts native JS data to OrderedMap and List: + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + * + * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter + * "Using the reviver parameter" + * [2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects + * "Working with array-like objects" + * [3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol + * "The iterable protocol" + */ + function fromJS( + jsValue: JSValue, + reviver?: undefined + ): FromJS; + function fromJS( + jsValue: unknown, + reviver?: ( + key: string | number, + sequence: Collection.Keyed | Collection.Indexed, + path?: Array + ) => unknown + ): Collection; + + type FromJS = JSValue extends FromJSNoTransform + ? JSValue + : JSValue extends Array + ? FromJSArray + : JSValue extends object + ? FromJSObject + : unknown; + + type FromJSNoTransform = + | Collection + | number + | string + | null + | undefined; + + type FromJSArray = + JSValue extends Array ? List> : never; + + type FromJSObject = JSValue extends object + ? Map> + : never; + + /** + * Value equality check with semantics similar to `Object.is`, but treats + * Immutable `Collection`s as values, equal if the second `Collection` includes + * equivalent values. + * + * It's used throughout Immutable when checking for equality, including `Map` + * key equality and `Set` membership. + * + * `is()` compares primitive types like strings and numbers, Immutable.js + * collections like `Map` and `List`, but also any custom object which + * implements `ValueObject` by providing `equals()` and `hashCode()` methods. + * + * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same + * value, matching the behavior of ES6 Map key equality. + */ + function is(first: unknown, second: unknown): boolean; + + /** + * The `hash()` function is an important part of how Immutable determines if + * two values are equivalent and is used to determine how to store those + * values. Provided with any value, `hash()` will return a 31-bit integer. + * + * When designing Objects which may be equal, it's important that when a + * `.equals()` method returns true, that both values `.hashCode()` method + * return the same value. `hash()` may be used to produce those values. + * + * For non-Immutable Objects that do not provide a `.hashCode()` functions + * (including plain Objects, plain Arrays, Date objects, etc), a unique hash + * value will be created for each *instance*. That is, the create hash + * represents referential equality, and not value equality for Objects. This + * ensures that if that Object is mutated over time that its hash code will + * remain consistent, allowing Objects to be used as keys and values in + * Immutable.js collections. + * + * Note that `hash()` attempts to balance between speed and avoiding + * collisions, however it makes no attempt to produce secure hashes. + * + * *New in Version 4.0* + */ + function hash(value: unknown): number; + + /** + * True if `maybeImmutable` is an Immutable Collection or Record. + * + * Note: Still returns true even if the collections is within a `withMutations()`. + */ + function isImmutable( + maybeImmutable: unknown + ): maybeImmutable is Collection; + + /** + * True if `maybeCollection` is a Collection, or any of its subclasses. + */ + function isCollection( + maybeCollection: unknown + ): maybeCollection is Collection; + + /** + * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + */ + function isKeyed( + maybeKeyed: unknown + ): maybeKeyed is Collection.Keyed; + + /** + * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + */ + function isIndexed( + maybeIndexed: unknown + ): maybeIndexed is Collection.Indexed; + + /** + * True if `maybeAssociative` is either a Keyed or Indexed Collection. + */ + function isAssociative( + maybeAssociative: unknown + ): maybeAssociative is + | Collection.Keyed + | Collection.Indexed; + + /** + * True if `maybeOrdered` is a Collection where iteration order is well + * defined. True for Collection.Indexed as well as OrderedMap and OrderedSet. + */ + function isOrdered( + maybeOrdered: Iterable + ): maybeOrdered is OrderedCollection; + function isOrdered( + maybeOrdered: unknown + ): maybeOrdered is OrderedCollection; + + /** + * True if `maybeValue` is a JavaScript Object which has *both* `equals()` + * and `hashCode()` methods. + * + * Any two instances of *value objects* can be compared for value equality with + * `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. + */ + function isValueObject(maybeValue: unknown): maybeValue is ValueObject; + + /** + * True if `maybeSeq` is a Seq. + */ + function isSeq( + maybeSeq: unknown + ): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set; + + /** + * True if `maybeList` is a List. + */ + function isList(maybeList: unknown): maybeList is List; + + /** + * True if `maybeMap` is a Map. + * + * Also true for OrderedMaps. + */ + function isMap(maybeMap: unknown): maybeMap is Map; + + /** + * True if `maybeOrderedMap` is an OrderedMap. + */ + function isOrderedMap( + maybeOrderedMap: unknown + ): maybeOrderedMap is OrderedMap; + + /** + * True if `maybeStack` is a Stack. + */ + function isStack(maybeStack: unknown): maybeStack is Stack; + + /** + * True if `maybeSet` is a Set. + * + * Also true for OrderedSets. + */ + function isSet(maybeSet: unknown): maybeSet is Set; + + /** + * True if `maybeOrderedSet` is an OrderedSet. + */ + function isOrderedSet( + maybeOrderedSet: unknown + ): maybeOrderedSet is OrderedSet; + + /** + * True if `maybeRecord` is a Record. + */ + function isRecord(maybeRecord: unknown): maybeRecord is Record; + + /** + * Returns the value within the provided collection associated with the + * provided key, or notSetValue if the key is not defined in the collection. + * + * A functional alternative to `collection.get(key)` which will also work on + * plain Objects and Arrays as an alternative for `collection[key]`. + */ + function get(collection: Collection, key: K): V | undefined; + function get( + collection: Collection, + key: K, + notSetValue: NSV + ): V | NSV; + function get( + record: Record, + key: K, + notSetValue: unknown + ): TProps[K]; + function get(collection: Array, key: number): V | undefined; + function get( + collection: Array, + key: number, + notSetValue: NSV + ): V | NSV; + function get( + object: C, + key: K, + notSetValue: unknown + ): C[K]; + function get( + collection: { [key: PropertyKey]: V }, + key: string + ): V | undefined; + function get( + collection: { [key: PropertyKey]: V }, + key: string, + notSetValue: NSV + ): V | NSV; + + /** + * Returns true if the key is defined in the provided collection. + * + * A functional alternative to `collection.has(key)` which will also work with + * plain Objects and Arrays as an alternative for + * `collection.hasOwnProperty(key)`. + */ + function has(collection: object, key: unknown): boolean; + + /** + * Returns a copy of the collection with the value at key removed. + * + * A functional alternative to `collection.remove(key)` which will also work + * with plain Objects and Arrays as an alternative for + * `delete collectionCopy[key]`. + */ + function remove>( + collection: C, + key: K + ): C; + function remove< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(collection: C, key: K): C; + function remove>(collection: C, key: number): C; + function remove(collection: C, key: K): C; + function remove( + collection: C, + key: K + ): C; + + /** + * Returns a copy of the collection with the value at key set to the provided + * value. + * + * A functional alternative to `collection.set(key, value)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = value`. + */ + function set>( + collection: C, + key: K, + value: V + ): C; + function set< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(record: C, key: K, value: TProps[K]): C; + function set>(collection: C, key: number, value: V): C; + function set(object: C, key: K, value: C[K]): C; + function set( + collection: C, + key: string, + value: V + ): C; + + /** + * Returns a copy of the collection with the value at key set to the result of + * providing the existing value to the updating function. + * + * A functional alternative to `collection.update(key, fn)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = fn(collection[key])`. + */ + function update>( + collection: C, + key: K, + updater: (value: V | undefined) => V | undefined + ): C; + function update, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): C; + function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(record: C, key: K, updater: (value: TProps[K]) => TProps[K]): C; + function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, + >( + record: C, + key: K, + notSetValue: NSV, + updater: (value: TProps[K] | NSV) => TProps[K] + ): C; + function update( + collection: Array, + key: number, + updater: (value: V | undefined) => V | undefined + ): Array; + function update( + collection: Array, + key: number, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): Array; + function update( + object: C, + key: K, + updater: (value: C[K]) => C[K] + ): C; + function update( + object: C, + key: K, + notSetValue: NSV, + updater: (value: C[K] | NSV) => C[K] + ): C; + function update( + collection: C, + key: K, + updater: (value: V) => V + ): { [key: string]: V }; + function update( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): { [key: string]: V }; + + // TODO `` can be used after dropping support for TypeScript 4.x + // reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters + // after this change, `as const` assertions can be remove from the type tests + /** + * Returns the value at the provided key path starting at the provided + * collection, or notSetValue if the key path is not defined. + * + * A functional alternative to `collection.getIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function getIn>( + object: C, + keyPath: [...P] + ): RetrievePath; + function getIn>(object: C, keyPath: P): unknown; + function getIn, NSV>( + collection: C, + keyPath: [...P], + notSetValue: NSV + ): RetrievePath extends never ? NSV : RetrievePath; + function getIn, NSV>( + object: C, + keyPath: P, + notSetValue: NSV + ): unknown; + + /** + * Returns true if the key path is defined in the provided collection. + * + * A functional alternative to `collection.hasIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function hasIn( + collection: string | boolean | number, + keyPath: KeyPath + ): never; + function hasIn(collection: unknown, keyPath: KeyPath): boolean; + + /** + * Returns a copy of the collection with the value at the key path removed. + * + * A functional alternative to `collection.removeIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function removeIn(collection: C, keyPath: Iterable): C; + + /** + * Returns a copy of the collection with the value at the key path set to the + * provided value. + * + * A functional alternative to `collection.setIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function setIn( + collection: C, + keyPath: Iterable, + value: unknown + ): C; + + /** + * Returns a copy of the collection with the value at key path set to the + * result of providing the existing value to the updating function. + * + * A functional alternative to `collection.updateIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function updateIn>( + collection: C, + keyPath: KeyPath, + updater: ( + value: RetrievePath> | undefined + ) => unknown | undefined + ): C; + function updateIn, NSV>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + >( + record: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): C; + function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, + >( + record: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn>( + collection: Array, + keyPath: KeyPath, + updater: ( + value: RetrievePath> | undefined + ) => unknown | undefined + ): Array; + function updateIn, NSV>( + collection: Array, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): Array; + function updateIn( + object: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): C; + function updateIn( + object: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn< + K extends PropertyKey, + V, + C extends { [key: PropertyKey]: V }, + >( + collection: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): { [key: PropertyKey]: V }; + function updateIn< + K extends PropertyKey, + V, + C extends { [key: PropertyKey]: V }, + NSV, + >( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): { [key: PropertyKey]: V }; + + /** + * Returns a copy of the collection with the remaining collections merged in. + * + * A functional alternative to `collection.merge()` which will also work with + * plain Objects and Arrays. + */ + function merge( + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Returns a copy of the collection with the remaining collections merged in, + * calling the `merger` function whenever an existing value is encountered. + * + * A functional alternative to `collection.mergeWith()` which will also work + * with plain Objects and Arrays. + */ + function mergeWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Like `merge()`, but when two compatible collections are encountered with + * the same key, it merges them as well, recursing deeply through the nested + * data. Two collections are considered to be compatible (and thus will be + * merged together) if they both fall into one of three categories: keyed + * (e.g., `Map`s, `Record`s, and objects), indexed (e.g., `List`s and + * arrays), or set-like (e.g., `Set`s). If they fall into separate + * categories, `mergeDeep` will replace the existing collection with the + * collection being merged in. This behavior can be customized by using + * `mergeDeepWith()`. + * + * Note: Indexed and set-like collections are merged using + * `concat()`/`union()` and therefore do not recurse. + * + * A functional alternative to `collection.mergeDeep()` which will also work + * with plain Objects and Arrays. + */ + function mergeDeep( + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Like `mergeDeep()`, but when two non-collections or incompatible + * collections are encountered at the same key, it uses the `merger` function + * to determine the resulting value. Collections are considered incompatible + * if they fall into separate categories between keyed, indexed, and set-like. + * + * A functional alternative to `collection.mergeDeepWith()` which will also + * work with plain Objects and Arrays. + */ + function mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; +} + +/** + * Defines the main export of the immutable module to be the Immutable namespace + * This supports many common module import patterns: + * + * const Immutable = require("immutable"); + * const { List } = require("immutable"); + * import Immutable from "immutable"; + * import * as Immutable from "immutable"; + * import { List } from "immutable"; + * + */ +export = Immutable; + +/** + * A global "Immutable" namespace used by UMD modules which allows the use of + * the full Immutable API. + * + * If using Immutable as an imported module, prefer using: + * + * import Immutable from 'immutable' + * + */ +export as namespace Immutable; diff --git a/tools/ui/node_modules/immutable/dist/immutable.es.js b/tools/ui/node_modules/immutable/dist/immutable.es.js new file mode 100644 index 0000000000000000000000000000000000000000..0120b956524498962f1bc812469d98c3e926b529 --- /dev/null +++ b/tools/ui/node_modules/immutable/dist/immutable.es.js @@ -0,0 +1,6373 @@ +/** + * @license + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +var IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@'; +/** + * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + * + * ```js + * import { isIndexed, Map, List, Stack, Set } from 'immutable'; + * + * isIndexed([]); // false + * isIndexed({}); // false + * isIndexed(Map()); // false + * isIndexed(List()); // true + * isIndexed(Stack()); // true + * isIndexed(Set()); // false + * ``` + */ +function isIndexed(maybeIndexed) { + return Boolean(maybeIndexed && + // @ts-expect-error: maybeIndexed is typed as `{}`, need to change in 6.0 to `maybeIndexed && typeof maybeIndexed === 'object' && IS_INDEXED_SYMBOL in maybeIndexed` + maybeIndexed[IS_INDEXED_SYMBOL]); +} + +var IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@'; +/** + * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + * + * ```js + * import { isKeyed, Map, List, Stack } from 'immutable'; + * + * isKeyed([]); // false + * isKeyed({}); // false + * isKeyed(Map()); // true + * isKeyed(List()); // false + * isKeyed(Stack()); // false + * ``` + */ +function isKeyed(maybeKeyed) { + return Boolean(maybeKeyed && + // @ts-expect-error: maybeKeyed is typed as `{}`, need to change in 6.0 to `maybeKeyed && typeof maybeKeyed === 'object' && IS_KEYED_SYMBOL in maybeKeyed` + maybeKeyed[IS_KEYED_SYMBOL]); +} + +/** + * True if `maybeAssociative` is either a Keyed or Indexed Collection. + * + * ```js + * import { isAssociative, Map, List, Stack, Set } from 'immutable'; + * + * isAssociative([]); // false + * isAssociative({}); // false + * isAssociative(Map()); // true + * isAssociative(List()); // true + * isAssociative(Stack()); // true + * isAssociative(Set()); // false + * ``` + */ +function isAssociative(maybeAssociative) { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); +} + +// Note: value is unchanged to not break immutable-devtools. +var IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@'; +/** + * True if `maybeCollection` is a Collection, or any of its subclasses. + * + * ```js + * import { isCollection, Map, List, Stack } from 'immutable'; + * + * isCollection([]); // false + * isCollection({}); // false + * isCollection(Map()); // true + * isCollection(List()); // true + * isCollection(Stack()); // true + * ``` + */ +function isCollection(maybeCollection) { + return Boolean(maybeCollection && + // @ts-expect-error: maybeCollection is typed as `{}`, need to change in 6.0 to `maybeCollection && typeof maybeCollection === 'object' && IS_COLLECTION_SYMBOL in maybeCollection` + maybeCollection[IS_COLLECTION_SYMBOL]); +} + +var Collection = function Collection(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) ? value : Seq(value); +}; + +var KeyedCollection = /*@__PURE__*/(function (Collection) { + function KeyedCollection(value) { + // eslint-disable-next-line no-constructor-return + return isKeyed(value) ? value : KeyedSeq(value); + } + + if ( Collection ) KeyedCollection.__proto__ = Collection; + KeyedCollection.prototype = Object.create( Collection && Collection.prototype ); + KeyedCollection.prototype.constructor = KeyedCollection; + + return KeyedCollection; +}(Collection)); + +var IndexedCollection = /*@__PURE__*/(function (Collection) { + function IndexedCollection(value) { + // eslint-disable-next-line no-constructor-return + return isIndexed(value) ? value : IndexedSeq(value); + } + + if ( Collection ) IndexedCollection.__proto__ = Collection; + IndexedCollection.prototype = Object.create( Collection && Collection.prototype ); + IndexedCollection.prototype.constructor = IndexedCollection; + + return IndexedCollection; +}(Collection)); + +var SetCollection = /*@__PURE__*/(function (Collection) { + function SetCollection(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) && !isAssociative(value) ? value : SetSeq(value); + } + + if ( Collection ) SetCollection.__proto__ = Collection; + SetCollection.prototype = Object.create( Collection && Collection.prototype ); + SetCollection.prototype.constructor = SetCollection; + + return SetCollection; +}(Collection)); + +Collection.Keyed = KeyedCollection; +Collection.Indexed = IndexedCollection; +Collection.Set = SetCollection; + +var ITERATE_KEYS = 0; +var ITERATE_VALUES = 1; +var ITERATE_ENTRIES = 2; +// TODO Symbol is widely available in modern JavaScript environments, clean this +var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; +// @ts-expect-error: properties are not supported in buble +var Iterator = function Iterator(next) { + // @ts-expect-error: properties are not supported in buble + this.next = next; +}; +Iterator.prototype.toString = function toString () { + return '[Iterator]'; +}; +// @ts-expect-error: static properties are not supported in buble +Iterator.KEYS = ITERATE_KEYS; +// @ts-expect-error: static properties are not supported in buble +Iterator.VALUES = ITERATE_VALUES; +// @ts-expect-error: static properties are not supported in buble +Iterator.ENTRIES = ITERATE_ENTRIES; +// @ts-expect-error: properties are not supported in buble +Iterator.prototype.inspect = Iterator.prototype.toSource = function () { + return this.toString(); +}; +// @ts-expect-error don't know how to type this +Iterator.prototype[ITERATOR_SYMBOL] = function () { + return this; +}; +function iteratorValue(type, k, v, iteratorResult) { + var value = type === ITERATE_KEYS ? k : type === ITERATE_VALUES ? v : [k, v]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + iteratorResult + ? (iteratorResult.value = value) + : (iteratorResult = { + // @ts-expect-error ensure value is not undefined + value: value, + done: false, + }); + return iteratorResult; +} +function iteratorDone() { + return { value: undefined, done: true }; +} +function hasIterator(maybeIterable) { + if (Array.isArray(maybeIterable)) { + // IE11 trick as it does not support `Symbol.iterator` + return true; + } + return !!getIteratorFn(maybeIterable); +} +function isIterator(maybeIterator) { + return !!(maybeIterator && + // @ts-expect-error: maybeIterator is typed as `{}` + typeof maybeIterator.next === 'function'); +} +function getIterator(iterable) { + var iteratorFn = getIteratorFn(iterable); + return iteratorFn && iteratorFn.call(iterable); +} +function getIteratorFn(iterable) { + var iteratorFn = iterable && + // @ts-expect-error: maybeIterator is typed as `{}` + ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || + // @ts-expect-error: maybeIterator is typed as `{}` + iterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } +} +function isEntriesIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + // @ts-expect-error: maybeIterator is typed as `{}` + return iteratorFn && iteratorFn === maybeIterable.entries; +} +function isKeysIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + // @ts-expect-error: maybeIterator is typed as `{}` + return iteratorFn && iteratorFn === maybeIterable.keys; +} + +// Used for setting prototype methods that IE8 chokes on. +var DELETE = 'delete'; +// Constants describing the size of trie nodes. +var SHIFT = 5; // Resulted in best performance after ______? +var SIZE = 1 << SHIFT; +var MASK = SIZE - 1; +// A consistent shared value representing "not set" which equals nothing other +// than itself, and nothing that could be provided externally. +var NOT_SET = {}; +// Boolean references, Rough equivalent of `bool &`. +function MakeRef() { + return { value: false }; +} +function SetRef(ref) { + if (ref) { + ref.value = true; + } +} +// A function which returns a value representing an "owner" for transient writes +// to tries. The return value will only ever equal itself, and will not equal +// the return of any subsequent call of this function. +function OwnerID() { } +function ensureSize(iter) { + // @ts-expect-error size should exists on Collection + if (iter.size === undefined) { + // @ts-expect-error size should exists on Collection, __iterate does exist on Collection + iter.size = iter.__iterate(returnTrue); + } + // @ts-expect-error size should exists on Collection + return iter.size; +} +function wrapIndex(iter, index) { + // This implements "is array index" which the ECMAString spec defines as: + // + // A String property name P is an array index if and only if + // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal + // to 2^32−1. + // + // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects + if (typeof index !== 'number') { + var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 + if ('' + uint32Index !== index || uint32Index === 4294967295) { + return NaN; + } + index = uint32Index; + } + return index < 0 ? ensureSize(iter) + index : index; +} +function returnTrue() { + return true; +} +function wholeSlice(begin, end, size) { + return (((begin === 0 && !isNeg(begin)) || + (size !== undefined && begin <= -size)) && + (end === undefined || (size !== undefined && end >= size))); +} +function resolveBegin(begin, size) { + return resolveIndex(begin, size, 0); +} +function resolveEnd(end, size) { + return resolveIndex(end, size, size); +} +function resolveIndex(index, size, defaultIndex) { + // Sanitize indices using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + return index === undefined + ? defaultIndex + : isNeg(index) + ? size === Infinity + ? size + : Math.max(0, size + index) | 0 + : size === undefined || size === index + ? index + : Math.min(size, index) | 0; +} +function isNeg(value) { + // Account for -0 which is negative, but not less than 0. + return value < 0 || (value === 0 && 1 / value === -Infinity); +} + +var IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@'; +/** + * True if `maybeRecord` is a Record. + */ +function isRecord(maybeRecord) { + return Boolean(maybeRecord && + // @ts-expect-error: maybeRecord is typed as `{}`, need to change in 6.0 to `maybeRecord && typeof maybeRecord === 'object' && IS_RECORD_SYMBOL in maybeRecord` + maybeRecord[IS_RECORD_SYMBOL]); +} + +/** + * True if `maybeImmutable` is an Immutable Collection or Record. + * + * Note: Still returns true even if the collections is within a `withMutations()`. + * + * ```js + * import { isImmutable, Map, List, Stack } from 'immutable'; + * isImmutable([]); // false + * isImmutable({}); // false + * isImmutable(Map()); // true + * isImmutable(List()); // true + * isImmutable(Stack()); // true + * isImmutable(Map().asMutable()); // true + * ``` + */ +function isImmutable(maybeImmutable) { + return isCollection(maybeImmutable) || isRecord(maybeImmutable); +} + +var IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@'; +function isOrdered(maybeOrdered) { + return Boolean(maybeOrdered && + // @ts-expect-error: maybeOrdered is typed as `{}`, need to change in 6.0 to `maybeOrdered && typeof maybeOrdered === 'object' && IS_ORDERED_SYMBOL in maybeOrdered` + maybeOrdered[IS_ORDERED_SYMBOL]); +} + +var IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@'; +/** + * True if `maybeSeq` is a Seq. + */ +function isSeq(maybeSeq) { + return Boolean(maybeSeq && + // @ts-expect-error: maybeSeq is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSeq === 'object' && MAYBE_SEQ_SYMBOL in maybeSeq` + maybeSeq[IS_SEQ_SYMBOL]); +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function isArrayLike(value) { + if (Array.isArray(value) || typeof value === 'string') { + return true; + } + // @ts-expect-error "Type 'unknown' is not assignable to type 'boolean'" : convert to Boolean + return (value && + typeof value === 'object' && + // @ts-expect-error check that `'length' in value &&` + Number.isInteger(value.length) && + // @ts-expect-error check that `'length' in value &&` + value.length >= 0 && + // @ts-expect-error check that `'length' in value &&` + (value.length === 0 + ? // Only {length: 0} is considered Array-like. + Object.keys(value).length === 1 + : // An object is only Array-like if it has a property where the last value + // in the array-like may be found (which could be undefined). + // @ts-expect-error check that `'length' in value &&` + value.hasOwnProperty(value.length - 1))); +} + +var Seq = /*@__PURE__*/(function (Collection) { + function Seq(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isImmutable(value) + ? value.toSeq() + : seqFromValue(value); + } + + if ( Collection ) Seq.__proto__ = Collection; + Seq.prototype = Object.create( Collection && Collection.prototype ); + Seq.prototype.constructor = Seq; + + Seq.prototype.toSeq = function toSeq () { + return this; + }; + + Seq.prototype.toString = function toString () { + return this.__toString('Seq {', '}'); + }; + + Seq.prototype.cacheResult = function cacheResult () { + if (!this._cache && this.__iterateUncached) { + this._cache = this.entrySeq().toArray(); + this.size = this._cache.length; + } + return this; + }; + + // abstract __iterateUncached(fn, reverse) + + Seq.prototype.__iterate = function __iterate (fn, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + while (i !== size) { + var entry = cache[reverse ? size - ++i : i++]; + if (fn(entry[1], entry[0], this) === false) { + break; + } + } + return i; + } + return this.__iterateUncached(fn, reverse); + }; + + // abstract __iteratorUncached(type, reverse) + + Seq.prototype.__iterator = function __iterator (type, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var entry = cache[reverse ? size - ++i : i++]; + return iteratorValue(type, entry[0], entry[1]); + }); + } + return this.__iteratorUncached(type, reverse); + }; + + return Seq; +}(Collection)); + +var KeyedSeq = /*@__PURE__*/(function (Seq) { + function KeyedSeq(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence().toKeyedSeq() + : isCollection(value) + ? isKeyed(value) + ? value.toSeq() + : value.fromEntrySeq() + : isRecord(value) + ? value.toSeq() + : keyedSeqFromValue(value); + } + + if ( Seq ) KeyedSeq.__proto__ = Seq; + KeyedSeq.prototype = Object.create( Seq && Seq.prototype ); + KeyedSeq.prototype.constructor = KeyedSeq; + + KeyedSeq.prototype.toKeyedSeq = function toKeyedSeq () { + return this; + }; + + return KeyedSeq; +}(Seq)); + +var IndexedSeq = /*@__PURE__*/(function (Seq) { + function IndexedSeq(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isCollection(value) + ? isKeyed(value) + ? value.entrySeq() + : value.toIndexedSeq() + : isRecord(value) + ? value.toSeq().entrySeq() + : indexedSeqFromValue(value); + } + + if ( Seq ) IndexedSeq.__proto__ = Seq; + IndexedSeq.prototype = Object.create( Seq && Seq.prototype ); + IndexedSeq.prototype.constructor = IndexedSeq; + + IndexedSeq.of = function of (/*...values*/) { + return IndexedSeq(arguments); + }; + + IndexedSeq.prototype.toIndexedSeq = function toIndexedSeq () { + return this; + }; + + IndexedSeq.prototype.toString = function toString () { + return this.__toString('Seq [', ']'); + }; + + return IndexedSeq; +}(Seq)); + +var SetSeq = /*@__PURE__*/(function (Seq) { + function SetSeq(value) { + // eslint-disable-next-line no-constructor-return + return ( + isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value) + ).toSetSeq(); + } + + if ( Seq ) SetSeq.__proto__ = Seq; + SetSeq.prototype = Object.create( Seq && Seq.prototype ); + SetSeq.prototype.constructor = SetSeq; + + SetSeq.of = function of (/*...values*/) { + return SetSeq(arguments); + }; + + SetSeq.prototype.toSetSeq = function toSetSeq () { + return this; + }; + + return SetSeq; +}(Seq)); + +Seq.isSeq = isSeq; +Seq.Keyed = KeyedSeq; +Seq.Set = SetSeq; +Seq.Indexed = IndexedSeq; + +Seq.prototype[IS_SEQ_SYMBOL] = true; + +// #pragma Root Sequences + +var ArraySeq = /*@__PURE__*/(function (IndexedSeq) { + function ArraySeq(array) { + this._array = array; + this.size = array.length; + } + + if ( IndexedSeq ) ArraySeq.__proto__ = IndexedSeq; + ArraySeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ArraySeq.prototype.constructor = ArraySeq; + + ArraySeq.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; + }; + + ArraySeq.prototype.__iterate = function __iterate (fn, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + while (i !== size) { + var ii = reverse ? size - ++i : i++; + if (fn(array[ii], ii, this) === false) { + break; + } + } + return i; + }; + + ArraySeq.prototype.__iterator = function __iterator (type, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var ii = reverse ? size - ++i : i++; + return iteratorValue(type, ii, array[ii]); + }); + }; + + return ArraySeq; +}(IndexedSeq)); + +var ObjectSeq = /*@__PURE__*/(function (KeyedSeq) { + function ObjectSeq(object) { + var keys = Object.keys(object).concat( + Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [] + ); + this._object = object; + this._keys = keys; + this.size = keys.length; + } + + if ( KeyedSeq ) ObjectSeq.__proto__ = KeyedSeq; + ObjectSeq.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ObjectSeq.prototype.constructor = ObjectSeq; + + ObjectSeq.prototype.get = function get (key, notSetValue) { + if (notSetValue !== undefined && !this.has(key)) { + return notSetValue; + } + return this._object[key]; + }; + + ObjectSeq.prototype.has = function has (key) { + return hasOwnProperty.call(this._object, key); + }; + + ObjectSeq.prototype.__iterate = function __iterate (fn, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + while (i !== size) { + var key = keys[reverse ? size - ++i : i++]; + if (fn(object[key], key, this) === false) { + break; + } + } + return i; + }; + + ObjectSeq.prototype.__iterator = function __iterator (type, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var key = keys[reverse ? size - ++i : i++]; + return iteratorValue(type, key, object[key]); + }); + }; + + return ObjectSeq; +}(KeyedSeq)); +ObjectSeq.prototype[IS_ORDERED_SYMBOL] = true; + +var CollectionSeq = /*@__PURE__*/(function (IndexedSeq) { + function CollectionSeq(collection) { + this._collection = collection; + this.size = collection.length || collection.size; + } + + if ( IndexedSeq ) CollectionSeq.__proto__ = IndexedSeq; + CollectionSeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + CollectionSeq.prototype.constructor = CollectionSeq; + + CollectionSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + var iterations = 0; + if (isIterator(iterator)) { + var step; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + } + return iterations; + }; + + CollectionSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + if (!isIterator(iterator)) { + return new Iterator(iteratorDone); + } + var iterations = 0; + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, iterations++, step.value); + }); + }; + + return CollectionSeq; +}(IndexedSeq)); + +// # pragma Helper functions + +var EMPTY_SEQ; + +function emptySequence() { + return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); +} + +function keyedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq.fromEntrySeq(); + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of [k, v] entries, or keyed object: ' + + value + ); +} + +function indexedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq; + } + throw new TypeError( + 'Expected Array or collection object of values: ' + value + ); +} + +function seqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return isEntriesIterable(value) + ? seq.fromEntrySeq() + : isKeysIterable(value) + ? seq.toSetSeq() + : seq; + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of values, or keyed object: ' + value + ); +} + +function maybeIndexedSeqFromValue(value) { + return isArrayLike(value) + ? new ArraySeq(value) + : hasIterator(value) + ? new CollectionSeq(value) + : undefined; +} + +function asImmutable() { + return this.__ensureOwner(); +} + +function asMutable() { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); +} + +// TODO remove in v6 as Math.imul is widely available now: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul +var imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 + ? Math.imul + : function imul(a, b) { + a |= 0; // int + b |= 0; // int + var c = a & 0xffff; + var d = b & 0xffff; + // Shift by 0 fixes the sign on the high part. + return (c * d + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0)) | 0; // int + }; +// v8 has an optimization for storing 31-bit signed numbers. +// Values which have either 00 or 11 as the high order bits qualify. +// This function drops the highest order bit in a signed number, maintaining +// the sign bit. +function smi(i32) { + return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff); +} + +var defaultValueOf = Object.prototype.valueOf; +function hash(o) { + // eslint-disable-next-line eqeqeq + if (o == null) { + return hashNullish(o); + } + // @ts-expect-error don't care about object beeing typed as `{}` here + if (typeof o.hashCode === 'function') { + // Drop any high bits from accidentally long hash codes. + // @ts-expect-error don't care about object beeing typed as `{}` here + return smi(o.hashCode(o)); + } + var v = valueOf(o); + // eslint-disable-next-line eqeqeq + if (v == null) { + return hashNullish(v); + } + switch (typeof v) { + case 'boolean': + // The hash values for built-in constants are a 1 value for each 5-byte + // shift region expect for the first, which encodes the value. This + // reduces the odds of a hash collision for these common values. + return v ? 0x42108421 : 0x42108420; + case 'number': + return hashNumber(v); + case 'string': + return v.length > STRING_HASH_CACHE_MIN_STRLEN + ? cachedHashString(v) + : hashString(v); + case 'object': + case 'function': + return hashJSObj(v); + case 'symbol': + return hashSymbol(v); + default: + if (typeof v.toString === 'function') { + return hashString(v.toString()); + } + throw new Error('Value type ' + typeof v + ' cannot be hashed.'); + } +} +function hashNullish(nullish) { + return nullish === null ? 0x42108422 : /* undefined */ 0x42108423; +} +// Compress arbitrarily large numbers into smi hashes. +function hashNumber(n) { + if (n !== n || n === Infinity) { + return 0; + } + var hash = n | 0; + if (hash !== n) { + hash ^= n * 0xffffffff; + } + while (n > 0xffffffff) { + n /= 0xffffffff; + hash ^= n; + } + return smi(hash); +} +function cachedHashString(string) { + var hashed = stringHashCache[string]; + if (hashed === undefined) { + hashed = hashString(string); + if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { + STRING_HASH_CACHE_SIZE = 0; + stringHashCache = {}; + } + STRING_HASH_CACHE_SIZE++; + stringHashCache[string] = hashed; + } + return hashed; +} +// http://jsperf.com/hashing-strings +function hashString(string) { + // This is the hash from JVM + // The hash code for a string is computed as + // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], + // where s[i] is the ith character of the string and n is the length of + // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 + // (exclusive) by dropping high bits. + var hashed = 0; + for (var ii = 0; ii < string.length; ii++) { + hashed = (31 * hashed + string.charCodeAt(ii)) | 0; + } + return smi(hashed); +} +// Per-process seed for the secondary collision hash. Never exposed nor +// serialized, so the public `hash()` stays deterministic. An odd base in +// [3, 2^20) keeps `base * h` exact as a double (no `Math.imul`). +var COLLISION_HASH_BASE = ((Math.random() * 0x100000) | 1) % 0x100000 || 0x9e37; +// Secondary hash to index entries within a `HashCollisionNode`, where every key +// shares the same primary `hash()`. Using a different, seeded base scatters +// crafted collision families (e.g. "Aa"/"BB", which only collide under base 31) +// that an attacker cannot precompute without the seed. It only narrows +// candidates — `is()` still decides equality — so non-string keys can safely +// fall back to the (here constant) primary hash and a linear scan. +function hashCollisionKey(key) { + if (typeof key !== 'string') { + return hash(key); + } + var hashed = 0; + for (var ii = 0; ii < key.length; ii++) { + hashed = (COLLISION_HASH_BASE * hashed + key.charCodeAt(ii)) | 0; + } + return hashed; +} +function hashSymbol(sym) { + var hashed = symbolMap[sym]; + if (hashed !== undefined) { + return hashed; + } + hashed = nextHash(); + symbolMap[sym] = hashed; + return hashed; +} +// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type +function hashJSObj(obj) { + var hashed; + if (usingWeakMap) { + // @ts-expect-error weakMap is defined + hashed = weakMap.get(obj); + if (hashed !== undefined) { + return hashed; + } + } + // @ts-expect-error used for old code, will be removed + hashed = obj[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + if (!canDefineProperty) { + // @ts-expect-error used for old code, will be removed + hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + hashed = getIENodeHash(obj); + if (hashed !== undefined) { + return hashed; + } + } + hashed = nextHash(); + if (usingWeakMap) { + // @ts-expect-error weakMap is defined + weakMap.set(obj, hashed); + } + else if (isExtensible !== undefined && isExtensible(obj) === false) { + throw new Error('Non-extensible objects are not allowed as keys.'); + } + else if (canDefineProperty) { + Object.defineProperty(obj, UID_HASH_KEY, { + enumerable: false, + configurable: false, + writable: false, + value: hashed, + }); + } + else if (obj.propertyIsEnumerable !== undefined && + obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { + // Since we can't define a non-enumerable property on the object + // we'll hijack one of the less-used non-enumerable properties to + // save our hash on it. Since this is a function it will not show up in + // `JSON.stringify` which is what we want. + obj.propertyIsEnumerable = function () { + return this.constructor.prototype.propertyIsEnumerable.apply(this, + // eslint-disable-next-line prefer-rest-params + arguments); + }; + // @ts-expect-error used for old code, will be removed + obj.propertyIsEnumerable[UID_HASH_KEY] = hashed; + // @ts-expect-error used for old code, will be removed + } + else if (obj.nodeType !== undefined) { + // At this point we couldn't get the IE `uniqueID` to use as a hash + // and we couldn't use a non-enumerable property to exploit the + // dontEnum bug so we simply add the `UID_HASH_KEY` on the node + // itself. + // @ts-expect-error used for old code, will be removed + obj[UID_HASH_KEY] = hashed; + } + else { + throw new Error('Unable to set a non-enumerable property on object.'); + } + return hashed; +} +// Get references to ES5 object methods. +var isExtensible = Object.isExtensible; +// True if Object.defineProperty works as expected. IE8 fails this test. +// TODO remove this as widely available https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty +var canDefineProperty = (function () { + try { + Object.defineProperty({}, '@', {}); + return true; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } + catch (e) { + return false; + } +})(); +// IE has a `uniqueID` property on DOM nodes. We can construct the hash from it +// and avoid memory leaks from the IE cloneNode bug. +// TODO remove this method as only used if `canDefineProperty` is false +function getIENodeHash(node) { + // @ts-expect-error don't care + if (node && node.nodeType > 0) { + // @ts-expect-error don't care + switch (node.nodeType) { + case 1: // Element + // @ts-expect-error don't care + return node.uniqueID; + case 9: // Document + // @ts-expect-error don't care + return node.documentElement && node.documentElement.uniqueID; + } + } +} +function valueOf(obj) { + return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' + ? // @ts-expect-error weird the "obj" parameter as `valueOf` should not have a parameter + obj.valueOf(obj) + : obj; +} +function nextHash() { + var nextHash = ++_objHashUID; + if (_objHashUID & 0x40000000) { + _objHashUID = 0; + } + return nextHash; +} +// If possible, use a WeakMap. +// TODO using WeakMap should be true everywhere now that WeakMap is widely supported: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap +var usingWeakMap = typeof WeakMap === 'function'; +var weakMap; +if (usingWeakMap) { + weakMap = new WeakMap(); +} +var symbolMap = Object.create(null); +var _objHashUID = 0; +// TODO remove string as Symbol is now widely supported: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol +var UID_HASH_KEY = '__immutablehash__'; +if (typeof Symbol === 'function') { + UID_HASH_KEY = Symbol(UID_HASH_KEY); +} +var STRING_HASH_CACHE_MIN_STRLEN = 16; +var STRING_HASH_CACHE_MAX_SIZE = 255; +var STRING_HASH_CACHE_SIZE = 0; +var stringHashCache = {}; + +var ToKeyedSequence = /*@__PURE__*/(function (KeyedSeq) { + function ToKeyedSequence(indexed, useKeys) { + this._iter = indexed; + this._useKeys = useKeys; + this.size = indexed.size; + } + + if ( KeyedSeq ) ToKeyedSequence.__proto__ = KeyedSeq; + ToKeyedSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ToKeyedSequence.prototype.constructor = ToKeyedSequence; + + ToKeyedSequence.prototype.get = function get (key, notSetValue) { + return this._iter.get(key, notSetValue); + }; + + ToKeyedSequence.prototype.has = function has (key) { + return this._iter.has(key); + }; + + ToKeyedSequence.prototype.valueSeq = function valueSeq () { + return this._iter.valueSeq(); + }; + + ToKeyedSequence.prototype.reverse = function reverse () { + var this$1$1 = this; + + var reversedSequence = reverseFactory(this, true); + if (!this._useKeys) { + reversedSequence.valueSeq = function () { return this$1$1._iter.toSeq().reverse(); }; + } + return reversedSequence; + }; + + ToKeyedSequence.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + var mappedSequence = mapFactory(this, mapper, context); + if (!this._useKeys) { + mappedSequence.valueSeq = function () { return this$1$1._iter.toSeq().map(mapper, context); }; + } + return mappedSequence; + }; + + ToKeyedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v, k) { return fn(v, k, this$1$1); }, reverse); + }; + + ToKeyedSequence.prototype.__iterator = function __iterator (type, reverse) { + return this._iter.__iterator(type, reverse); + }; + + return ToKeyedSequence; +}(KeyedSeq)); +ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true; + +var ToIndexedSequence = /*@__PURE__*/(function (IndexedSeq) { + function ToIndexedSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( IndexedSeq ) ToIndexedSequence.__proto__ = IndexedSeq; + ToIndexedSequence.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ToIndexedSequence.prototype.constructor = ToIndexedSequence; + + ToIndexedSequence.prototype.includes = function includes (value) { + return this._iter.includes(value); + }; + + ToIndexedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); + return this._iter.__iterate( + function (v) { return fn(v, reverse ? this$1$1.size - ++i : i++, this$1$1); }, + reverse + ); + }; + + ToIndexedSequence.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue( + type, + reverse ? this$1$1.size - ++i : i++, + step.value, + step + ); + }); + }; + + return ToIndexedSequence; +}(IndexedSeq)); + +var ToSetSequence = /*@__PURE__*/(function (SetSeq) { + function ToSetSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( SetSeq ) ToSetSequence.__proto__ = SetSeq; + ToSetSequence.prototype = Object.create( SetSeq && SetSeq.prototype ); + ToSetSequence.prototype.constructor = ToSetSequence; + + ToSetSequence.prototype.has = function has (key) { + return this._iter.includes(key); + }; + + ToSetSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v) { return fn(v, v, this$1$1); }, reverse); + }; + + ToSetSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue(type, step.value, step.value, step); + }); + }; + + return ToSetSequence; +}(SetSeq)); + +var FromEntriesSequence = /*@__PURE__*/(function (KeyedSeq) { + function FromEntriesSequence(entries) { + this._iter = entries; + this.size = entries.size; + } + + if ( KeyedSeq ) FromEntriesSequence.__proto__ = KeyedSeq; + FromEntriesSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + FromEntriesSequence.prototype.constructor = FromEntriesSequence; + + FromEntriesSequence.prototype.entrySeq = function entrySeq () { + return this._iter.toSeq(); + }; + + FromEntriesSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (entry) { + // Check if entry exists first so array access doesn't throw for holes + // in the parent iteration. + if (entry) { + validateEntry(entry); + var indexedCollection = isCollection(entry); + return fn( + indexedCollection ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], + this$1$1 + ); + } + }, reverse); + }; + + FromEntriesSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + // Check if entry exists first so array access doesn't throw for holes + // in the parent iteration. + if (entry) { + validateEntry(entry); + var indexedCollection = isCollection(entry); + return iteratorValue( + type, + indexedCollection ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], + step + ); + } + } + }); + }; + + return FromEntriesSequence; +}(KeyedSeq)); + +ToIndexedSequence.prototype.cacheResult = + ToKeyedSequence.prototype.cacheResult = + ToSetSequence.prototype.cacheResult = + FromEntriesSequence.prototype.cacheResult = + cacheResultThrough; + +function flipFactory(collection) { + var flipSequence = makeSequence(collection); + flipSequence._iter = collection; + flipSequence.size = collection.size; + flipSequence.flip = function () { return collection; }; + flipSequence.reverse = function () { + var reversedSequence = collection.reverse.apply(this); // super.reverse() + reversedSequence.flip = function () { return collection.reverse(); }; + return reversedSequence; + }; + flipSequence.has = function (key) { return collection.includes(key); }; + flipSequence.includes = function (key) { return collection.has(key); }; + flipSequence.cacheResult = cacheResultThrough; + flipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate(function (v, k) { return fn(k, v, this$1$1) !== false; }, reverse); + }; + flipSequence.__iteratorUncached = function (type, reverse) { + if (type === ITERATE_ENTRIES) { + var iterator = collection.__iterator(type, reverse); + return new Iterator(function () { + var step = iterator.next(); + if (!step.done) { + var k = step.value[0]; + step.value[0] = step.value[1]; + step.value[1] = k; + } + return step; + }); + } + return collection.__iterator( + type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, + reverse + ); + }; + return flipSequence; +} + +function mapFactory(collection, mapper, context) { + var mappedSequence = makeSequence(collection); + mappedSequence.size = collection.size; + mappedSequence.has = function (key) { return collection.has(key); }; + mappedSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v === NOT_SET + ? notSetValue + : mapper.call(context, v, key, collection); + }; + mappedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate( + function (v, k, c) { return fn(mapper.call(context, v, k, c), k, this$1$1) !== false; }, + reverse + ); + }; + mappedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + return new Iterator(function () { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + return iteratorValue( + type, + key, + mapper.call(context, entry[1], key, collection), + step + ); + }); + }; + return mappedSequence; +} + +function reverseFactory(collection, useKeys) { + var reversedSequence = makeSequence(collection); + reversedSequence._iter = collection; + reversedSequence.size = collection.size; + reversedSequence.reverse = function () { return collection; }; + if (collection.flip) { + reversedSequence.flip = function () { + var flipSequence = flipFactory(collection); + flipSequence.reverse = function () { return collection.flip(); }; + return flipSequence; + }; + } + reversedSequence.get = function (key, notSetValue) { return collection.get(useKeys ? key : -1 - key, notSetValue); }; + reversedSequence.has = function (key) { return collection.has(useKeys ? key : -1 - key); }; + reversedSequence.includes = function (value) { return collection.includes(value); }; + reversedSequence.cacheResult = cacheResultThrough; + reversedSequence.__iterate = function (fn, reverse) { + var this$1$1 = this; + + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + return collection.__iterate( + function (v, k) { return fn(v, useKeys ? k : reverse ? this$1$1.size - ++i : i++, this$1$1); }, + !reverse + ); + }; + reversedSequence.__iterator = function (type, reverse) { + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + var iterator = collection.__iterator(ITERATE_ENTRIES, !reverse); + return new Iterator(function () { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + return iteratorValue( + type, + // `__iterator` is an arrow function, so `this` is not the reversed + // sequence here — read `reversedSequence.size` explicitly. + useKeys ? entry[0] : reverse ? reversedSequence.size - ++i : i++, + entry[1], + step + ); + }); + }; + return reversedSequence; +} + +function filterFactory(collection, predicate, context, useKeys) { + var filterSequence = makeSequence(collection); + if (useKeys) { + filterSequence.has = function (key) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, collection); + }; + filterSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, collection) + ? v + : notSetValue; + }; + } + filterSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }, reverse); + return iterations; + }; + filterSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterations = 0; + return new Iterator(function () { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + var value = entry[1]; + if (predicate.call(context, value, key, collection)) { + return iteratorValue(type, useKeys ? key : iterations++, value, step); + } + } + }); + }; + return filterSequence; +} + +function countByFactory(collection, grouper, context) { + var groups = Map().asMutable(); + collection.__iterate(function (v, k) { + groups.update(grouper.call(context, v, k, collection), 0, function (a) { return a + 1; }); + }); + return groups.asImmutable(); +} + +function groupByFactory(collection, grouper, context) { + var isKeyedIter = isKeyed(collection); + var groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable(); + collection.__iterate(function (v, k) { + groups.update( + grouper.call(context, v, k, collection), + function (a) { return ((a = a || []), a.push(isKeyedIter ? [k, v] : v), a); } + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }).asImmutable(); +} + +function partitionFactory(collection, predicate, context) { + var isKeyedIter = isKeyed(collection); + var groups = [[], []]; + collection.__iterate(function (v, k) { + groups[predicate.call(context, v, k, collection) ? 1 : 0].push( + isKeyedIter ? [k, v] : v + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }); +} + +function sliceFactory(collection, begin, end, useKeys) { + var originalSize = collection.size; + + if (wholeSlice(begin, end, originalSize)) { + return collection; + } + + // begin or end can not be resolved if they were provided as negative numbers and + // this collection's size is unknown. In that case, cache first so there is + // a known size and these do not resolve to NaN. + if (typeof originalSize === 'undefined' && (begin < 0 || end < 0)) { + return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys); + } + + var resolvedBegin = resolveBegin(begin, originalSize); + var resolvedEnd = resolveEnd(end, originalSize); + + // Note: resolvedEnd is undefined when the original sequence's length is + // unknown and this slice did not supply an end and should contain all + // elements after resolvedBegin. + // In that case, resolvedSize will be NaN and sliceSize will remain undefined. + var resolvedSize = resolvedEnd - resolvedBegin; + var sliceSize; + if (resolvedSize === resolvedSize) { + sliceSize = resolvedSize < 0 ? 0 : resolvedSize; + } + + var sliceSeq = makeSequence(collection); + + // If collection.size is undefined, the size of the realized sliceSeq is + // unknown at this point unless the number of items to slice is 0 + sliceSeq.size = + sliceSize === 0 ? sliceSize : (collection.size && sliceSize) || undefined; + + if (!useKeys && isSeq(collection) && sliceSize >= 0) { + sliceSeq.get = function (index, notSetValue) { + index = wrapIndex(this, index); + return index >= 0 && index < sliceSize + ? collection.get(index + resolvedBegin, notSetValue) + : notSetValue; + }; + } + + sliceSeq.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (sliceSize === 0) { + return 0; + } + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var skipped = 0; + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k) { + if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { + iterations++; + return ( + fn(v, useKeys ? k : iterations - 1, this$1$1) !== false && + iterations !== sliceSize + ); + } + }); + return iterations; + }; + + sliceSeq.__iteratorUncached = function (type, reverse) { + if (sliceSize !== 0 && reverse) { + return this.cacheResult().__iterator(type, reverse); + } + // Don't bother instantiating parent iterator if taking 0. + if (sliceSize === 0) { + return new Iterator(iteratorDone); + } + var iterator = collection.__iterator(type, reverse); + var skipped = 0; + var iterations = 0; + return new Iterator(function () { + while (skipped++ < resolvedBegin) { + iterator.next(); + } + if (++iterations > sliceSize) { + return iteratorDone(); + } + var step = iterator.next(); + if (useKeys || type === ITERATE_VALUES || step.done) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations - 1, undefined, step); + } + return iteratorValue(type, iterations - 1, step.value[1], step); + }); + }; + + return sliceSeq; +} + +function takeWhileFactory(collection, predicate, context) { + var takeSequence = makeSequence(collection); + takeSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + collection.__iterate( + function (v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1$1); } + ); + return iterations; + }; + takeSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterating = true; + return new Iterator(function () { + if (!iterating) { + return iteratorDone(); + } + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var k = entry[0]; + var v = entry[1]; + if (!predicate.call(context, v, k, this$1$1)) { + iterating = false; + return iteratorDone(); + } + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return takeSequence; +} + +function skipWhileFactory(collection, predicate, context, useKeys) { + var skipSequence = makeSequence(collection); + skipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }); + return iterations; + }; + skipSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var skipping = true; + var iterations = 0; + return new Iterator(function () { + var step; + var k; + var v; + do { + step = iterator.next(); + if (step.done) { + if (useKeys || type === ITERATE_VALUES) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations++, undefined, step); + } + return iteratorValue(type, iterations++, step.value[1], step); + } + var entry = step.value; + k = entry[0]; + v = entry[1]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + skipping && (skipping = predicate.call(context, v, k, this$1$1)); + } while (skipping); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return skipSequence; +} + +var ConcatSeq = /*@__PURE__*/(function (Seq) { + function ConcatSeq(iterables) { + this._wrappedIterables = iterables.flatMap(function (iterable) { + if (iterable._wrappedIterables) { + return iterable._wrappedIterables; + } + return [iterable]; + }); + this.size = this._wrappedIterables.reduce(function (sum, iterable) { + if (sum !== undefined) { + var size = iterable.size; + if (size !== undefined) { + return sum + size; + } + } + }, 0); + this[IS_KEYED_SYMBOL] = this._wrappedIterables[0][IS_KEYED_SYMBOL]; + this[IS_INDEXED_SYMBOL] = this._wrappedIterables[0][IS_INDEXED_SYMBOL]; + this[IS_ORDERED_SYMBOL] = this._wrappedIterables[0][IS_ORDERED_SYMBOL]; + } + + if ( Seq ) ConcatSeq.__proto__ = Seq; + ConcatSeq.prototype = Object.create( Seq && Seq.prototype ); + ConcatSeq.prototype.constructor = ConcatSeq; + + ConcatSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) { + if (this._wrappedIterables.length === 0) { + return; + } + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + + var iterableIndex = 0; + var useKeys = isKeyed(this); + var iteratorType = useKeys ? ITERATE_ENTRIES : ITERATE_VALUES; + var currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + + var keepGoing = true; + var index = 0; + while (keepGoing) { + var next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this._wrappedIterables.length) { + return index; + } + currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + next = currentIterator.next(); + } + var fnResult = useKeys + ? fn(next.value[1], next.value[0], this) + : fn(next.value, index, this); + keepGoing = fnResult !== false; + index++; + } + return index; + }; + + ConcatSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) { + var this$1$1 = this; + + if (this._wrappedIterables.length === 0) { + return new Iterator(iteratorDone); + } + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + + var iterableIndex = 0; + var currentIterator = this._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + return new Iterator(function () { + var next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this$1$1._wrappedIterables.length) { + return next; + } + currentIterator = this$1$1._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + next = currentIterator.next(); + } + return next; + }); + }; + + return ConcatSeq; +}(Seq)); + +function concatFactory(collection, values) { + var isKeyedCollection = isKeyed(collection); + var iters = [collection] + .concat(values) + .map(function (v) { + if (!isCollection(v)) { + v = isKeyedCollection + ? keyedSeqFromValue(v) + : indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedCollection) { + v = KeyedCollection(v); + } + return v; + }) + .filter(function (v) { return v.size !== 0; }); + + if (iters.length === 0) { + return collection; + } + + if (iters.length === 1) { + var singleton = iters[0]; + if ( + singleton === collection || + (isKeyedCollection && isKeyed(singleton)) || + (isIndexed(collection) && isIndexed(singleton)) + ) { + return singleton; + } + } + + return new ConcatSeq(iters); +} + +function flattenFactory(collection, depth, useKeys) { + var flatSequence = makeSequence(collection); + flatSequence.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + var stopped = false; + function flatDeep(iter, currentDepth) { + iter.__iterate(function (v, k) { + if ((!depth || currentDepth < depth) && isCollection(v)) { + flatDeep(v, currentDepth + 1); + } else { + iterations++; + if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) { + stopped = true; + } + } + return !stopped; + }, reverse); + } + flatDeep(collection, 0); + return iterations; + }; + flatSequence.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(type, reverse); + var stack = []; + var iterations = 0; + return new Iterator(function () { + while (iterator) { + var step = iterator.next(); + if (step.done !== false) { + iterator = stack.pop(); + continue; + } + var v = step.value; + if (type === ITERATE_ENTRIES) { + v = v[1]; + } + if ((!depth || stack.length < depth) && isCollection(v)) { + stack.push(iterator); + iterator = v.__iterator(type, reverse); + } else { + return useKeys ? step : iteratorValue(type, iterations++, v, step); + } + } + return iteratorDone(); + }); + }; + return flatSequence; +} + +function flatMapFactory(collection, mapper, context) { + var coerce = collectionClass(collection); + return collection + .toSeq() + .map(function (v, k) { return coerce(mapper.call(context, v, k, collection)); }) + .flatten(true); +} + +function interposeFactory(collection, separator) { + var interposedSequence = makeSequence(collection); + interposedSequence.size = collection.size && collection.size * 2 - 1; + interposedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate( + function (v) { return (!iterations || fn(separator, iterations++, this$1$1) !== false) && + fn(v, iterations++, this$1$1) !== false; }, + reverse + ); + return iterations; + }; + interposedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + var step; + return new Iterator(function () { + if (!step || iterations % 2) { + step = iterator.next(); + if (step.done) { + return step; + } + } + return iterations % 2 + ? iteratorValue(type, iterations++, separator) + : iteratorValue(type, iterations++, step.value, step); + }); + }; + return interposedSequence; +} + +function sortFactory(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + var isKeyedCollection = isKeyed(collection); + var index = 0; + var entries = collection + .toSeq() + .map(function (v, k) { return [k, v, index++, mapper ? mapper(v, k, collection) : v]; }) + .valueSeq() + .toArray(); + entries + .sort(function (a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; }) + .forEach( + isKeyedCollection + ? function (v, i) { + entries[i].length = 2; + } + : function (v, i) { + entries[i] = v[1]; + } + ); + return isKeyedCollection + ? KeyedSeq(entries) + : isIndexed(collection) + ? IndexedSeq(entries) + : SetSeq(entries); +} + +function maxFactory(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + if (mapper) { + var entry = collection + .toSeq() + .map(function (v, k) { return [v, mapper(v, k, collection)]; }) + .reduce(function (a, b) { return (maxCompare(comparator, a[1], b[1]) ? b : a); }); + return entry && entry[0]; + } + return collection.reduce(function (a, b) { return (maxCompare(comparator, a, b) ? b : a); }); +} + +function maxCompare(comparator, a, b) { + var comp = comparator(b, a); + // b is considered the new max if the comparator declares them equal, but + // they are not equal and b is in fact a nullish value. + return ( + (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || + comp > 0 + ); +} + +function zipWithFactory(keyIter, zipper, iters, zipAll) { + var zipSequence = makeSequence(keyIter); + var sizes = new ArraySeq(iters).map(function (i) { return i.size; }); + zipSequence.size = zipAll ? sizes.max() : sizes.min(); + // Note: this a generic base implementation of __iterate in terms of + // __iterator which may be more generically useful in the future. + zipSequence.__iterate = function (fn, reverse) { + /* generic: + var iterator = this.__iterator(ITERATE_ENTRIES, reverse); + var step; + var iterations = 0; + while (!(step = iterator.next()).done) { + iterations++; + if (fn(step.value[1], step.value[0], this) === false) { + break; + } + } + return iterations; + */ + // indexed: + var iterator = this.__iterator(ITERATE_VALUES, reverse); + var step; + var iterations = 0; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + return iterations; + }; + zipSequence.__iteratorUncached = function (type, reverse) { + var iterators = iters.map( + function (i) { return ((i = Collection(i)), getIterator(reverse ? i.reverse() : i)); } + ); + var iterations = 0; + var isDone = false; + return new Iterator(function () { + var steps; + if (!isDone) { + steps = iterators.map(function (i) { return i.next(); }); + isDone = zipAll + ? steps.every(function (s) { return s.done; }) + : steps.some(function (s) { return s.done; }); + } + if (isDone) { + return iteratorDone(); + } + return iteratorValue( + type, + iterations++, + zipper.apply( + null, + steps.map(function (s) { return s.value; }) + ) + ); + }); + }; + return zipSequence; +} + +// #pragma Helper Functions + +function reify(iter, seq) { + return iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq); +} + +function validateEntry(entry) { + if (entry !== Object(entry)) { + throw new TypeError('Expected [K, V] tuple: ' + entry); + } +} + +function collectionClass(collection) { + return isKeyed(collection) + ? KeyedCollection + : isIndexed(collection) + ? IndexedCollection + : SetCollection; +} + +function makeSequence(collection) { + return Object.create( + (isKeyed(collection) + ? KeyedSeq + : isIndexed(collection) + ? IndexedSeq + : SetSeq + ).prototype + ); +} + +function cacheResultThrough() { + if (this._iter.cacheResult) { + this._iter.cacheResult(); + this.size = this._iter.size; + return this; + } + return Seq.prototype.cacheResult.call(this); +} + +function defaultComparator(a, b) { + if (a === undefined && b === undefined) { + return 0; + } + + if (a === undefined) { + return 1; + } + + if (b === undefined) { + return -1; + } + + return a > b ? 1 : a < b ? -1 : 0; +} + +/** + * True if `maybeValue` is a JavaScript Object which has *both* `equals()` + * and `hashCode()` methods. + * + * Any two instances of *value objects* can be compared for value equality with + * `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. + */ +function isValueObject(maybeValue) { + return Boolean(maybeValue && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.equals === 'function' && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.hashCode === 'function'); +} + +/** + * An extension of the "same-value" algorithm as [described for use by ES6 Map + * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) + * + * NaN is considered the same as NaN, however -0 and 0 are considered the same + * value, which is different from the algorithm described by + * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * This is extended further to allow Objects to describe the values they + * represent, by way of `valueOf` or `equals` (and `hashCode`). + * + * Note: because of this extension, the key equality of Immutable.Map and the + * value equality of Immutable.Set will differ from ES6 Map and Set. + * + * ### Defining custom values + * + * The easiest way to describe the value an object represents is by implementing + * `valueOf`. For example, `Date` represents a value by returning a unix + * timestamp for `valueOf`: + * + * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... + * var date2 = new Date(1234567890000); + * date1.valueOf(); // 1234567890000 + * assert( date1 !== date2 ); + * assert( Immutable.is( date1, date2 ) ); + * + * Note: overriding `valueOf` may have other implications if you use this object + * where JavaScript expects a primitive, such as implicit string coercion. + * + * For more complex types, especially collections, implementing `valueOf` may + * not be performant. An alternative is to implement `equals` and `hashCode`. + * + * `equals` takes another object, presumably of similar type, and returns true + * if it is equal. Equality is symmetrical, so the same result should be + * returned if this and the argument are flipped. + * + * assert( a.equals(b) === b.equals(a) ); + * + * `hashCode` returns a 32bit integer number representing the object which will + * be used to determine how to store the value object in a Map or Set. You must + * provide both or neither methods, one must not exist without the other. + * + * Also, an important relationship between these methods must be upheld: if two + * values are equal, they *must* return the same hashCode. If the values are not + * equal, they might have the same hashCode; this is called a hash collision, + * and while undesirable for performance reasons, it is acceptable. + * + * if (a.equals(b)) { + * assert( a.hashCode() === b.hashCode() ); + * } + * + * All Immutable collections are Value Objects: they implement `equals()` + * and `hashCode()`. + */ +function is(valueA, valueB) { + if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { + return true; + } + if (!valueA || !valueB) { + return false; + } + if (typeof valueA.valueOf === 'function' && + typeof valueB.valueOf === 'function') { + valueA = valueA.valueOf(); + valueB = valueB.valueOf(); + if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { + return true; + } + if (!valueA || !valueB) { + return false; + } + } + return !!(isValueObject(valueA) && + isValueObject(valueB) && + valueA.equals(valueB)); +} + +function update$1(collection, key, notSetValue, updater) { + return updateIn( + // @ts-expect-error Index signature for type string is missing in type V[] + collection, [key], notSetValue, updater); +} + +function merge$1() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeIntoKeyedWith(this, iters); +} + +function mergeWith$1(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + if (typeof merger !== 'function') { + throw new TypeError('Invalid merger function: ' + merger); + } + return mergeIntoKeyedWith(this, iters, merger); +} + +function mergeIntoKeyedWith(collection, collections, merger) { + var iters = []; + for (var ii = 0; ii < collections.length; ii++) { + var collection$1 = KeyedCollection(collections[ii]); + if (collection$1.size !== 0) { + iters.push(collection$1); + } + } + if (iters.length === 0) { + return collection; + } + if ( + collection.toSeq().size === 0 && + !collection.__ownerID && + iters.length === 1 + ) { + return isRecord(collection) + ? collection // Record is empty and will not be updated: return the same instance + : collection.constructor(iters[0]); + } + return collection.withMutations(function (collection) { + var mergeIntoCollection = merger + ? function (value, key) { + update$1(collection, key, NOT_SET, function (oldVal) { return oldVal === NOT_SET ? value : merger(oldVal, value, key); } + ); + } + : function (value, key) { + collection.set(key, value); + }; + for (var ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoCollection); + } + }); +} + +var toString = Object.prototype.toString; +function isPlainObject(value) { + // The base prototype's toString deals with Argument objects and native namespaces like Math + if (!value || + typeof value !== 'object' || + toString.call(value) !== '[object Object]') { + return false; + } + var proto = Object.getPrototypeOf(value); + if (proto === null) { + return true; + } + // Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc) + var parentProto = proto; + var nextProto = Object.getPrototypeOf(proto); + while (nextProto !== null) { + parentProto = nextProto; + nextProto = Object.getPrototypeOf(parentProto); + } + return parentProto === proto; +} + +/** + * Returns true if the value is a potentially-persistent data structure, either + * provided by Immutable.js or a plain Array or Object. + */ +function isDataStructure(value) { + return (typeof value === 'object' && + (isImmutable(value) || Array.isArray(value) || isPlainObject(value))); +} + +function isProtoKey(key) { + return (typeof key === 'string' && (key === '__proto__' || key === 'constructor')); +} + +// http://jsperf.com/copy-array-inline +function arrCopy(arr, offset) { + offset = offset || 0; + var len = Math.max(0, arr.length - offset); + var newArr = new Array(len); + for (var ii = 0; ii < len; ii++) { + // @ts-expect-error We may want to guard for undefined values with `if (arr[ii + offset] !== undefined`, but ths should not happen by design + newArr[ii] = arr[ii + offset]; + } + return newArr; +} + +function shallowCopy(from) { + if (Array.isArray(from)) { + return arrCopy(from); + } + var to = {}; + for (var key in from) { + if (isProtoKey(key)) { + continue; + } + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + return to; +} + +function merge(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeWithSources(collection, sources); +} + +function mergeWith(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeWithSources(collection, sources, merger); +} + +function mergeDeep$1(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(collection, sources); +} + +function mergeDeepWith$1(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeDeepWithSources(collection, sources, merger); +} + +function mergeDeepWithSources(collection, sources, merger) { + return mergeWithSources(collection, sources, deepMergerWith(merger)); +} + +function mergeWithSources(collection, sources, merger) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot merge into non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + return typeof merger === 'function' && collection.mergeWith + ? collection.mergeWith.apply(collection, [ merger ].concat( sources )) + : collection.merge + ? collection.merge.apply(collection, sources) + : collection.concat.apply(collection, sources); + } + var isArray = Array.isArray(collection); + var merged = collection; + var Collection = isArray ? IndexedCollection : KeyedCollection; + var mergeItem = isArray + ? function (value) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged.push(value); + } + : function (value, key) { + if (isProtoKey(key)) { + return; + } + + var hasVal = hasOwnProperty.call(merged, key); + var nextVal = + hasVal && merger ? merger(merged[key], value, key) : value; + if (!hasVal || nextVal !== merged[key]) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged[key] = nextVal; + } + }; + for (var i = 0; i < sources.length; i++) { + Collection(sources[i]).forEach(mergeItem); + } + return merged; +} + +function deepMergerWith(merger) { + function deepMerger(oldValue, newValue, key) { + return isDataStructure(oldValue) && + isDataStructure(newValue) && + areMergeable(oldValue, newValue) + ? mergeWithSources(oldValue, [newValue], deepMerger) + : merger + ? merger(oldValue, newValue, key) + : newValue; + } + return deepMerger; +} + +/** + * It's unclear what the desired behavior is for merging two collections that + * fall into separate categories between keyed, indexed, or set-like, so we only + * consider them mergeable if they fall into the same category. + */ +function areMergeable(oldDataStructure, newDataStructure) { + var oldSeq = Seq(oldDataStructure); + var newSeq = Seq(newDataStructure); + // This logic assumes that a sequence can only fall into one of the three + // categories mentioned above (since there's no `isSetLike()` method). + return ( + isIndexed(oldSeq) === isIndexed(newSeq) && + isKeyed(oldSeq) === isKeyed(newSeq) + ); +} + +function mergeDeep() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeDeepWithSources(this, iters); +} + +function mergeDeepWith(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(this, iters, merger); +} + +function mergeDeepIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn(this, keyPath, emptyMap(), function (m) { return mergeDeepWithSources(m, iters); } + ); +} + +function mergeIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn(this, keyPath, emptyMap(), function (m) { return mergeWithSources(m, iters); }); +} + +/** + * Returns a copy of the collection with the value at the key path set to the + * provided value. + * + * A functional alternative to `collection.setIn(keypath)` which will also + * work with plain Objects and Arrays. + */ +function setIn$1(collection, keyPath, value) { + return updateIn(collection, keyPath, NOT_SET, function () { return value; }); +} + +function setIn(keyPath, v) { + return setIn$1(this, keyPath, v); +} + +function update(key, notSetValue, updater) { + return arguments.length === 1 + ? key(this) + : update$1(this, key, notSetValue, updater); +} + +function updateIn$1(keyPath, notSetValue, updater) { + return updateIn(this, keyPath, notSetValue, updater); +} + +function wasAltered() { + return this.__altered; +} + +function withMutations(fn) { + var mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; +} + +var IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@'; +/** + * True if `maybeMap` is a Map. + * + * Also true for OrderedMaps. + */ +function isMap(maybeMap) { + return Boolean(maybeMap && + // @ts-expect-error: maybeMap is typed as `{}`, need to change in 6.0 to `maybeMap && typeof maybeMap === 'object' && IS_MAP_SYMBOL in maybeMap` + maybeMap[IS_MAP_SYMBOL]); +} + +function invariant(condition, error) { + if (!condition) + { throw new Error(error); } +} + +function assertNotInfinite(size) { + invariant(size !== Infinity, 'Cannot perform this action with an infinite size.'); +} + +var Map = /*@__PURE__*/(function (KeyedCollection) { + function Map(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyMap() + : isMap(value) && !isOrdered(value) + ? value + : emptyMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( KeyedCollection ) Map.__proto__ = KeyedCollection; + Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype ); + Map.prototype.constructor = Map; + + Map.prototype.toString = function toString () { + return this.__toString('Map {', '}'); + }; + + // @pragma Access + + Map.prototype.get = function get (k, notSetValue) { + return this._root + ? this._root.get(0, undefined, k, notSetValue) + : notSetValue; + }; + + // @pragma Modification + + Map.prototype.set = function set (k, v) { + return updateMap(this, k, v); + }; + + Map.prototype.remove = function remove (k) { + return updateMap(this, k, NOT_SET); + }; + + Map.prototype.deleteAll = function deleteAll (keys) { + var collection = Collection(keys); + + if (collection.size === 0) { + return this; + } + + return this.withMutations(function (map) { + collection.forEach(function (key) { return map.remove(key); }); + }); + }; + + Map.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._root = null; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyMap(); + }; + + // @pragma Composition + + Map.prototype.sort = function sort (comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator)); + }; + + Map.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator, mapper)); + }; + + Map.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (map) { + map.forEach(function (value, key) { + map.set(key, mapper.call(context, value, key, this$1$1)); + }); + }); + }; + + // @pragma Mutability + + Map.prototype.__iterator = function __iterator (type, reverse) { + return new MapIterator(this, type, reverse); + }; + + Map.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + this._root && + this._root.iterate(function (entry) { + iterations++; + return fn(entry[1], entry[0], this$1$1); + }, reverse); + return iterations; + }; + + Map.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyMap(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeMap(this.size, this._root, ownerID, this.__hash); + }; + + return Map; +}(KeyedCollection)); + +Map.isMap = isMap; + +var MapPrototype = Map.prototype; +MapPrototype[IS_MAP_SYMBOL] = true; +MapPrototype[DELETE] = MapPrototype.remove; +MapPrototype.removeAll = MapPrototype.deleteAll; +MapPrototype.setIn = setIn; +MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn; +MapPrototype.update = update; +MapPrototype.updateIn = updateIn$1; +MapPrototype.merge = MapPrototype.concat = merge$1; +MapPrototype.mergeWith = mergeWith$1; +MapPrototype.mergeDeep = mergeDeep; +MapPrototype.mergeDeepWith = mergeDeepWith; +MapPrototype.mergeIn = mergeIn; +MapPrototype.mergeDeepIn = mergeDeepIn; +MapPrototype.withMutations = withMutations; +MapPrototype.wasAltered = wasAltered; +MapPrototype.asImmutable = asImmutable; +MapPrototype['@@transducer/init'] = MapPrototype.asMutable = asMutable; +MapPrototype['@@transducer/step'] = function (result, arr) { + return result.set(arr[0], arr[1]); +}; +MapPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; + +// #pragma Trie Nodes + +var ArrayMapNode = function ArrayMapNode(ownerID, entries) { + this.ownerID = ownerID; + this.entries = entries; +}; + +ArrayMapNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + if (is(key, entries[ii][0])) { + return entries[ii][1]; + } + } + return notSetValue; +}; + +ArrayMapNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + + var entries = this.entries; + var idx = 0; + var len = entries.length; + for (; idx < len; idx++) { + if (is(key, entries[idx][0])) { + break; + } + } + var exists = idx < len; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + (removed || !exists) && SetRef(didChangeSize); + + if (removed && entries.length === 1) { + return; // undefined + } + + if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { + return createNodes(ownerID, entries, key, value); + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); + } else { + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new ArrayMapNode(ownerID, newEntries); +}; + +var BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) { + this.ownerID = ownerID; + this.bitmap = bitmap; + this.nodes = nodes; +}; + +BitmapIndexedNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK); + var bitmap = this.bitmap; + return (bitmap & bit) === 0 + ? notSetValue + : this.nodes[popCount(bitmap & (bit - 1))].get( + shift + SHIFT, + keyHash, + key, + notSetValue + ); +}; + +BitmapIndexedNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var bit = 1 << keyHashFrag; + var bitmap = this.bitmap; + var exists = (bitmap & bit) !== 0; + + if (!exists && value === NOT_SET) { + return this; + } + + var idx = popCount(bitmap & (bit - 1)); + var nodes = this.nodes; + var node = exists ? nodes[idx] : undefined; + var newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); + + if (newNode === node) { + return this; + } + + if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { + return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); + } + + if ( + exists && + !newNode && + nodes.length === 2 && + isLeafNode(nodes[idx ^ 1]) + ) { + return nodes[idx ^ 1]; + } + + if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { + return newNode; + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newBitmap = exists ? (newNode ? bitmap : bitmap ^ bit) : bitmap | bit; + var newNodes = exists + ? newNode + ? setAt(nodes, idx, newNode, isEditable) + : spliceOut(nodes, idx, isEditable) + : spliceIn(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.bitmap = newBitmap; + this.nodes = newNodes; + return this; + } + + return new BitmapIndexedNode(ownerID, newBitmap, newNodes); +}; + +var HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) { + this.ownerID = ownerID; + this.count = count; + this.nodes = nodes; +}; + +HashArrayMapNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var node = this.nodes[idx]; + return node + ? node.get(shift + SHIFT, keyHash, key, notSetValue) + : notSetValue; +}; + +HashArrayMapNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var removed = value === NOT_SET; + var nodes = this.nodes; + var node = nodes[idx]; + + if (removed && !node) { + return this; + } + + var newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); + if (newNode === node) { + return this; + } + + var newCount = this.count; + if (!node) { + newCount++; + } else if (!newNode) { + newCount--; + if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { + return packNodes(ownerID, nodes, newCount, idx); + } + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newNodes = setAt(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.count = newCount; + this.nodes = newNodes; + return this; + } + + return new HashArrayMapNode(ownerID, newCount, newNodes); +}; + +/** + * Trie leaf gathering entries whose keys all share the same 32-bit `hash()`. + * The trie routes by hash, so colliding keys cannot be separated and land here + * in a flat `entries` array, disambiguated by `is()`. + * + * To guard against hash-flooding DoS (CWE-407), large buckets build a secondary + * index keyed by a per-process seeded hash (`hashCollisionKey`). `is()` still + * decides equality, so the index can only ever narrow candidates, never lose a key. + */ +var HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entries = entries; + // Lazy `{ [secondaryHash]: number[] }`, built only past + // MIN_HASH_COLLISION_INDEX_SIZE so small buckets keep their linear path. + this._index = undefined; +}; + +// Returns the position of `key` in `this.entries`, or -1. Uses the secondary +// index when present; builds it only when `buildIndex` is true (reads and +// transient inserts, where the node is reused so the O(n) build amortizes). +// Persistent inserts already pay an O(n) copy, so a throwaway index is skipped. +HashCollisionNode.prototype._positionOf = function _positionOf (key, buildIndex) { + var entries = this.entries; + var index = this._index; + if ( + index === undefined && + buildIndex && + entries.length >= MIN_HASH_COLLISION_INDEX_SIZE + ) { + index = this._buildIndex(); + } + if (index !== undefined) { + var positions = index[hashCollisionKey(key)]; + if (positions !== undefined) { + for (var jj = 0; jj < positions.length; jj++) { + var ii = positions[jj]; + if (is(key, entries[ii][0])) { + return ii; + } + } + } + return -1; + } + for (var ii$1 = 0, len = entries.length; ii$1 < len; ii$1++) { + if (is(key, entries[ii$1][0])) { + return ii$1; + } + } + return -1; +}; + +// Builds and memoizes the secondary index. A plain object, not `Map` — which +// in this module resolves to the *Immutable* Map, not the native one. +HashCollisionNode.prototype._buildIndex = function _buildIndex () { + var index = Object.create(null); + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + var secondaryHash = hashCollisionKey(entries[ii][0]); + var positions = index[secondaryHash]; + if (positions !== undefined) { + positions.push(ii); + } else { + index[secondaryHash] = [ii]; + } + } + this._index = index; + return index; +}; + +HashCollisionNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + var idx = this._positionOf(key, true); + return idx === -1 ? notSetValue : this.entries[idx][1]; +}; + +HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + + var removed = value === NOT_SET; + + if (keyHash !== this.keyHash) { + if (removed) { + return this; + } + SetRef(didAlter); + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); + } + + var entries = this.entries; + var len = entries.length; + var isEditable = ownerID && ownerID === this.ownerID; + var foundIdx = this._positionOf(key, isEditable); + var idx = foundIdx === -1 ? len : foundIdx; + var exists = foundIdx !== -1; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + (removed || !exists) && SetRef(didChangeSize); + + if (removed && len === 2) { + return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); + } + + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); + // The swap-pop reshuffles positions; drop the stale index (rebuilt lazily). + if (isEditable) { + this._index = undefined; + } + } else { + // Same key, same position: the index stays valid. + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + // Keep the index in sync on the transient insert path. Persistent inserts + // return a fresh node below whose index rebuilds lazily, so skip them. + if (isEditable && this._index !== undefined) { + var secondaryHash = hashCollisionKey(key); + var positions = this._index[secondaryHash]; + if (positions !== undefined) { + positions.push(len); + } else { + this._index[secondaryHash] = [len]; + } + } + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new HashCollisionNode(ownerID, this.keyHash, newEntries); +}; + +var ValueNode = function ValueNode(ownerID, keyHash, entry) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entry = entry; +}; + +ValueNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + return is(key, this.entry[0]) ? this.entry[1] : notSetValue; +}; + +ValueNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + var keyMatch = is(key, this.entry[0]); + if (keyMatch ? value === this.entry[1] : removed) { + return this; + } + + SetRef(didAlter); + + if (removed) { + SetRef(didChangeSize); + return; // undefined + } + + if (keyMatch) { + if (ownerID && ownerID === this.ownerID) { + this.entry[1] = value; + return this; + } + return new ValueNode(ownerID, this.keyHash, [key, value]); + } + + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); +}; + +// #pragma Iterators + +ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = + function (fn, reverse) { + var entries = this.entries; + for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { + if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { + return false; + } + } + }; + +BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = + function (fn, reverse) { + var nodes = this.nodes; + for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { + var node = nodes[reverse ? maxIndex - ii : ii]; + if (node && node.iterate(fn, reverse) === false) { + return false; + } + } + }; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +ValueNode.prototype.iterate = function (fn, reverse) { + return fn(this.entry); +}; + +var MapIterator = /*@__PURE__*/(function (Iterator) { + function MapIterator(map, type, reverse) { + this._type = type; + this._reverse = reverse; + this._stack = map._root && mapIteratorFrame(map._root); + } + + if ( Iterator ) MapIterator.__proto__ = Iterator; + MapIterator.prototype = Object.create( Iterator && Iterator.prototype ); + MapIterator.prototype.constructor = MapIterator; + + MapIterator.prototype.next = function next () { + var type = this._type; + var stack = this._stack; + while (stack) { + var node = stack.node; + var index = stack.index++; + var maxIndex = (void 0); + if (node.entry) { + if (index === 0) { + return mapIteratorValue(type, node.entry); + } + } else if (node.entries) { + maxIndex = node.entries.length - 1; + if (index <= maxIndex) { + return mapIteratorValue( + type, + node.entries[this._reverse ? maxIndex - index : index] + ); + } + } else { + maxIndex = node.nodes.length - 1; + if (index <= maxIndex) { + var subNode = node.nodes[this._reverse ? maxIndex - index : index]; + if (subNode) { + if (subNode.entry) { + return mapIteratorValue(type, subNode.entry); + } + stack = this._stack = mapIteratorFrame(subNode, stack); + } + continue; + } + } + stack = this._stack = this._stack.__prev; + } + return iteratorDone(); + }; + + return MapIterator; +}(Iterator)); + +function mapIteratorValue(type, entry) { + return iteratorValue(type, entry[0], entry[1]); +} + +function mapIteratorFrame(node, prev) { + return { + node: node, + index: 0, + __prev: prev, + }; +} + +function makeMap(size, root, ownerID, hash) { + var map = Object.create(MapPrototype); + map.size = size; + map._root = root; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; +} + +var EMPTY_MAP; +function emptyMap() { + return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); +} + +function updateMap(map, k, v) { + var newRoot; + var newSize; + if (!map._root) { + if (v === NOT_SET) { + return map; + } + newSize = 1; + newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); + } else { + var didChangeSize = MakeRef(); + var didAlter = MakeRef(); + newRoot = updateNode( + map._root, + map.__ownerID, + 0, + undefined, + k, + v, + didChangeSize, + didAlter + ); + if (!didAlter.value) { + return map; + } + newSize = map.size + (didChangeSize.value ? (v === NOT_SET ? -1 : 1) : 0); + } + if (map.__ownerID) { + map.size = newSize; + map._root = newRoot; + map.__hash = undefined; + map.__altered = true; + return map; + } + return newRoot ? makeMap(newSize, newRoot) : emptyMap(); +} + +function updateNode( + node, + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter +) { + if (!node) { + if (value === NOT_SET) { + return node; + } + SetRef(didAlter); + SetRef(didChangeSize); + return new ValueNode(ownerID, keyHash, [key, value]); + } + return node.update( + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter + ); +} + +function isLeafNode(node) { + return ( + node.constructor === ValueNode || node.constructor === HashCollisionNode + ); +} + +function mergeIntoNode(node, ownerID, shift, keyHash, entry) { + if (node.keyHash === keyHash) { + return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); + } + + var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; + var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + + var newNode; + var nodes = + idx1 === idx2 + ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] + : ((newNode = new ValueNode(ownerID, keyHash, entry)), + idx1 < idx2 ? [node, newNode] : [newNode, node]); + + return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); +} + +function createNodes(ownerID, entries, key, value) { + if (!ownerID) { + ownerID = new OwnerID(); + } + var node = new ValueNode(ownerID, hash(key), [key, value]); + for (var ii = 0; ii < entries.length; ii++) { + var entry = entries[ii]; + node = node.update(ownerID, 0, undefined, entry[0], entry[1]); + } + return node; +} + +function packNodes(ownerID, nodes, count, excluding) { + var bitmap = 0; + var packedII = 0; + var packedNodes = new Array(count); + for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { + var node = nodes[ii]; + if (node !== undefined && ii !== excluding) { + bitmap |= bit; + packedNodes[packedII++] = node; + } + } + return new BitmapIndexedNode(ownerID, bitmap, packedNodes); +} + +function expandNodes(ownerID, nodes, bitmap, including, node) { + var count = 0; + var expandedNodes = new Array(SIZE); + for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { + expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; + } + expandedNodes[including] = node; + return new HashArrayMapNode(ownerID, count + 1, expandedNodes); +} + +function popCount(x) { + x -= (x >> 1) & 0x55555555; + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0f0f0f0f; + x += x >> 8; + x += x >> 16; + return x & 0x7f; +} + +function setAt(array, idx, val, canEdit) { + var newArray = canEdit ? array : arrCopy(array); + newArray[idx] = val; + return newArray; +} + +function spliceIn(array, idx, val, canEdit) { + var newLen = array.length + 1; + if (canEdit && idx + 1 === newLen) { + array[idx] = val; + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + newArray[ii] = val; + after = -1; + } else { + newArray[ii] = array[ii + after]; + } + } + return newArray; +} + +function spliceOut(array, idx, canEdit) { + var newLen = array.length - 1; + if (canEdit && idx === newLen) { + array.pop(); + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + after = 1; + } + newArray[ii] = array[ii + after]; + } + return newArray; +} + +var MAX_ARRAY_MAP_SIZE = SIZE / 4; +var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; +var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; + +// Above this many colliding entries, a `HashCollisionNode` builds a seeded +// secondary index instead of scanning linearly. Kept small so the rare, +// naturally-occurring collision buckets stay overhead-free, while adversarial +// hash-flooding (thousands of keys sharing one hash) degrades gracefully. +var MIN_HASH_COLLISION_INDEX_SIZE = 16; + +function coerceKeyPath(keyPath) { + if (isArrayLike(keyPath) && typeof keyPath !== 'string') { + return keyPath; + } + if (isOrdered(keyPath)) { + return keyPath.toArray(); + } + throw new TypeError('Invalid keyPath: expected Ordered Collection or Array: ' + keyPath); +} + +/** + * Converts a value to a string, adding quotes if a string was provided. + */ +function quoteString(value) { + try { + return typeof value === 'string' ? JSON.stringify(value) : String(value); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } + catch (_ignoreError) { + return JSON.stringify(value); + } +} + +/** + * Returns true if the key is defined in the provided collection. + * + * A functional alternative to `collection.has(key)` which will also work with + * plain Objects and Arrays as an alternative for + * `collection.hasOwnProperty(key)`. + */ +function has(collection, key) { + return isImmutable(collection) + ? // @ts-expect-error key might be a number or symbol, which is not handled be Record key type + collection.has(key) + : // @ts-expect-error key might be anything else than PropertyKey, and will return false in that case but runtime is OK + isDataStructure(collection) && hasOwnProperty.call(collection, key); +} + +function get(collection, key, notSetValue) { + return isImmutable(collection) + ? collection.get(key, notSetValue) + : !has(collection, key) + ? notSetValue + : // @ts-expect-error weird "get" here, + typeof collection.get === 'function' + ? // @ts-expect-error weird "get" here, + collection.get(key) + : // @ts-expect-error key is unknown here, + collection[key]; +} + +function remove(collection, key) { + if (!isDataStructure(collection)) { + throw new TypeError('Cannot update non-data-structure value: ' + collection); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "remove" here, + if (!collection.remove) { + throw new TypeError('Cannot update immutable value without .remove() method: ' + collection); + } + // @ts-expect-error weird "remove" here, + return collection.remove(key); + } + // @ts-expect-error assert that key is a string, a number or a symbol here + if (!hasOwnProperty.call(collection, key)) { + return collection; + } + var collectionCopy = shallowCopy(collection); + if (Array.isArray(collectionCopy)) { + // @ts-expect-error assert that key is a number here + collectionCopy.splice(key, 1); + } + else { + // @ts-expect-error assert that key is a string, a number or a symbol here + delete collectionCopy[key]; + } + return collectionCopy; +} + +function set(collection, key, value) { + if (isProtoKey(key)) { + return collection; + } + if (!isDataStructure(collection)) { + throw new TypeError('Cannot update non-data-structure value: ' + collection); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "set" here, + if (!collection.set) { + throw new TypeError('Cannot update immutable value without .set() method: ' + collection); + } + // @ts-expect-error weird "set" here, + return collection.set(key, value); + } + // @ts-expect-error mix of key and string here. Probably need a more fine type here + if (hasOwnProperty.call(collection, key) && value === collection[key]) { + return collection; + } + var collectionCopy = shallowCopy(collection); + // @ts-expect-error mix of key and string here. Probably need a more fine type here + collectionCopy[key] = value; + return collectionCopy; +} + +function updateIn(collection, keyPath, notSetValue, updater) { + if (!updater) { + // handle the fact that `notSetValue` is optional here, in that case `updater` is the updater function + // @ts-expect-error updater is a function here + updater = notSetValue; + notSetValue = undefined; + } + var updatedValue = updateInDeeply(isImmutable(collection), + // @ts-expect-error type issues with Record and mixed types + collection, coerceKeyPath(keyPath), 0, notSetValue, updater); + // @ts-expect-error mixed return type + return updatedValue === NOT_SET ? notSetValue : updatedValue; +} +function updateInDeeply(inImmutable, existing, keyPath, i, notSetValue, updater) { + var wasNotSet = existing === NOT_SET; + if (i === keyPath.length) { + var existingValue = wasNotSet ? notSetValue : existing; + // @ts-expect-error mixed type with optional value + var newValue = updater(existingValue); + // @ts-expect-error mixed type + return newValue === existingValue ? existing : newValue; + } + if (!wasNotSet && !isDataStructure(existing)) { + throw new TypeError('Cannot update within non-data-structure value in path [' + + Array.from(keyPath).slice(0, i).map(quoteString) + + ']: ' + + existing); + } + var key = keyPath[i]; + var nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); + var nextUpdated = updateInDeeply(nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), + // @ts-expect-error mixed type + nextExisting, keyPath, i + 1, notSetValue, updater); + return nextUpdated === nextExisting + ? existing + : nextUpdated === NOT_SET + ? remove(existing, key) + : set(wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, key, nextUpdated); +} + +/** + * Returns a copy of the collection with the value at the key path removed. + * + * A functional alternative to `collection.removeIn(keypath)` which will also + * work with plain Objects and Arrays. + */ +function removeIn(collection, keyPath) { + return updateIn(collection, keyPath, function () { return NOT_SET; }); +} + +function deleteIn(keyPath) { + return removeIn(this, keyPath); +} + +var IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@'; +/** + * True if `maybeList` is a List. + */ +function isList(maybeList) { + return Boolean(maybeList && + // @ts-expect-error: maybeList is typed as `{}`, need to change in 6.0 to `maybeList && typeof maybeList === 'object' && IS_LIST_SYMBOL in maybeList` + maybeList[IS_LIST_SYMBOL]); +} + +var List = /*@__PURE__*/(function (IndexedCollection) { + function List(value) { + var empty = emptyList(); + if (value === undefined || value === null) { + // eslint-disable-next-line no-constructor-return + return empty; + } + if (isList(value)) { + // eslint-disable-next-line no-constructor-return + return value; + } + var iter = IndexedCollection(value); + var size = iter.size; + if (size === 0) { + // eslint-disable-next-line no-constructor-return + return empty; + } + assertNotInfinite(size); + if (size > 0 && size < SIZE) { + // eslint-disable-next-line no-constructor-return + return makeList(0, size, SHIFT, undefined, new VNode(iter.toArray())); + } + // eslint-disable-next-line no-constructor-return + return empty.withMutations(function (list) { + list.setSize(size); + iter.forEach(function (v, i) { return list.set(i, v); }); + }); + } + + if ( IndexedCollection ) List.__proto__ = IndexedCollection; + List.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + List.prototype.constructor = List; + + List.of = function of (/*...values*/) { + return this(arguments); + }; + + List.prototype.toString = function toString () { + return this.__toString('List [', ']'); + }; + + // @pragma Access + + List.prototype.get = function get (index, notSetValue) { + index = wrapIndex(this, index); + if (index >= 0 && index < this.size) { + index += this._origin; + var node = listNodeFor(this, index); + return node && node.array[index & MASK]; + } + return notSetValue; + }; + + // @pragma Modification + + List.prototype.set = function set (index, value) { + return updateList(this, index, value); + }; + + List.prototype.remove = function remove (index) { + return !this.has(index) + ? this + : index === 0 + ? this.shift() + : index === this.size - 1 + ? this.pop() + : this.splice(index, 1); + }; + + List.prototype.insert = function insert (index, value) { + return this.splice(index, 0, value); + }; + + List.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = this._origin = this._capacity = 0; + this._level = SHIFT; + this._root = this._tail = this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyList(); + }; + + List.prototype.push = function push (/*...values*/) { + var values = arguments; + var oldSize = this.size; + return this.withMutations(function (list) { + setListBounds(list, 0, oldSize + values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(oldSize + ii, values[ii]); + } + }); + }; + + List.prototype.pop = function pop () { + return setListBounds(this, 0, -1); + }; + + List.prototype.unshift = function unshift (/*...values*/) { + var values = arguments; + return this.withMutations(function (list) { + setListBounds(list, -values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(ii, values[ii]); + } + }); + }; + + List.prototype.shift = function shift () { + return setListBounds(this, 1); + }; + + List.prototype.shuffle = function shuffle (random) { + if ( random === void 0 ) random = Math.random; + + return this.withMutations(function (mutable) { + // implementation of the Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle + var current = mutable.size; + var destination; + var tmp; + + while (current) { + destination = Math.floor(random() * current--); + + tmp = mutable.get(destination); + mutable.set(destination, mutable.get(current)); + mutable.set(current, tmp); + } + }); + }; + + // @pragma Composition + + List.prototype.concat = function concat (/*...collections*/) { + var arguments$1 = arguments; + + var seqs = []; + for (var i = 0; i < arguments.length; i++) { + var argument = arguments$1[i]; + var seq = IndexedCollection( + typeof argument !== 'string' && hasIterator(argument) + ? argument + : [argument] + ); + if (seq.size !== 0) { + seqs.push(seq); + } + } + if (seqs.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && seqs.length === 1) { + return this.constructor(seqs[0]); + } + return this.withMutations(function (list) { + seqs.forEach(function (seq) { return seq.forEach(function (value) { return list.push(value); }); }); + }); + }; + + List.prototype.setSize = function setSize (size) { + return setListBounds(this, 0, size); + }; + + List.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (list) { + for (var i = 0; i < this$1$1.size; i++) { + list.set(i, mapper.call(context, list.get(i), i, this$1$1)); + } + }); + }; + + // @pragma Iteration + + List.prototype.slice = function slice (begin, end) { + var size = this.size; + if (wholeSlice(begin, end, size)) { + return this; + } + return setListBounds( + this, + resolveBegin(begin, size), + resolveEnd(end, size) + ); + }; + + List.prototype.__iterator = function __iterator (type, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + return new Iterator(function () { + var value = values(); + return value === DONE + ? iteratorDone() + : iteratorValue(type, reverse ? --index : index++, value); + }); + }; + + List.prototype.__iterate = function __iterate (fn, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + var value; + while ((value = values()) !== DONE) { + if (fn(value, reverse ? --index : index++, this) === false) { + break; + } + } + return index; + }; + + List.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyList(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeList( + this._origin, + this._capacity, + this._level, + this._root, + this._tail, + ownerID, + this.__hash + ); + }; + + return List; +}(IndexedCollection)); + +List.isList = isList; + +var ListPrototype = List.prototype; +ListPrototype[IS_LIST_SYMBOL] = true; +ListPrototype[DELETE] = ListPrototype.remove; +ListPrototype.merge = ListPrototype.concat; +ListPrototype.setIn = setIn; +ListPrototype.deleteIn = ListPrototype.removeIn = deleteIn; +ListPrototype.update = update; +ListPrototype.updateIn = updateIn$1; +ListPrototype.mergeIn = mergeIn; +ListPrototype.mergeDeepIn = mergeDeepIn; +ListPrototype.withMutations = withMutations; +ListPrototype.wasAltered = wasAltered; +ListPrototype.asImmutable = asImmutable; +ListPrototype['@@transducer/init'] = ListPrototype.asMutable = asMutable; +ListPrototype['@@transducer/step'] = function (result, arr) { + return result.push(arr); +}; +ListPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; + +/** + * A node in the List's 32-wide trie. At inner levels `array` holds child + * `VNode`s; at the leaf level it holds the List's values. Missing slots are + * `undefined` array holes. + * + * @template T + */ +var VNode = function VNode(array, ownerID) { + this.array = array; + this.ownerID = ownerID; +}; + +// TODO: seems like these methods are very similar + +VNode.prototype.removeBefore = function removeBefore (ownerID, level, index) { + if ( + (index & ((1 << (level + SHIFT)) - 1)) === 0 || + this.array.length === 0 + ) { + return this; + } + var originIndex = (index >>> level) & MASK; + if (originIndex >= this.array.length) { + return new VNode([], ownerID); + } + var removingFirst = originIndex === 0; + var newChild; + if (level > 0) { + var oldChild = this.array[originIndex]; + newChild = + oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); + if (newChild === oldChild && removingFirst) { + return this; + } + } + if (removingFirst && !newChild) { + return this; + } + var editable = editableVNode(this, ownerID); + if (!removingFirst) { + for (var ii = 0; ii < originIndex; ii++) { + editable.array[ii] = undefined; + } + } + if (newChild) { + editable.array[originIndex] = newChild; + } + return editable; +}; + +VNode.prototype.removeAfter = function removeAfter (ownerID, level, index) { + if ( + index === (level ? 1 << (level + SHIFT) : SIZE) || + this.array.length === 0 + ) { + return this; + } + var sizeIndex = ((index - 1) >>> level) & MASK; + if (sizeIndex >= this.array.length) { + return this; + } + + var newChild; + if (level > 0) { + var oldChild = this.array[sizeIndex]; + newChild = + oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + if (newChild === oldChild && sizeIndex === this.array.length - 1) { + return this; + } + } + + var editable = editableVNode(this, ownerID); + editable.array.splice(sizeIndex + 1); + if (newChild) { + editable.array[sizeIndex] = newChild; + } + return editable; +}; + +var DONE = {}; + +function iterateList(list, reverse) { + var left = list._origin; + var right = list._capacity; + var tailPos = getTailOffset(right); + var tail = list._tail; + + return iterateNodeOrLeaf(list._root, list._level, 0); + + function iterateNodeOrLeaf(node, level, offset) { + return level === 0 + ? iterateLeaf(node, offset) + : iterateNode(node, level, offset); + } + + function iterateLeaf(node, offset) { + var array = offset === tailPos ? tail && tail.array : node && node.array; + var from = offset > left ? 0 : left - offset; + var to = right - offset; + if (to > SIZE) { + to = SIZE; + } + return function () { + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + return array && array[idx]; + }; + } + + function iterateNode(node, level, offset) { + var values; + var array = node && node.array; + var from = offset > left ? 0 : (left - offset) >> level; + var to = ((right - offset) >> level) + 1; + if (to > SIZE) { + to = SIZE; + } + return function () { + while (true) { + if (values) { + var value = values(); + if (value !== DONE) { + return value; + } + values = null; + } + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + values = iterateNodeOrLeaf( + array && array[idx], + level - SHIFT, + offset + (idx << level) + ); + } + }; + } +} + +/** + * @param {number} origin + * @param {number} capacity + * @param {number} level + * @param {VNode | undefined} [root] The trie root, or `undefined` when every + * in-range value lives in the tail (or is a virtual `undefined`). + * @param {VNode | undefined} [tail] + * @param {OwnerID} [ownerID] + * @param {number} [hash] + */ +function makeList(origin, capacity, level, root, tail, ownerID, hash) { + var list = Object.create(ListPrototype); + list.size = capacity - origin; + list._origin = origin; + list._capacity = capacity; + list._level = level; + list._root = root; + list._tail = tail; + list.__ownerID = ownerID; + list.__hash = hash; + list.__altered = false; + return list; +} + +function emptyList() { + return makeList(0, 0, SHIFT); +} + +function updateList(list, index, value) { + index = wrapIndex(list, index); + + if (index !== index) { + return list; + } + + if (index >= list.size || index < 0) { + return list.withMutations(function (list) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + index < 0 + ? setListBounds(list, index).set(0, value) + : setListBounds(list, 0, index + 1).set(index, value); + }); + } + + index += list._origin; + + var newTail = list._tail; + var newRoot = list._root; + var didAlter = MakeRef(); + if (index >= getTailOffset(list._capacity)) { + newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); + } else { + newRoot = updateVNode( + newRoot, + list.__ownerID, + list._level, + index, + value, + didAlter + ); + } + + if (!didAlter.value) { + return list; + } + + if (list.__ownerID) { + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(list._origin, list._capacity, list._level, newRoot, newTail); +} + +function updateVNode(node, ownerID, level, index, value, didAlter) { + var idx = (index >>> level) & MASK; + var nodeHas = node && idx < node.array.length; + if (!nodeHas && value === undefined) { + return node; + } + + var newNode; + + if (level > 0) { + var lowerNode = node && node.array[idx]; + var newLowerNode = updateVNode( + lowerNode, + ownerID, + level - SHIFT, + index, + value, + didAlter + ); + if (newLowerNode === lowerNode) { + return node; + } + newNode = editableVNode(node, ownerID); + newNode.array[idx] = newLowerNode; + return newNode; + } + + if (nodeHas && node.array[idx] === value) { + return node; + } + + if (didAlter) { + SetRef(didAlter); + } + + newNode = editableVNode(node, ownerID); + if (value === undefined && idx === newNode.array.length - 1) { + newNode.array.pop(); + } else { + newNode.array[idx] = value; + } + return newNode; +} + +function editableVNode(node, ownerID) { + if (ownerID && node && ownerID === node.ownerID) { + return node; + } + return new VNode(node ? node.array.slice() : [], ownerID); +} + +/** + * Returns the leaf `VNode` holding `rawIndex`, or `undefined` when no node is + * allocated for it (an all-`undefined` region). + * + * @param {List} list + * @param {number} rawIndex + * @returns {VNode | undefined} + */ +function listNodeFor(list, rawIndex) { + if (rawIndex >= getTailOffset(list._capacity)) { + return list._tail; + } + if (rawIndex < 1 << (list._level + SHIFT)) { + var node = list._root; + var level = list._level; + while (node && level > 0) { + node = node.array[(rawIndex >>> level) & MASK]; + level -= SHIFT; + } + return node; + } +} + +/** + * Validates requested bounds before int32 coercion in setListBounds(). + * Throws when origin/capacity would exceed the trie's safe range. + */ +function validateListBoundsRequest(list, begin, end) { + var requestedOrigin = list._origin + (begin === undefined ? 0 : begin); + var requestedCapacity = + end === undefined + ? list._capacity + : end < 0 + ? list._capacity + end + : list._origin + end; + + // Keep origin/capacity within the trie's safe signed 32-bit range. + if ( + (Number.isFinite(requestedCapacity) && requestedCapacity > MAX_LIST_SIZE) || + (Number.isFinite(requestedOrigin) && requestedOrigin < -MAX_LIST_SIZE) || + (Number.isFinite(requestedCapacity) && + Number.isFinite(requestedOrigin) && + requestedCapacity - requestedOrigin > MAX_LIST_SIZE) + ) { + throw new RangeError( + 'Invalid List size: a List cannot hold more than ' + + MAX_LIST_SIZE + + ' (2 ** 30) values.' + ); + } +} + +function setListBounds(list, begin, end) { + // Validate full-precision bounds before int32 coercion. + validateListBoundsRequest(list, begin, end); + + // Sanitize begin & end using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + if (begin !== undefined) { + begin |= 0; + } + if (end !== undefined) { + end |= 0; + } + var owner = list.__ownerID || new OwnerID(); + var oldOrigin = list._origin; + var oldCapacity = list._capacity; + var newOrigin = oldOrigin + begin; + var newCapacity = + end === undefined + ? oldCapacity + : end < 0 + ? oldCapacity + end + : oldOrigin + end; + if (newOrigin === oldOrigin && newCapacity === oldCapacity) { + return list; + } + + // If it's going to end after it starts, it's empty. + if (newOrigin >= newCapacity) { + return list.clear(); + } + + var newLevel = list._level; + var newRoot = list._root; + + // New origin might need creating a higher root. + var offsetShift = 0; + while (newOrigin + offsetShift < 0) { + newRoot = new VNode( + newRoot && newRoot.array.length ? [undefined, newRoot] : [], + owner + ); + newLevel += SHIFT; + // Shift origin into non-negative space as trie height grows. + offsetShift += levelCapacity(newLevel); + } + if (offsetShift) { + newOrigin += offsetShift; + oldOrigin += offsetShift; + newCapacity += offsetShift; + oldCapacity += offsetShift; + } + + var oldTailOffset = getTailOffset(oldCapacity); + var newTailOffset = getTailOffset(newCapacity); + + // New size might need creating a higher root. + while (newTailOffset >= levelCapacity(newLevel + SHIFT)) { + newRoot = new VNode( + newRoot && newRoot.array.length ? [newRoot] : [], + owner + ); + newLevel += SHIFT; + } + + // Locate or create the new tail. + var oldTail = list._tail; + var newTail = + newTailOffset < oldTailOffset + ? listNodeFor(list, newCapacity - 1) + : newTailOffset > oldTailOffset + ? new VNode([], owner) + : oldTail; + + // Merge Tail into tree. + if ( + oldTail && + newTailOffset > oldTailOffset && + newOrigin < oldCapacity && + oldTail.array.length + ) { + newRoot = editableVNode(newRoot, owner); + var node = newRoot; + for (var level = newLevel; level > SHIFT; level -= SHIFT) { + var idx = (oldTailOffset >>> level) & MASK; + node = node.array[idx] = editableVNode(node.array[idx], owner); + } + node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; + } + + // If the size has been reduced, there's a chance the tail needs to be trimmed. + if (newCapacity < oldCapacity) { + newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); + } + + // If the new origin is within the tail, then we do not need a root. + if (newOrigin >= newTailOffset) { + newOrigin -= newTailOffset; + newCapacity -= newTailOffset; + newLevel = SHIFT; + newRoot = undefined; + newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); + + // Otherwise, if the root has been trimmed, garbage collect. + } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { + offsetShift = 0; + + // Identify the new top root node of the subtree of the old root. + while (newRoot) { + var beginIndex = (newOrigin >>> newLevel) & MASK; + if ((beginIndex !== newTailOffset >>> newLevel) & MASK) { + break; + } + if (beginIndex) { + offsetShift += (1 << newLevel) * beginIndex; + } + newLevel -= SHIFT; + newRoot = newRoot.array[beginIndex]; + } + + // Trim the new sides of the new root. + if (newRoot && newOrigin > oldOrigin) { + newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); + } + if (newRoot && newTailOffset < oldTailOffset) { + newRoot = newRoot.removeAfter( + owner, + newLevel, + newTailOffset - offsetShift + ); + } + if (offsetShift) { + newOrigin -= offsetShift; + newCapacity -= offsetShift; + } + } + + if (list.__ownerID) { + list.size = newCapacity - newOrigin; + list._origin = newOrigin; + list._capacity = newCapacity; + list._level = newLevel; + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); +} + +function getTailOffset(size) { + return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT; +} + +// The largest number of values a List can hold. Above this the 32-bit trie math +// in setListBounds() stays in the safe signed 32-bit range. +var MAX_LIST_SIZE = Math.pow( 2, 30 ); // 1073741824 + +/** + * Computes 2 ** exp for the trie level-raising loops in setListBounds(). + * Use the cheap bitwise operator shift whenever possible, otherwise fall back to exponentiation. + * This is necessary because bitwise operators in JavaScript only work on 32-bit signed integers, so for exp >= 31, we need to use exponentiation to avoid overflow. + */ +function levelCapacity(exp) { + return exp < 31 ? 1 << exp : Math.pow( 2, exp ); +} + +/** + * True if `maybeOrderedMap` is an OrderedMap. + */ +function isOrderedMap(maybeOrderedMap) { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); +} + +var OrderedMap = /*@__PURE__*/(function (Map) { + function OrderedMap(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedMap() + : isOrderedMap(value) + ? value + : emptyOrderedMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( Map ) OrderedMap.__proto__ = Map; + OrderedMap.prototype = Object.create( Map && Map.prototype ); + OrderedMap.prototype.constructor = OrderedMap; + + OrderedMap.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedMap.prototype.toString = function toString () { + return this.__toString('OrderedMap {', '}'); + }; + + // @pragma Access + + OrderedMap.prototype.get = function get (k, notSetValue) { + var index = this._map.get(k); + return index !== undefined ? this._list.get(index)[1] : notSetValue; + }; + + // @pragma Modification + + OrderedMap.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._map.clear(); + this._list.clear(); + this.__altered = true; + return this; + } + return emptyOrderedMap(); + }; + + OrderedMap.prototype.set = function set (k, v) { + return updateOrderedMap(this, k, v); + }; + + OrderedMap.prototype.remove = function remove (k) { + return updateOrderedMap(this, k, NOT_SET); + }; + + OrderedMap.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._list.__iterate( + function (entry) { return entry && fn(entry[1], entry[0], this$1$1); }, + reverse + ); + }; + + OrderedMap.prototype.__iterator = function __iterator (type, reverse) { + return this._list.fromEntrySeq().__iterator(type, reverse); + }; + + OrderedMap.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + var newList = this._list.__ensureOwner(ownerID); + if (!ownerID) { + if (this.size === 0) { + return emptyOrderedMap(); + } + this.__ownerID = ownerID; + this.__altered = false; + this._map = newMap; + this._list = newList; + return this; + } + return makeOrderedMap(newMap, newList, ownerID, this.__hash); + }; + + return OrderedMap; +}(Map)); + +OrderedMap.isOrderedMap = isOrderedMap; + +OrderedMap.prototype[IS_ORDERED_SYMBOL] = true; +OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; + +function makeOrderedMap(map, list, ownerID, hash) { + var omap = Object.create(OrderedMap.prototype); + omap.size = map ? map.size : 0; + omap._map = map; + omap._list = list; + omap.__ownerID = ownerID; + omap.__hash = hash; + omap.__altered = false; + return omap; +} + +var EMPTY_ORDERED_MAP; +function emptyOrderedMap() { + return ( + EMPTY_ORDERED_MAP || + (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())) + ); +} + +function updateOrderedMap(omap, k, v) { + var map = omap._map; + var list = omap._list; + var i = map.get(k); + var has = i !== undefined; + var newMap; + var newList; + if (v === NOT_SET) { + // removed + if (!has) { + return omap; + } + if (list.size >= SIZE && list.size >= map.size * 2) { + newList = list.filter(function (entry, idx) { return entry !== undefined && i !== idx; }); + newMap = newList + .toKeyedSeq() + .map(function (entry) { return entry[0]; }) + .flip() + .toMap(); + if (omap.__ownerID) { + newMap.__ownerID = newList.__ownerID = omap.__ownerID; + } + } else { + newMap = map.remove(k); + newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); + } + } else if (has) { + if (v === list.get(i)[1]) { + return omap; + } + newMap = map; + newList = list.set(i, [k, v]); + } else { + newMap = map.set(k, list.size); + newList = list.set(list.size, [k, v]); + } + if (omap.__ownerID) { + omap.size = newMap.size; + omap._map = newMap; + omap._list = newList; + omap.__hash = undefined; + omap.__altered = true; + return omap; + } + return makeOrderedMap(newMap, newList); +} + +var IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@'; +/** + * True if `maybeStack` is a Stack. + */ +function isStack(maybeStack) { + return Boolean(maybeStack && + // @ts-expect-error: maybeStack is typed as `{}`, need to change in 6.0 to `maybeStack && typeof maybeStack === 'object' && MAYBE_STACK_SYMBOL in maybeStack` + maybeStack[IS_STACK_SYMBOL]); +} + +var Stack = /*@__PURE__*/(function (IndexedCollection) { + function Stack(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyStack() + : isStack(value) + ? value + : emptyStack().pushAll(value); + } + + if ( IndexedCollection ) Stack.__proto__ = IndexedCollection; + Stack.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + Stack.prototype.constructor = Stack; + + Stack.of = function of (/*...values*/) { + return this(arguments); + }; + + Stack.prototype.toString = function toString () { + return this.__toString('Stack [', ']'); + }; + + // @pragma Access + + Stack.prototype.get = function get (index, notSetValue) { + var head = this._head; + index = wrapIndex(this, index); + while (head && index--) { + head = head.next; + } + return head ? head.value : notSetValue; + }; + + Stack.prototype.peek = function peek () { + return this._head && this._head.value; + }; + + // @pragma Modification + + Stack.prototype.push = function push (/*...values*/) { + var arguments$1 = arguments; + + if (arguments.length === 0) { + return this; + } + var newSize = this.size + arguments.length; + var head = this._head; + for (var ii = arguments.length - 1; ii >= 0; ii--) { + head = { + value: arguments$1[ii], + next: head, + }; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pushAll = function pushAll (iter) { + iter = IndexedCollection(iter); + if (iter.size === 0) { + return this; + } + if (this.size === 0 && isStack(iter)) { + return iter; + } + assertNotInfinite(iter.size); + var newSize = this.size; + var head = this._head; + iter.__iterate(function (value) { + newSize++; + head = { + value: value, + next: head, + }; + }, /* reverse */ true); + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pop = function pop () { + return this.slice(1); + }; + + Stack.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._head = undefined; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyStack(); + }; + + Stack.prototype.slice = function slice (begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + var resolvedBegin = resolveBegin(begin, this.size); + var resolvedEnd = resolveEnd(end, this.size); + if (resolvedEnd !== this.size) { + // super.slice(begin, end); + return IndexedCollection.prototype.slice.call(this, begin, end); + } + var newSize = this.size - resolvedBegin; + var head = this._head; + while (resolvedBegin--) { + head = head.next; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + // @pragma Mutability + + Stack.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyStack(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeStack(this.size, this._head, ownerID, this.__hash); + }; + + // @pragma Iteration + + Stack.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return new ArraySeq(this.toArray()).__iterate( + function (v, k) { return fn(v, k, this$1$1); }, + reverse + ); + } + var iterations = 0; + var node = this._head; + while (node) { + if (fn(node.value, iterations++, this) === false) { + break; + } + node = node.next; + } + return iterations; + }; + + Stack.prototype.__iterator = function __iterator (type, reverse) { + if (reverse) { + return new ArraySeq(this.toArray()).__iterator(type, reverse); + } + var iterations = 0; + var node = this._head; + return new Iterator(function () { + if (node) { + var value = node.value; + node = node.next; + return iteratorValue(type, iterations++, value); + } + return iteratorDone(); + }); + }; + + return Stack; +}(IndexedCollection)); + +Stack.isStack = isStack; + +var StackPrototype = Stack.prototype; +StackPrototype[IS_STACK_SYMBOL] = true; +StackPrototype.shift = StackPrototype.pop; +StackPrototype.unshift = StackPrototype.push; +StackPrototype.unshiftAll = StackPrototype.pushAll; +StackPrototype.withMutations = withMutations; +StackPrototype.wasAltered = wasAltered; +StackPrototype.asImmutable = asImmutable; +StackPrototype['@@transducer/init'] = StackPrototype.asMutable = asMutable; +StackPrototype['@@transducer/step'] = function (result, arr) { + return result.unshift(arr); +}; +StackPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; + +function makeStack(size, head, ownerID, hash) { + var map = Object.create(StackPrototype); + map.size = size; + map._head = head; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; +} + +var EMPTY_STACK; +function emptyStack() { + return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); +} + +function reduce(collection, reducer, reduction, context, useFirst, reverse) { + // @ts-expect-error Migrate to CollectionImpl in v6 + assertNotInfinite(collection.size); + // @ts-expect-error Migrate to CollectionImpl in v6 + collection.__iterate(function (v, k, c) { + if (useFirst) { + useFirst = false; + reduction = v; + } + else { + // `reduction` has already been seeded here (either with the provided + // initial value or with the first iterated value), so it is never the + // `undefined` placeholder — only a `V` or a `R`. + reduction = reducer.call(context, reduction, v, k, c); + } + }, reverse); + return reduction; +} +function keyMapper(v, k) { + return k; +} +function entryMapper(v, k) { + return [k, v]; +} +function not(predicate) { + return function () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return !predicate.apply(this, args); + }; +} +function neg(predicate) { + return function () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return -predicate.apply(this, args); + }; +} +function defaultNegComparator(a, b) { + return a < b ? 1 : a > b ? -1 : 0; +} + +function deepEqual(a, b) { + if (a === b) { + return true; + } + if (!isCollection(b) || + // @ts-expect-error size should exists on Collection + (a.size !== undefined && b.size !== undefined && a.size !== b.size) || + // @ts-expect-error __hash exists on Collection + (a.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + b.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + a.__hash !== b.__hash) || + isKeyed(a) !== isKeyed(b) || + isIndexed(a) !== isIndexed(b) || + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + isOrdered(a) !== isOrdered(b)) { + return false; + } + // @ts-expect-error size should exists on Collection + if (a.size === 0 && b.size === 0) { + return true; + } + var notAssociative = !isAssociative(a); + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + if (isOrdered(a)) { + var entries = a.entries(); + // @ts-expect-error need to cast as boolean + return (b.every(function (v, k) { + var entry = entries.next().value; + return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); + }) && entries.next().done); + } + var flipped = false; + if (a.size === undefined) { + // @ts-expect-error size should exists on Collection + if (b.size === undefined) { + if (typeof a.cacheResult === 'function') { + a.cacheResult(); + } + } + else { + flipped = true; + var _ = a; + a = b; + b = _; + } + } + var allEqual = true; + var bSize = + // @ts-expect-error b is Range | Repeat | Collection as it may have been flipped, and __iterate is valid + b.__iterate(function (v, k) { + if (notAssociative + ? // @ts-expect-error has exists on Collection + !a.has(v) + : flipped + ? // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(v, a.get(k, NOT_SET)) + : // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(a.get(k, NOT_SET), v)) { + allEqual = false; + return false; + } + }); + return (allEqual && + // @ts-expect-error size should exists on Collection + a.size === bSize); +} + +/** + * Returns a lazy seq of nums from start (inclusive) to end + * (exclusive), by step, where start defaults to 0, step to 1, and end to + * infinity. When start is equal to end, returns empty list. + */ +var Range = /*@__PURE__*/(function (IndexedSeq) { + function Range(start, end, step) { + if ( step === void 0 ) step = 1; + + if (!(this instanceof Range)) { + // eslint-disable-next-line no-constructor-return + return new Range(start, end, step); + } + invariant(step !== 0, 'Cannot step a Range by 0'); + invariant( + start !== undefined, + 'You must define a start value when using Range' + ); + invariant( + end !== undefined, + 'You must define an end value when using Range' + ); + + step = Math.abs(step); + if (end < start) { + step = -step; + } + this._start = start; + this._end = end; + this._step = step; + this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); + if (this.size === 0) { + if (EMPTY_RANGE) { + // eslint-disable-next-line no-constructor-return + return EMPTY_RANGE; + } + // eslint-disable-next-line @typescript-eslint/no-this-alias + EMPTY_RANGE = this; + } + } + + if ( IndexedSeq ) Range.__proto__ = IndexedSeq; + Range.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Range.prototype.constructor = Range; + + Range.prototype.toString = function toString () { + return this.size === 0 + ? 'Range []' + : ("Range [ " + (this._start) + "..." + (this._end) + (this._step !== 1 ? ' by ' + this._step : '') + " ]"); + }; + + Range.prototype.get = function get (index, notSetValue) { + return this.has(index) + ? this._start + wrapIndex(this, index) * this._step + : notSetValue; + }; + + Range.prototype.includes = function includes (searchValue) { + var possibleIndex = (searchValue - this._start) / this._step; + return ( + possibleIndex >= 0 && + possibleIndex < this.size && + possibleIndex === Math.floor(possibleIndex) + ); + }; + + Range.prototype.slice = function slice (begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + begin = resolveBegin(begin, this.size); + end = resolveEnd(end, this.size); + if (end <= begin) { + return new Range(0, 0); + } + return new Range( + this.get(begin, this._end), + this.get(end, this._end), + this._step + ); + }; + + Range.prototype.indexOf = function indexOf (searchValue) { + var offsetValue = searchValue - this._start; + if (offsetValue % this._step === 0) { + var index = offsetValue / this._step; + if (index >= 0 && index < this.size) { + return index; + } + } + return -1; + }; + + Range.prototype.lastIndexOf = function lastIndexOf (searchValue) { + return this.indexOf(searchValue); + }; + + Range.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + while (i !== size) { + if (fn(value, reverse ? size - ++i : i++, this) === false) { + break; + } + value += reverse ? -step : step; + } + return i; + }; + + Range.prototype.__iterator = function __iterator (type, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var v = value; + value += reverse ? -step : step; + return iteratorValue(type, reverse ? size - ++i : i++, v); + }); + }; + + Range.prototype.equals = function equals (other) { + return other instanceof Range + ? this._start === other._start && + this._end === other._end && + this._step === other._step + : deepEqual(this, other); + }; + + return Range; +}(IndexedSeq)); + +var EMPTY_RANGE; + +var IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@'; +/** + * True if `maybeSet` is a Set. + * + * Also true for OrderedSets. + */ +function isSet(maybeSet) { + return Boolean(maybeSet && + // @ts-expect-error: maybeSet is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSet === 'object' && MAYBE_SET_SYMBOL in maybeSet` + maybeSet[IS_SET_SYMBOL]); +} + +var Set = /*@__PURE__*/(function (SetCollection) { + function Set(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySet() + : isSet(value) && !isOrdered(value) + ? value + : emptySet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( SetCollection ) Set.__proto__ = SetCollection; + Set.prototype = Object.create( SetCollection && SetCollection.prototype ); + Set.prototype.constructor = Set; + + Set.of = function of (/*...values*/) { + return this(arguments); + }; + + Set.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + Set.intersect = function intersect (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.intersect.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.union = function union (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.union.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.prototype.toString = function toString () { + return this.__toString('Set {', '}'); + }; + + // @pragma Access + + Set.prototype.has = function has (value) { + return this._map.has(value); + }; + + // @pragma Modification + + Set.prototype.add = function add (value) { + return updateSet(this, this._map.set(value, value)); + }; + + Set.prototype.remove = function remove (value) { + return updateSet(this, this._map.remove(value)); + }; + + Set.prototype.clear = function clear () { + return updateSet(this, this._map.clear()); + }; + + // @pragma Composition + + Set.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + // keep track if the set is altered by the map function + var didChanges = false; + + var newMap = updateSet( + this, + this._map.mapEntries(function (ref) { + var v = ref[1]; + + var mapped = mapper.call(context, v, v, this$1$1); + + if (mapped !== v) { + didChanges = true; + } + + return [mapped, mapped]; + }, context) + ); + + return didChanges ? newMap : this; + }; + + Set.prototype.union = function union () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + iters = iters.filter(function (x) { return x.size !== 0; }); + if (iters.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && iters.length === 1) { + return this.constructor(iters[0]); + } + return this.withMutations(function (set) { + for (var ii = 0; ii < iters.length; ii++) { + if (typeof iters[ii] === 'string') { + set.add(iters[ii]); + } else { + SetCollection(iters[ii]).forEach(function (value) { return set.add(value); }); + } + } + }); + }; + + Set.prototype.intersect = function intersect () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (!iters.every(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.subtract = function subtract () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (iters.some(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.sort = function sort (comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator)); + }; + + Set.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator, mapper)); + }; + + Set.prototype.wasAltered = function wasAltered () { + return this._map.wasAltered(); + }; + + Set.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._map.__iterate(function (k) { return fn(k, k, this$1$1); }, reverse); + }; + + Set.prototype.__iterator = function __iterator (type, reverse) { + return this._map.__iterator(type, reverse); + }; + + Set.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + if (!ownerID) { + if (this.size === 0) { + return this.__empty(); + } + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return this.__make(newMap, ownerID); + }; + + return Set; +}(SetCollection)); + +Set.isSet = isSet; + +var SetPrototype = Set.prototype; +SetPrototype[IS_SET_SYMBOL] = true; +SetPrototype[DELETE] = SetPrototype.remove; +SetPrototype.merge = SetPrototype.concat = SetPrototype.union; +SetPrototype.withMutations = withMutations; +SetPrototype.asImmutable = asImmutable; +SetPrototype['@@transducer/init'] = SetPrototype.asMutable = asMutable; +SetPrototype['@@transducer/step'] = function (result, arr) { + return result.add(arr); +}; +SetPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; + +SetPrototype.__empty = emptySet; +SetPrototype.__make = makeSet; + +function updateSet(set, newMap) { + if (set.__ownerID) { + set.size = newMap.size; + set._map = newMap; + return set; + } + return newMap === set._map + ? set + : newMap.size === 0 + ? set.__empty() + : set.__make(newMap); +} + +function makeSet(map, ownerID) { + var set = Object.create(SetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; +} + +var EMPTY_SET; +function emptySet() { + return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); +} + +/** + * Returns the value at the provided key path starting at the provided + * collection, or notSetValue if the key path is not defined. + * + * A functional alternative to `collection.getIn(keypath)` which will also + * work with plain Objects and Arrays. + */ +function getIn$1(collection, searchKeyPath, notSetValue) { + var keyPath = coerceKeyPath(searchKeyPath); + var i = 0; + while (i !== keyPath.length) { + // @ts-expect-error keyPath[i++] can not be undefined by design + collection = get(collection, keyPath[i++], NOT_SET); + if (collection === NOT_SET) { + return notSetValue; + } + } + return collection; +} + +function getIn(searchKeyPath, notSetValue) { + return getIn$1(this, searchKeyPath, notSetValue); +} + +/** + * Returns true if the key path is defined in the provided collection. + * + * A functional alternative to `collection.hasIn(keypath)` which will also + * work with plain Objects and Arrays. + */ +function hasIn$1(collection, keyPath) { + return getIn$1(collection, keyPath, NOT_SET) !== NOT_SET; +} + +function hasIn(searchKeyPath) { + return hasIn$1(this, searchKeyPath); +} + +function toObject() { + assertNotInfinite(this.size); + var object = {}; + this.__iterate(function (v, k) { + if (isProtoKey(k)) { + return; + } + + object[k] = v; + }); + return object; +} + +function toJS(value) { + if (!value || typeof value !== 'object') { + return value; + } + if (!isCollection(value)) { + if (!isDataStructure(value)) { + return value; + } + // @ts-expect-error until Seq has been migrated to TypeScript + value = Seq(value); + } + if (isKeyed(value)) { + var result$1 = {}; + // @ts-expect-error `__iterate` exists on all Keyed collections but method is not defined in the type + value.__iterate(function (v, k) { + if (isProtoKey(k)) { + return; + } + result$1[k] = toJS(v); + }); + return result$1; + } + var result = []; + // @ts-expect-error value "should" be a non-keyed collection, but we may need to assert for stricter types + value.__iterate(function (v) { + result.push(toJS(v)); + }); + return result; +} + +function hashCollection(collection) { + // @ts-expect-error Migrate to CollectionImpl in v6 + if (collection.size === Infinity) { + return 0; + } + var ordered = isOrdered(collection); + var keyed = isKeyed(collection); + var h = ordered ? 1 : 0; + // @ts-expect-error Migrate to CollectionImpl in v6 + collection.__iterate(keyed + ? ordered + ? function (v, k) { + h = (31 * h + hashMerge(hash(v), hash(k))) | 0; + } + : function (v, k) { + h = (h + hashMerge(hash(v), hash(k))) | 0; + } + : ordered + ? function (v) { + h = (31 * h + hash(v)) | 0; + } + : function (v) { + h = (h + hash(v)) | 0; + }); + // @ts-expect-error Migrate to CollectionImpl in v6 + return murmurHashOfSize(collection.size, h); +} +function murmurHashOfSize(size, h) { + h = imul(h, 0xcc9e2d51); + h = imul((h << 15) | (h >>> -15), 0x1b873593); + h = imul((h << 13) | (h >>> -13), 5); + h = ((h + 0xe6546b64) | 0) ^ size; + h = imul(h ^ (h >>> 16), 0x85ebca6b); + h = imul(h ^ (h >>> 13), 0xc2b2ae35); + h = smi(h ^ (h >>> 16)); + return h; +} +function hashMerge(a, b) { + return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; // int +} + +/** + * Contributes additional methods to a constructor + */ +function mixin(ctor, +// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type +methods) { + var keyCopier = function (key) { + // @ts-expect-error how to handle symbol ? + ctor.prototype[key] = methods[key]; + }; + Object.keys(methods).forEach(keyCopier); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + Object.getOwnPropertySymbols && + Object.getOwnPropertySymbols(methods).forEach(keyCopier); + return ctor; +} + +Collection.Iterator = Iterator; + +mixin(Collection, { + // ### Conversion to other types + + toArray: function toArray() { + assertNotInfinite(this.size); + var array = new Array(this.size || 0); + var useTuples = isKeyed(this); + var i = 0; + this.__iterate(function (v, k) { + // Keyed collections produce an array of tuples. + array[i++] = useTuples ? [k, v] : v; + }); + return array; + }, + + toIndexedSeq: function toIndexedSeq() { + return new ToIndexedSequence(this); + }, + + toJS: function toJS$1() { + return toJS(this); + }, + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, true); + }, + + toMap: function toMap() { + // Use Late Binding here to solve the circular dependency. + return Map(this.toKeyedSeq()); + }, + + toObject: toObject, + + toOrderedMap: function toOrderedMap() { + // Use Late Binding here to solve the circular dependency. + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet: function toOrderedSet() { + // Use Late Binding here to solve the circular dependency. + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet: function toSet() { + // Use Late Binding here to solve the circular dependency. + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq: function toSetSeq() { + return new ToSetSequence(this); + }, + + toSeq: function toSeq() { + return isIndexed(this) + ? this.toIndexedSeq() + : isKeyed(this) + ? this.toKeyedSeq() + : this.toSetSeq(); + }, + + toStack: function toStack() { + // Use Late Binding here to solve the circular dependency. + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList: function toList() { + // Use Late Binding here to solve the circular dependency. + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + // ### Common JavaScript methods and properties + + toString: function toString() { + return '[Collection]'; + }, + + __toString: function __toString(head, tail) { + if (this.size === 0) { + return head + tail; + } + return ( + head + + ' ' + + this.toSeq().map(this.__toStringMapper).join(', ') + + ' ' + + tail + ); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + concat: function concat() { + var values = [], len = arguments.length; + while ( len-- ) values[ len ] = arguments[ len ]; + + return reify(this, concatFactory(this, values)); + }, + + includes: function includes(searchValue) { + return this.some(function (value) { return is(value, searchValue); }); + }, + + entries: function entries() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every: function every(predicate, context) { + assertNotInfinite(this.size); + var returnValue = true; + this.__iterate(function (v, k, c) { + if (!predicate.call(context, v, k, c)) { + returnValue = false; + return false; + } + }); + return returnValue; + }, + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + partition: function partition(predicate, context) { + return partitionFactory(this, predicate, context); + }, + + find: function find(predicate, context, notSetValue) { + var entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + forEach: function forEach(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join: function join(separator) { + assertNotInfinite(this.size); + separator = separator !== undefined ? '' + separator : ','; + var joined = ''; + var isFirst = true; + this.__iterate(function (v) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + isFirst ? (isFirst = false) : (joined += separator); + joined += v !== null && v !== undefined ? v.toString() : ''; + }); + return joined; + }, + + keys: function keys() { + return this.__iterator(ITERATE_KEYS); + }, + + map: function map(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce: function reduce$1(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + false + ); + }, + + reduceRight: function reduceRight(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + true + ); + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, true)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some: function some(predicate, context) { + assertNotInfinite(this.size); + var returnValue = false; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + returnValue = true; + return false; + } + }); + return returnValue; + }, + + sort: function sort(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values: function values() { + return this.__iterator(ITERATE_VALUES); + }, + + // ### More sequential methods + + butLast: function butLast() { + return this.slice(0, -1); + }, + + isEmpty: function isEmpty() { + return this.size !== undefined ? this.size === 0 : !this.some(function () { return true; }); + }, + + count: function count(predicate, context) { + return ensureSize( + predicate ? this.toSeq().filter(predicate, context) : this + ); + }, + + countBy: function countBy(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals: function equals(other) { + return deepEqual(this, other); + }, + + entrySeq: function entrySeq() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + var collection = this; + if (collection._cache) { + // We cache as an entries array, so we can just return the cache! + return new ArraySeq(collection._cache); + } + var entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = function () { return collection.toSeq(); }; + return entriesSequence; + }, + + filterNot: function filterNot(predicate, context) { + return this.filter(not(predicate), context); + }, + + findEntry: function findEntry(predicate, context, notSetValue) { + var found = notSetValue; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findKey: function findKey(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLast: function findLast(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + findLastEntry: function findLastEntry(predicate, context, notSetValue) { + return this.toKeyedSeq() + .reverse() + .findEntry(predicate, context, notSetValue); + }, + + findLastKey: function findLastKey(predicate, context) { + return this.toKeyedSeq().reverse().findKey(predicate, context); + }, + + first: function first(notSetValue) { + return this.find(returnTrue, null, notSetValue); + }, + + flatMap: function flatMap(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq: function fromEntrySeq() { + return new FromEntriesSequence(this); + }, + + get: function get(searchKey, notSetValue) { + return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue); + }, + + getIn: getIn, + + groupBy: function groupBy(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has: function has(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: hasIn, + + isSubset: function isSubset(iter) { + iter = typeof iter.includes === 'function' ? iter : Collection(iter); + return this.every(function (value) { return iter.includes(value); }); + }, + + isSuperset: function isSuperset(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Collection(iter); + return iter.isSubset(this); + }, + + keyOf: function keyOf(searchValue) { + return this.findKey(function (value) { return is(value, searchValue); }); + }, + + keySeq: function keySeq() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last: function last(notSetValue) { + return this.toSeq().reverse().first(notSetValue); + }, + + lastKeyOf: function lastKeyOf(searchValue) { + return this.toKeyedSeq().reverse().keyOf(searchValue); + }, + + max: function max(comparator) { + return maxFactory(this, comparator); + }, + + maxBy: function maxBy(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min: function min(comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator + ); + }, + + minBy: function minBy(mapper, comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator, + mapper + ); + }, + + rest: function rest() { + return this.slice(1); + }, + + skip: function skip(amount) { + return amount === 0 ? this : this.slice(Math.max(0, amount)); + }, + + skipLast: function skipLast(amount) { + return amount === 0 ? this : this.slice(0, -Math.max(0, amount)); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil: function skipUntil(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy: function sortBy(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take: function take(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast: function takeLast(amount) { + return this.slice(-Math.max(0, amount)); + }, + + takeWhile: function takeWhile(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil: function takeUntil(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + update: function update(fn) { + return fn(this); + }, + + valueSeq: function valueSeq() { + return this.toIndexedSeq(); + }, + + // ### Hashable Object + + hashCode: function hashCode() { + return this.__hash || (this.__hash = hashCollection(this)); + }, + + // ### Internal + + // abstract __iterate(fn, reverse) + + // abstract __iterator(type, reverse) +}); + +var CollectionPrototype = Collection.prototype; +CollectionPrototype[IS_COLLECTION_SYMBOL] = true; +CollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.values; +CollectionPrototype.toJSON = CollectionPrototype.toArray; +CollectionPrototype.__toStringMapper = quoteString; +CollectionPrototype.inspect = CollectionPrototype.toSource = function () { + return this.toString(); +}; +CollectionPrototype.chain = CollectionPrototype.flatMap; +CollectionPrototype.contains = CollectionPrototype.includes; + +mixin(KeyedCollection, { + // ### More sequential methods + + flip: function flip() { + return reify(this, flipFactory(this)); + }, + + mapEntries: function mapEntries(mapper, context) { + var this$1$1 = this; + + var iterations = 0; + return reify( + this, + this.toSeq() + .map(function (v, k) { return mapper.call(context, [k, v], iterations++, this$1$1); }) + .fromEntrySeq() + ); + }, + + mapKeys: function mapKeys(mapper, context) { + var this$1$1 = this; + + return reify( + this, + this.toSeq() + .flip() + .map(function (k, v) { return mapper.call(context, k, v, this$1$1); }) + .flip() + ); + }, +}); + +var KeyedCollectionPrototype = KeyedCollection.prototype; +KeyedCollectionPrototype[IS_KEYED_SYMBOL] = true; +KeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries; +KeyedCollectionPrototype.toJSON = toObject; +KeyedCollectionPrototype.__toStringMapper = function (v, k) { return quoteString(k) + ': ' + quoteString(v); }; + +mixin(IndexedCollection, { + // ### Conversion to other types + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, false); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex: function findIndex(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf: function indexOf(searchValue) { + var key = this.keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf: function lastIndexOf(searchValue) { + var key = this.lastKeyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, false)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice: function splice(index, removeNum /*, ...values*/) { + var numArgs = arguments.length; + removeNum = Math.max(removeNum || 0, 0); + if (numArgs === 0 || (numArgs === 2 && !removeNum)) { + return this; + } + // If index is negative, it should resolve relative to the size of the + // collection. However size may be expensive to compute if not cached, so + // only call count() if the number is in fact negative. + index = resolveBegin(index, index < 0 ? this.count() : this.size); + var spliced = this.slice(0, index); + return reify( + this, + numArgs === 1 + ? spliced + : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) + ); + }, + + // ### More collection methods + + findLastIndex: function findLastIndex(predicate, context) { + var entry = this.findLastEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + first: function first(notSetValue) { + return this.get(0, notSetValue); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get: function get(index, notSetValue) { + index = wrapIndex(this, index); + return index < 0 || + this.size === Infinity || + (this.size !== undefined && index > this.size) + ? notSetValue + : this.find(function (_, key) { return key === index; }, undefined, notSetValue); + }, + + has: function has(index) { + index = wrapIndex(this, index); + + return ( + index >= 0 && + (this.size !== undefined + ? this.size === Infinity || index < this.size + : this.find(function (_, key) { return key === index; }, undefined, NOT_SET) !== NOT_SET) + ); + }, + + interpose: function interpose(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave: function interleave(/*...collections*/) { + var collections = [this].concat(arrCopy(arguments)); + var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections); + var interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * collections.length; + } + return reify(this, interleaved); + }, + + keySeq: function keySeq() { + return Range(0, this.size); + }, + + last: function last(notSetValue) { + return this.get(-1, notSetValue); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip: function zip(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections)); + }, + + zipAll: function zipAll(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections, true)); + }, + + zipWith: function zipWith(zipper /*, ...collections */) { + var collections = arrCopy(arguments); + collections[0] = this; + return reify(this, zipWithFactory(this, zipper, collections)); + }, +}); + +var IndexedCollectionPrototype = IndexedCollection.prototype; +IndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true; +IndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true; + +mixin(SetCollection, { + // ### ES6 Collection methods (ES6 Array and Map) + + get: function get(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes: function includes(value) { + return this.has(value); + }, + + // ### More sequential methods + + keySeq: function keySeq() { + return this.valueSeq(); + }, +}); + +var SetCollectionPrototype = SetCollection.prototype; +SetCollectionPrototype.has = CollectionPrototype.includes; +SetCollectionPrototype.contains = SetCollectionPrototype.includes; +SetCollectionPrototype.keys = SetCollectionPrototype.values; + +// Mixin subclasses + +mixin(KeyedSeq, KeyedCollectionPrototype); +mixin(IndexedSeq, IndexedCollectionPrototype); +mixin(SetSeq, SetCollectionPrototype); + +// #pragma Helper functions + +function defaultZipper() { + return arrCopy(arguments); +} + +/** + * True if `maybeOrderedSet` is an OrderedSet. + */ +function isOrderedSet(maybeOrderedSet) { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); +} + +var OrderedSet = /*@__PURE__*/(function (Set) { + function OrderedSet(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedSet() + : isOrderedSet(value) + ? value + : emptyOrderedSet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( Set ) OrderedSet.__proto__ = Set; + OrderedSet.prototype = Object.create( Set && Set.prototype ); + OrderedSet.prototype.constructor = OrderedSet; + + OrderedSet.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedSet.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + OrderedSet.prototype.toString = function toString () { + return this.__toString('OrderedSet {', '}'); + }; + + return OrderedSet; +}(Set)); + +OrderedSet.isOrderedSet = isOrderedSet; + +var OrderedSetPrototype = OrderedSet.prototype; +OrderedSetPrototype[IS_ORDERED_SYMBOL] = true; +OrderedSetPrototype.zip = IndexedCollectionPrototype.zip; +OrderedSetPrototype.zipWith = IndexedCollectionPrototype.zipWith; +OrderedSetPrototype.zipAll = IndexedCollectionPrototype.zipAll; + +OrderedSetPrototype.__empty = emptyOrderedSet; +OrderedSetPrototype.__make = makeOrderedSet; + +function makeOrderedSet(map, ownerID) { + var set = Object.create(OrderedSetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; +} + +var EMPTY_ORDERED_SET; +function emptyOrderedSet() { + return ( + EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())) + ); +} + +/** + * Describes which item in a pair should be placed first when sorting + */ +var PairSorting = { + LeftThenRight: -1, + RightThenLeft: 1, +}; + +function throwOnInvalidDefaultValues(defaultValues) { + if (isRecord(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.' + ); + } + + if (isImmutable(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.' + ); + } + + if (defaultValues === null || typeof defaultValues !== 'object') { + throw new Error( + 'Can not call `Record` with a non-object as default values. Use a plain javascript object instead.' + ); + } +} + +var Record = function Record(defaultValues, name) { + var hasInitialized; + + throwOnInvalidDefaultValues(defaultValues); + + var RecordType = function Record(values) { + var this$1$1 = this; + + if (values instanceof RecordType) { + return values; + } + if (!(this instanceof RecordType)) { + return new RecordType(values); + } + if (!hasInitialized) { + hasInitialized = true; + var keys = Object.keys(defaultValues); + var indices = (RecordTypePrototype._indices = {}); + // Deprecated: left to attempt not to break any external code which + // relies on a ._name property existing on record instances. + // Use Record.getDescriptiveName() instead + RecordTypePrototype._name = name; + RecordTypePrototype._keys = keys; + RecordTypePrototype._defaultValues = defaultValues; + for (var i = 0; i < keys.length; i++) { + var propName = keys[i]; + indices[propName] = i; + if (RecordTypePrototype[propName]) { + /* eslint-disable no-console */ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + typeof console === 'object' && + console.warn && + console.warn( + 'Cannot define ' + + recordName(this) + + ' with property "' + + propName + + '" since that property name is part of the Record API.' + ); + /* eslint-enable no-console */ + } else { + setProp(RecordTypePrototype, propName); + } + } + } + this.__ownerID = undefined; + this._values = List().withMutations(function (l) { + l.setSize(this$1$1._keys.length); + KeyedCollection(values).forEach(function (v, k) { + l.set(this$1$1._indices[k], v === this$1$1._defaultValues[k] ? undefined : v); + }); + }); + return this; + }; + + var RecordTypePrototype = (RecordType.prototype = + Object.create(RecordPrototype)); + RecordTypePrototype.constructor = RecordType; + + if (name) { + RecordType.displayName = name; + } + + // eslint-disable-next-line no-constructor-return + return RecordType; +}; + +Record.prototype.toString = function toString () { + var str = recordName(this) + ' { '; + var keys = this._keys; + var k; + for (var i = 0, l = keys.length; i !== l; i++) { + k = keys[i]; + str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k)); + } + return str + ' }'; +}; + +Record.prototype.equals = function equals (other) { + return ( + this === other || + (isRecord(other) && recordSeq(this).equals(recordSeq(other))) + ); +}; + +Record.prototype.hashCode = function hashCode () { + return recordSeq(this).hashCode(); +}; + +// @pragma Access + +Record.prototype.has = function has (k) { + return this._indices.hasOwnProperty(k); +}; + +Record.prototype.get = function get (k, notSetValue) { + if (!this.has(k)) { + return notSetValue; + } + var index = this._indices[k]; + var value = this._values.get(index); + return value === undefined ? this._defaultValues[k] : value; +}; + +// @pragma Modification + +Record.prototype.set = function set (k, v) { + if (this.has(k)) { + var newValues = this._values.set( + this._indices[k], + v === this._defaultValues[k] ? undefined : v + ); + if (newValues !== this._values && !this.__ownerID) { + return makeRecord(this, newValues); + } + } + return this; +}; + +Record.prototype.remove = function remove (k) { + return this.set(k); +}; + +Record.prototype.clear = function clear () { + var newValues = this._values.clear().setSize(this._keys.length); + + return this.__ownerID ? this : makeRecord(this, newValues); +}; + +Record.prototype.wasAltered = function wasAltered () { + return this._values.wasAltered(); +}; + +Record.prototype.toSeq = function toSeq () { + return recordSeq(this); +}; + +Record.prototype.toJS = function toJS$1 () { + return toJS(this); +}; + +Record.prototype.entries = function entries () { + return this.__iterator(ITERATE_ENTRIES); +}; + +Record.prototype.__iterator = function __iterator (type, reverse) { + return recordSeq(this).__iterator(type, reverse); +}; + +Record.prototype.__iterate = function __iterate (fn, reverse) { + return recordSeq(this).__iterate(fn, reverse); +}; + +Record.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newValues = this._values.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._values = newValues; + return this; + } + return makeRecord(this, newValues, ownerID); +}; + +Record.isRecord = isRecord; +Record.getDescriptiveName = recordName; +var RecordPrototype = Record.prototype; +RecordPrototype[IS_RECORD_SYMBOL] = true; +RecordPrototype[DELETE] = RecordPrototype.remove; +RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn; +RecordPrototype.getIn = getIn; +RecordPrototype.hasIn = CollectionPrototype.hasIn; +RecordPrototype.merge = merge$1; +RecordPrototype.mergeWith = mergeWith$1; +RecordPrototype.mergeIn = mergeIn; +RecordPrototype.mergeDeep = mergeDeep; +RecordPrototype.mergeDeepWith = mergeDeepWith; +RecordPrototype.mergeDeepIn = mergeDeepIn; +RecordPrototype.setIn = setIn; +RecordPrototype.update = update; +RecordPrototype.updateIn = updateIn$1; +RecordPrototype.withMutations = withMutations; +RecordPrototype.asMutable = asMutable; +RecordPrototype.asImmutable = asImmutable; +RecordPrototype[ITERATOR_SYMBOL] = RecordPrototype.entries; +RecordPrototype.toJSON = RecordPrototype.toObject = + CollectionPrototype.toObject; +RecordPrototype.inspect = RecordPrototype.toSource = function () { + return this.toString(); +}; + +function makeRecord(likeRecord, values, ownerID) { + var record = Object.create(Object.getPrototypeOf(likeRecord)); + record._values = values; + record.__ownerID = ownerID; + return record; +} + +function recordName(record) { + return record.constructor.displayName || record.constructor.name || 'Record'; +} + +function recordSeq(record) { + return keyedSeqFromValue(record._keys.map(function (k) { return [k, record.get(k)]; })); +} + +function setProp(prototype, name) { + try { + Object.defineProperty(prototype, name, { + get: function () { + return this.get(name); + }, + set: function (value) { + invariant(this.__ownerID, 'Cannot set on an immutable record.'); + this.set(name, value); + }, + }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO enable eslint here + } catch (error) { + // Object.defineProperty failed. Probably IE8. + } +} + +/** + * Returns a lazy Seq of `value` repeated `times` times. When `times` is + * undefined, returns an infinite sequence of `value`. + */ +var Repeat = /*@__PURE__*/(function (IndexedSeq) { + function Repeat(value, times) { + if (!(this instanceof Repeat)) { + // eslint-disable-next-line no-constructor-return + return new Repeat(value, times); + } + this._value = value; + this.size = times === undefined ? Infinity : Math.max(0, times); + if (this.size === 0) { + if (EMPTY_REPEAT) { + // eslint-disable-next-line no-constructor-return + return EMPTY_REPEAT; + } + // eslint-disable-next-line @typescript-eslint/no-this-alias + EMPTY_REPEAT = this; + } + } + + if ( IndexedSeq ) Repeat.__proto__ = IndexedSeq; + Repeat.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Repeat.prototype.constructor = Repeat; + + Repeat.prototype.toString = function toString () { + if (this.size === 0) { + return 'Repeat []'; + } + return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; + }; + + Repeat.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._value : notSetValue; + }; + + Repeat.prototype.includes = function includes (searchValue) { + return is(this._value, searchValue); + }; + + Repeat.prototype.slice = function slice (begin, end) { + var size = this.size; + return wholeSlice(begin, end, size) + ? this + : new Repeat( + this._value, + resolveEnd(end, size) - resolveBegin(begin, size) + ); + }; + + Repeat.prototype.reverse = function reverse () { + return this; + }; + + Repeat.prototype.indexOf = function indexOf (searchValue) { + if (this.size !== 0 && is(this._value, searchValue)) { + return 0; + } + return -1; + }; + + Repeat.prototype.lastIndexOf = function lastIndexOf (searchValue) { + if (this.size !== 0 && is(this._value, searchValue)) { + return this.size - 1; + } + return -1; + }; + + Repeat.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var i = 0; + while (i !== size) { + if (fn(this._value, reverse ? size - ++i : i++, this) === false) { + break; + } + } + return i; + }; + + Repeat.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var size = this.size; + var i = 0; + return new Iterator(function () { return i === size + ? iteratorDone() + : iteratorValue(type, reverse ? size - ++i : i++, this$1$1._value); } + ); + }; + + Repeat.prototype.equals = function equals (other) { + return other instanceof Repeat + ? is(this._value, other._value) + : deepEqual(this, other); + }; + + return Repeat; +}(IndexedSeq)); + +var EMPTY_REPEAT; + +function fromJS(value, converter) { + return fromJSWith( + [], + converter || defaultConverter, + value, + '', + converter && converter.length > 2 ? [] : undefined, + { '': value } + ); +} + +function fromJSWith(stack, converter, value, key, keyPath, parentValue) { + if ( + typeof value !== 'string' && + !isImmutable(value) && + (isArrayLike(value) || hasIterator(value) || isPlainObject(value)) + ) { + if (~stack.indexOf(value)) { + throw new TypeError('Cannot convert circular structure to Immutable'); + } + stack.push(value); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && key !== '' && keyPath.push(key); + var converted = converter.call( + parentValue, + key, + Seq(value).map(function (v, k) { return fromJSWith(stack, converter, v, k, keyPath, value); } + ), + keyPath && keyPath.slice() + ); + stack.pop(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && keyPath.pop(); + return converted; + } + return value; +} + +function defaultConverter(k, v) { + // Effectively the opposite of "Collection.toSeq()" + return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet(); +} + +var version = "5.1.9"; + +/* eslint-disable import/order */ + +// Note: Iterable is deprecated +var Iterable = Collection; + +export { Collection, Iterable, List, Map, OrderedMap, OrderedSet, PairSorting, Range, Record, Repeat, Seq, Set, Stack, fromJS, get, getIn$1 as getIn, has, hasIn$1 as hasIn, hash, is, isAssociative, isCollection, isImmutable, isIndexed, isKeyed, isList, isMap, isOrdered, isOrderedMap, isOrderedSet, isPlainObject, isRecord, isSeq, isSet, isStack, isValueObject, merge, mergeDeep$1 as mergeDeep, mergeDeepWith$1 as mergeDeepWith, mergeWith, remove, removeIn, set, setIn$1 as setIn, update$1 as update, updateIn, version }; diff --git a/tools/ui/node_modules/immutable/dist/immutable.js b/tools/ui/node_modules/immutable/dist/immutable.js new file mode 100644 index 0000000000000000000000000000000000000000..7eafadb6ab1667825bd4bbeb340a7ce649112891 --- /dev/null +++ b/tools/ui/node_modules/immutable/dist/immutable.js @@ -0,0 +1,6427 @@ +/** + * @license + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Immutable = {})); +})(this, (function (exports) { 'use strict'; + + var IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@'; + /** + * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + * + * ```js + * import { isIndexed, Map, List, Stack, Set } from 'immutable'; + * + * isIndexed([]); // false + * isIndexed({}); // false + * isIndexed(Map()); // false + * isIndexed(List()); // true + * isIndexed(Stack()); // true + * isIndexed(Set()); // false + * ``` + */ + function isIndexed(maybeIndexed) { + return Boolean(maybeIndexed && + // @ts-expect-error: maybeIndexed is typed as `{}`, need to change in 6.0 to `maybeIndexed && typeof maybeIndexed === 'object' && IS_INDEXED_SYMBOL in maybeIndexed` + maybeIndexed[IS_INDEXED_SYMBOL]); + } + + var IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@'; + /** + * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + * + * ```js + * import { isKeyed, Map, List, Stack } from 'immutable'; + * + * isKeyed([]); // false + * isKeyed({}); // false + * isKeyed(Map()); // true + * isKeyed(List()); // false + * isKeyed(Stack()); // false + * ``` + */ + function isKeyed(maybeKeyed) { + return Boolean(maybeKeyed && + // @ts-expect-error: maybeKeyed is typed as `{}`, need to change in 6.0 to `maybeKeyed && typeof maybeKeyed === 'object' && IS_KEYED_SYMBOL in maybeKeyed` + maybeKeyed[IS_KEYED_SYMBOL]); + } + + /** + * True if `maybeAssociative` is either a Keyed or Indexed Collection. + * + * ```js + * import { isAssociative, Map, List, Stack, Set } from 'immutable'; + * + * isAssociative([]); // false + * isAssociative({}); // false + * isAssociative(Map()); // true + * isAssociative(List()); // true + * isAssociative(Stack()); // true + * isAssociative(Set()); // false + * ``` + */ + function isAssociative(maybeAssociative) { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); + } + + // Note: value is unchanged to not break immutable-devtools. + var IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@'; + /** + * True if `maybeCollection` is a Collection, or any of its subclasses. + * + * ```js + * import { isCollection, Map, List, Stack } from 'immutable'; + * + * isCollection([]); // false + * isCollection({}); // false + * isCollection(Map()); // true + * isCollection(List()); // true + * isCollection(Stack()); // true + * ``` + */ + function isCollection(maybeCollection) { + return Boolean(maybeCollection && + // @ts-expect-error: maybeCollection is typed as `{}`, need to change in 6.0 to `maybeCollection && typeof maybeCollection === 'object' && IS_COLLECTION_SYMBOL in maybeCollection` + maybeCollection[IS_COLLECTION_SYMBOL]); + } + + var Collection = function Collection(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) ? value : Seq(value); + }; + + var KeyedCollection = /*@__PURE__*/(function (Collection) { + function KeyedCollection(value) { + // eslint-disable-next-line no-constructor-return + return isKeyed(value) ? value : KeyedSeq(value); + } + + if ( Collection ) KeyedCollection.__proto__ = Collection; + KeyedCollection.prototype = Object.create( Collection && Collection.prototype ); + KeyedCollection.prototype.constructor = KeyedCollection; + + return KeyedCollection; + }(Collection)); + + var IndexedCollection = /*@__PURE__*/(function (Collection) { + function IndexedCollection(value) { + // eslint-disable-next-line no-constructor-return + return isIndexed(value) ? value : IndexedSeq(value); + } + + if ( Collection ) IndexedCollection.__proto__ = Collection; + IndexedCollection.prototype = Object.create( Collection && Collection.prototype ); + IndexedCollection.prototype.constructor = IndexedCollection; + + return IndexedCollection; + }(Collection)); + + var SetCollection = /*@__PURE__*/(function (Collection) { + function SetCollection(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) && !isAssociative(value) ? value : SetSeq(value); + } + + if ( Collection ) SetCollection.__proto__ = Collection; + SetCollection.prototype = Object.create( Collection && Collection.prototype ); + SetCollection.prototype.constructor = SetCollection; + + return SetCollection; + }(Collection)); + + Collection.Keyed = KeyedCollection; + Collection.Indexed = IndexedCollection; + Collection.Set = SetCollection; + + var ITERATE_KEYS = 0; + var ITERATE_VALUES = 1; + var ITERATE_ENTRIES = 2; + // TODO Symbol is widely available in modern JavaScript environments, clean this + var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; + // @ts-expect-error: properties are not supported in buble + var Iterator = function Iterator(next) { + // @ts-expect-error: properties are not supported in buble + this.next = next; + }; + Iterator.prototype.toString = function toString () { + return '[Iterator]'; + }; + // @ts-expect-error: static properties are not supported in buble + Iterator.KEYS = ITERATE_KEYS; + // @ts-expect-error: static properties are not supported in buble + Iterator.VALUES = ITERATE_VALUES; + // @ts-expect-error: static properties are not supported in buble + Iterator.ENTRIES = ITERATE_ENTRIES; + // @ts-expect-error: properties are not supported in buble + Iterator.prototype.inspect = Iterator.prototype.toSource = function () { + return this.toString(); + }; + // @ts-expect-error don't know how to type this + Iterator.prototype[ITERATOR_SYMBOL] = function () { + return this; + }; + function iteratorValue(type, k, v, iteratorResult) { + var value = type === ITERATE_KEYS ? k : type === ITERATE_VALUES ? v : [k, v]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + iteratorResult + ? (iteratorResult.value = value) + : (iteratorResult = { + // @ts-expect-error ensure value is not undefined + value: value, + done: false, + }); + return iteratorResult; + } + function iteratorDone() { + return { value: undefined, done: true }; + } + function hasIterator(maybeIterable) { + if (Array.isArray(maybeIterable)) { + // IE11 trick as it does not support `Symbol.iterator` + return true; + } + return !!getIteratorFn(maybeIterable); + } + function isIterator(maybeIterator) { + return !!(maybeIterator && + // @ts-expect-error: maybeIterator is typed as `{}` + typeof maybeIterator.next === 'function'); + } + function getIterator(iterable) { + var iteratorFn = getIteratorFn(iterable); + return iteratorFn && iteratorFn.call(iterable); + } + function getIteratorFn(iterable) { + var iteratorFn = iterable && + // @ts-expect-error: maybeIterator is typed as `{}` + ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || + // @ts-expect-error: maybeIterator is typed as `{}` + iterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + function isEntriesIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + // @ts-expect-error: maybeIterator is typed as `{}` + return iteratorFn && iteratorFn === maybeIterable.entries; + } + function isKeysIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + // @ts-expect-error: maybeIterator is typed as `{}` + return iteratorFn && iteratorFn === maybeIterable.keys; + } + + // Used for setting prototype methods that IE8 chokes on. + var DELETE = 'delete'; + // Constants describing the size of trie nodes. + var SHIFT = 5; // Resulted in best performance after ______? + var SIZE = 1 << SHIFT; + var MASK = SIZE - 1; + // A consistent shared value representing "not set" which equals nothing other + // than itself, and nothing that could be provided externally. + var NOT_SET = {}; + // Boolean references, Rough equivalent of `bool &`. + function MakeRef() { + return { value: false }; + } + function SetRef(ref) { + if (ref) { + ref.value = true; + } + } + // A function which returns a value representing an "owner" for transient writes + // to tries. The return value will only ever equal itself, and will not equal + // the return of any subsequent call of this function. + function OwnerID() { } + function ensureSize(iter) { + // @ts-expect-error size should exists on Collection + if (iter.size === undefined) { + // @ts-expect-error size should exists on Collection, __iterate does exist on Collection + iter.size = iter.__iterate(returnTrue); + } + // @ts-expect-error size should exists on Collection + return iter.size; + } + function wrapIndex(iter, index) { + // This implements "is array index" which the ECMAString spec defines as: + // + // A String property name P is an array index if and only if + // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal + // to 2^32−1. + // + // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects + if (typeof index !== 'number') { + var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 + if ('' + uint32Index !== index || uint32Index === 4294967295) { + return NaN; + } + index = uint32Index; + } + return index < 0 ? ensureSize(iter) + index : index; + } + function returnTrue() { + return true; + } + function wholeSlice(begin, end, size) { + return (((begin === 0 && !isNeg(begin)) || + (size !== undefined && begin <= -size)) && + (end === undefined || (size !== undefined && end >= size))); + } + function resolveBegin(begin, size) { + return resolveIndex(begin, size, 0); + } + function resolveEnd(end, size) { + return resolveIndex(end, size, size); + } + function resolveIndex(index, size, defaultIndex) { + // Sanitize indices using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + return index === undefined + ? defaultIndex + : isNeg(index) + ? size === Infinity + ? size + : Math.max(0, size + index) | 0 + : size === undefined || size === index + ? index + : Math.min(size, index) | 0; + } + function isNeg(value) { + // Account for -0 which is negative, but not less than 0. + return value < 0 || (value === 0 && 1 / value === -Infinity); + } + + var IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@'; + /** + * True if `maybeRecord` is a Record. + */ + function isRecord(maybeRecord) { + return Boolean(maybeRecord && + // @ts-expect-error: maybeRecord is typed as `{}`, need to change in 6.0 to `maybeRecord && typeof maybeRecord === 'object' && IS_RECORD_SYMBOL in maybeRecord` + maybeRecord[IS_RECORD_SYMBOL]); + } + + /** + * True if `maybeImmutable` is an Immutable Collection or Record. + * + * Note: Still returns true even if the collections is within a `withMutations()`. + * + * ```js + * import { isImmutable, Map, List, Stack } from 'immutable'; + * isImmutable([]); // false + * isImmutable({}); // false + * isImmutable(Map()); // true + * isImmutable(List()); // true + * isImmutable(Stack()); // true + * isImmutable(Map().asMutable()); // true + * ``` + */ + function isImmutable(maybeImmutable) { + return isCollection(maybeImmutable) || isRecord(maybeImmutable); + } + + var IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@'; + function isOrdered(maybeOrdered) { + return Boolean(maybeOrdered && + // @ts-expect-error: maybeOrdered is typed as `{}`, need to change in 6.0 to `maybeOrdered && typeof maybeOrdered === 'object' && IS_ORDERED_SYMBOL in maybeOrdered` + maybeOrdered[IS_ORDERED_SYMBOL]); + } + + var IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@'; + /** + * True if `maybeSeq` is a Seq. + */ + function isSeq(maybeSeq) { + return Boolean(maybeSeq && + // @ts-expect-error: maybeSeq is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSeq === 'object' && MAYBE_SEQ_SYMBOL in maybeSeq` + maybeSeq[IS_SEQ_SYMBOL]); + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + function isArrayLike(value) { + if (Array.isArray(value) || typeof value === 'string') { + return true; + } + // @ts-expect-error "Type 'unknown' is not assignable to type 'boolean'" : convert to Boolean + return (value && + typeof value === 'object' && + // @ts-expect-error check that `'length' in value &&` + Number.isInteger(value.length) && + // @ts-expect-error check that `'length' in value &&` + value.length >= 0 && + // @ts-expect-error check that `'length' in value &&` + (value.length === 0 + ? // Only {length: 0} is considered Array-like. + Object.keys(value).length === 1 + : // An object is only Array-like if it has a property where the last value + // in the array-like may be found (which could be undefined). + // @ts-expect-error check that `'length' in value &&` + value.hasOwnProperty(value.length - 1))); + } + + var Seq = /*@__PURE__*/(function (Collection) { + function Seq(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isImmutable(value) + ? value.toSeq() + : seqFromValue(value); + } + + if ( Collection ) Seq.__proto__ = Collection; + Seq.prototype = Object.create( Collection && Collection.prototype ); + Seq.prototype.constructor = Seq; + + Seq.prototype.toSeq = function toSeq () { + return this; + }; + + Seq.prototype.toString = function toString () { + return this.__toString('Seq {', '}'); + }; + + Seq.prototype.cacheResult = function cacheResult () { + if (!this._cache && this.__iterateUncached) { + this._cache = this.entrySeq().toArray(); + this.size = this._cache.length; + } + return this; + }; + + // abstract __iterateUncached(fn, reverse) + + Seq.prototype.__iterate = function __iterate (fn, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + while (i !== size) { + var entry = cache[reverse ? size - ++i : i++]; + if (fn(entry[1], entry[0], this) === false) { + break; + } + } + return i; + } + return this.__iterateUncached(fn, reverse); + }; + + // abstract __iteratorUncached(type, reverse) + + Seq.prototype.__iterator = function __iterator (type, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var entry = cache[reverse ? size - ++i : i++]; + return iteratorValue(type, entry[0], entry[1]); + }); + } + return this.__iteratorUncached(type, reverse); + }; + + return Seq; + }(Collection)); + + var KeyedSeq = /*@__PURE__*/(function (Seq) { + function KeyedSeq(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence().toKeyedSeq() + : isCollection(value) + ? isKeyed(value) + ? value.toSeq() + : value.fromEntrySeq() + : isRecord(value) + ? value.toSeq() + : keyedSeqFromValue(value); + } + + if ( Seq ) KeyedSeq.__proto__ = Seq; + KeyedSeq.prototype = Object.create( Seq && Seq.prototype ); + KeyedSeq.prototype.constructor = KeyedSeq; + + KeyedSeq.prototype.toKeyedSeq = function toKeyedSeq () { + return this; + }; + + return KeyedSeq; + }(Seq)); + + var IndexedSeq = /*@__PURE__*/(function (Seq) { + function IndexedSeq(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isCollection(value) + ? isKeyed(value) + ? value.entrySeq() + : value.toIndexedSeq() + : isRecord(value) + ? value.toSeq().entrySeq() + : indexedSeqFromValue(value); + } + + if ( Seq ) IndexedSeq.__proto__ = Seq; + IndexedSeq.prototype = Object.create( Seq && Seq.prototype ); + IndexedSeq.prototype.constructor = IndexedSeq; + + IndexedSeq.of = function of (/*...values*/) { + return IndexedSeq(arguments); + }; + + IndexedSeq.prototype.toIndexedSeq = function toIndexedSeq () { + return this; + }; + + IndexedSeq.prototype.toString = function toString () { + return this.__toString('Seq [', ']'); + }; + + return IndexedSeq; + }(Seq)); + + var SetSeq = /*@__PURE__*/(function (Seq) { + function SetSeq(value) { + // eslint-disable-next-line no-constructor-return + return ( + isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value) + ).toSetSeq(); + } + + if ( Seq ) SetSeq.__proto__ = Seq; + SetSeq.prototype = Object.create( Seq && Seq.prototype ); + SetSeq.prototype.constructor = SetSeq; + + SetSeq.of = function of (/*...values*/) { + return SetSeq(arguments); + }; + + SetSeq.prototype.toSetSeq = function toSetSeq () { + return this; + }; + + return SetSeq; + }(Seq)); + + Seq.isSeq = isSeq; + Seq.Keyed = KeyedSeq; + Seq.Set = SetSeq; + Seq.Indexed = IndexedSeq; + + Seq.prototype[IS_SEQ_SYMBOL] = true; + + // #pragma Root Sequences + + var ArraySeq = /*@__PURE__*/(function (IndexedSeq) { + function ArraySeq(array) { + this._array = array; + this.size = array.length; + } + + if ( IndexedSeq ) ArraySeq.__proto__ = IndexedSeq; + ArraySeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ArraySeq.prototype.constructor = ArraySeq; + + ArraySeq.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; + }; + + ArraySeq.prototype.__iterate = function __iterate (fn, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + while (i !== size) { + var ii = reverse ? size - ++i : i++; + if (fn(array[ii], ii, this) === false) { + break; + } + } + return i; + }; + + ArraySeq.prototype.__iterator = function __iterator (type, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var ii = reverse ? size - ++i : i++; + return iteratorValue(type, ii, array[ii]); + }); + }; + + return ArraySeq; + }(IndexedSeq)); + + var ObjectSeq = /*@__PURE__*/(function (KeyedSeq) { + function ObjectSeq(object) { + var keys = Object.keys(object).concat( + Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [] + ); + this._object = object; + this._keys = keys; + this.size = keys.length; + } + + if ( KeyedSeq ) ObjectSeq.__proto__ = KeyedSeq; + ObjectSeq.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ObjectSeq.prototype.constructor = ObjectSeq; + + ObjectSeq.prototype.get = function get (key, notSetValue) { + if (notSetValue !== undefined && !this.has(key)) { + return notSetValue; + } + return this._object[key]; + }; + + ObjectSeq.prototype.has = function has (key) { + return hasOwnProperty.call(this._object, key); + }; + + ObjectSeq.prototype.__iterate = function __iterate (fn, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + while (i !== size) { + var key = keys[reverse ? size - ++i : i++]; + if (fn(object[key], key, this) === false) { + break; + } + } + return i; + }; + + ObjectSeq.prototype.__iterator = function __iterator (type, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var key = keys[reverse ? size - ++i : i++]; + return iteratorValue(type, key, object[key]); + }); + }; + + return ObjectSeq; + }(KeyedSeq)); + ObjectSeq.prototype[IS_ORDERED_SYMBOL] = true; + + var CollectionSeq = /*@__PURE__*/(function (IndexedSeq) { + function CollectionSeq(collection) { + this._collection = collection; + this.size = collection.length || collection.size; + } + + if ( IndexedSeq ) CollectionSeq.__proto__ = IndexedSeq; + CollectionSeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + CollectionSeq.prototype.constructor = CollectionSeq; + + CollectionSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + var iterations = 0; + if (isIterator(iterator)) { + var step; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + } + return iterations; + }; + + CollectionSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + if (!isIterator(iterator)) { + return new Iterator(iteratorDone); + } + var iterations = 0; + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, iterations++, step.value); + }); + }; + + return CollectionSeq; + }(IndexedSeq)); + + // # pragma Helper functions + + var EMPTY_SEQ; + + function emptySequence() { + return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); + } + + function keyedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq.fromEntrySeq(); + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of [k, v] entries, or keyed object: ' + + value + ); + } + + function indexedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq; + } + throw new TypeError( + 'Expected Array or collection object of values: ' + value + ); + } + + function seqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return isEntriesIterable(value) + ? seq.fromEntrySeq() + : isKeysIterable(value) + ? seq.toSetSeq() + : seq; + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of values, or keyed object: ' + value + ); + } + + function maybeIndexedSeqFromValue(value) { + return isArrayLike(value) + ? new ArraySeq(value) + : hasIterator(value) + ? new CollectionSeq(value) + : undefined; + } + + function asImmutable() { + return this.__ensureOwner(); + } + + function asMutable() { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); + } + + // TODO remove in v6 as Math.imul is widely available now: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul + var imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 + ? Math.imul + : function imul(a, b) { + a |= 0; // int + b |= 0; // int + var c = a & 0xffff; + var d = b & 0xffff; + // Shift by 0 fixes the sign on the high part. + return (c * d + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0)) | 0; // int + }; + // v8 has an optimization for storing 31-bit signed numbers. + // Values which have either 00 or 11 as the high order bits qualify. + // This function drops the highest order bit in a signed number, maintaining + // the sign bit. + function smi(i32) { + return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff); + } + + var defaultValueOf = Object.prototype.valueOf; + function hash(o) { + // eslint-disable-next-line eqeqeq + if (o == null) { + return hashNullish(o); + } + // @ts-expect-error don't care about object beeing typed as `{}` here + if (typeof o.hashCode === 'function') { + // Drop any high bits from accidentally long hash codes. + // @ts-expect-error don't care about object beeing typed as `{}` here + return smi(o.hashCode(o)); + } + var v = valueOf(o); + // eslint-disable-next-line eqeqeq + if (v == null) { + return hashNullish(v); + } + switch (typeof v) { + case 'boolean': + // The hash values for built-in constants are a 1 value for each 5-byte + // shift region expect for the first, which encodes the value. This + // reduces the odds of a hash collision for these common values. + return v ? 0x42108421 : 0x42108420; + case 'number': + return hashNumber(v); + case 'string': + return v.length > STRING_HASH_CACHE_MIN_STRLEN + ? cachedHashString(v) + : hashString(v); + case 'object': + case 'function': + return hashJSObj(v); + case 'symbol': + return hashSymbol(v); + default: + if (typeof v.toString === 'function') { + return hashString(v.toString()); + } + throw new Error('Value type ' + typeof v + ' cannot be hashed.'); + } + } + function hashNullish(nullish) { + return nullish === null ? 0x42108422 : /* undefined */ 0x42108423; + } + // Compress arbitrarily large numbers into smi hashes. + function hashNumber(n) { + if (n !== n || n === Infinity) { + return 0; + } + var hash = n | 0; + if (hash !== n) { + hash ^= n * 0xffffffff; + } + while (n > 0xffffffff) { + n /= 0xffffffff; + hash ^= n; + } + return smi(hash); + } + function cachedHashString(string) { + var hashed = stringHashCache[string]; + if (hashed === undefined) { + hashed = hashString(string); + if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { + STRING_HASH_CACHE_SIZE = 0; + stringHashCache = {}; + } + STRING_HASH_CACHE_SIZE++; + stringHashCache[string] = hashed; + } + return hashed; + } + // http://jsperf.com/hashing-strings + function hashString(string) { + // This is the hash from JVM + // The hash code for a string is computed as + // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], + // where s[i] is the ith character of the string and n is the length of + // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 + // (exclusive) by dropping high bits. + var hashed = 0; + for (var ii = 0; ii < string.length; ii++) { + hashed = (31 * hashed + string.charCodeAt(ii)) | 0; + } + return smi(hashed); + } + // Per-process seed for the secondary collision hash. Never exposed nor + // serialized, so the public `hash()` stays deterministic. An odd base in + // [3, 2^20) keeps `base * h` exact as a double (no `Math.imul`). + var COLLISION_HASH_BASE = ((Math.random() * 0x100000) | 1) % 0x100000 || 0x9e37; + // Secondary hash to index entries within a `HashCollisionNode`, where every key + // shares the same primary `hash()`. Using a different, seeded base scatters + // crafted collision families (e.g. "Aa"/"BB", which only collide under base 31) + // that an attacker cannot precompute without the seed. It only narrows + // candidates — `is()` still decides equality — so non-string keys can safely + // fall back to the (here constant) primary hash and a linear scan. + function hashCollisionKey(key) { + if (typeof key !== 'string') { + return hash(key); + } + var hashed = 0; + for (var ii = 0; ii < key.length; ii++) { + hashed = (COLLISION_HASH_BASE * hashed + key.charCodeAt(ii)) | 0; + } + return hashed; + } + function hashSymbol(sym) { + var hashed = symbolMap[sym]; + if (hashed !== undefined) { + return hashed; + } + hashed = nextHash(); + symbolMap[sym] = hashed; + return hashed; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + function hashJSObj(obj) { + var hashed; + if (usingWeakMap) { + // @ts-expect-error weakMap is defined + hashed = weakMap.get(obj); + if (hashed !== undefined) { + return hashed; + } + } + // @ts-expect-error used for old code, will be removed + hashed = obj[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + if (!canDefineProperty) { + // @ts-expect-error used for old code, will be removed + hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + hashed = getIENodeHash(obj); + if (hashed !== undefined) { + return hashed; + } + } + hashed = nextHash(); + if (usingWeakMap) { + // @ts-expect-error weakMap is defined + weakMap.set(obj, hashed); + } + else if (isExtensible !== undefined && isExtensible(obj) === false) { + throw new Error('Non-extensible objects are not allowed as keys.'); + } + else if (canDefineProperty) { + Object.defineProperty(obj, UID_HASH_KEY, { + enumerable: false, + configurable: false, + writable: false, + value: hashed, + }); + } + else if (obj.propertyIsEnumerable !== undefined && + obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { + // Since we can't define a non-enumerable property on the object + // we'll hijack one of the less-used non-enumerable properties to + // save our hash on it. Since this is a function it will not show up in + // `JSON.stringify` which is what we want. + obj.propertyIsEnumerable = function () { + return this.constructor.prototype.propertyIsEnumerable.apply(this, + // eslint-disable-next-line prefer-rest-params + arguments); + }; + // @ts-expect-error used for old code, will be removed + obj.propertyIsEnumerable[UID_HASH_KEY] = hashed; + // @ts-expect-error used for old code, will be removed + } + else if (obj.nodeType !== undefined) { + // At this point we couldn't get the IE `uniqueID` to use as a hash + // and we couldn't use a non-enumerable property to exploit the + // dontEnum bug so we simply add the `UID_HASH_KEY` on the node + // itself. + // @ts-expect-error used for old code, will be removed + obj[UID_HASH_KEY] = hashed; + } + else { + throw new Error('Unable to set a non-enumerable property on object.'); + } + return hashed; + } + // Get references to ES5 object methods. + var isExtensible = Object.isExtensible; + // True if Object.defineProperty works as expected. IE8 fails this test. + // TODO remove this as widely available https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty + var canDefineProperty = (function () { + try { + Object.defineProperty({}, '@', {}); + return true; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } + catch (e) { + return false; + } + })(); + // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it + // and avoid memory leaks from the IE cloneNode bug. + // TODO remove this method as only used if `canDefineProperty` is false + function getIENodeHash(node) { + // @ts-expect-error don't care + if (node && node.nodeType > 0) { + // @ts-expect-error don't care + switch (node.nodeType) { + case 1: // Element + // @ts-expect-error don't care + return node.uniqueID; + case 9: // Document + // @ts-expect-error don't care + return node.documentElement && node.documentElement.uniqueID; + } + } + } + function valueOf(obj) { + return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' + ? // @ts-expect-error weird the "obj" parameter as `valueOf` should not have a parameter + obj.valueOf(obj) + : obj; + } + function nextHash() { + var nextHash = ++_objHashUID; + if (_objHashUID & 0x40000000) { + _objHashUID = 0; + } + return nextHash; + } + // If possible, use a WeakMap. + // TODO using WeakMap should be true everywhere now that WeakMap is widely supported: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap + var usingWeakMap = typeof WeakMap === 'function'; + var weakMap; + if (usingWeakMap) { + weakMap = new WeakMap(); + } + var symbolMap = Object.create(null); + var _objHashUID = 0; + // TODO remove string as Symbol is now widely supported: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol + var UID_HASH_KEY = '__immutablehash__'; + if (typeof Symbol === 'function') { + UID_HASH_KEY = Symbol(UID_HASH_KEY); + } + var STRING_HASH_CACHE_MIN_STRLEN = 16; + var STRING_HASH_CACHE_MAX_SIZE = 255; + var STRING_HASH_CACHE_SIZE = 0; + var stringHashCache = {}; + + var ToKeyedSequence = /*@__PURE__*/(function (KeyedSeq) { + function ToKeyedSequence(indexed, useKeys) { + this._iter = indexed; + this._useKeys = useKeys; + this.size = indexed.size; + } + + if ( KeyedSeq ) ToKeyedSequence.__proto__ = KeyedSeq; + ToKeyedSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ToKeyedSequence.prototype.constructor = ToKeyedSequence; + + ToKeyedSequence.prototype.get = function get (key, notSetValue) { + return this._iter.get(key, notSetValue); + }; + + ToKeyedSequence.prototype.has = function has (key) { + return this._iter.has(key); + }; + + ToKeyedSequence.prototype.valueSeq = function valueSeq () { + return this._iter.valueSeq(); + }; + + ToKeyedSequence.prototype.reverse = function reverse () { + var this$1$1 = this; + + var reversedSequence = reverseFactory(this, true); + if (!this._useKeys) { + reversedSequence.valueSeq = function () { return this$1$1._iter.toSeq().reverse(); }; + } + return reversedSequence; + }; + + ToKeyedSequence.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + var mappedSequence = mapFactory(this, mapper, context); + if (!this._useKeys) { + mappedSequence.valueSeq = function () { return this$1$1._iter.toSeq().map(mapper, context); }; + } + return mappedSequence; + }; + + ToKeyedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v, k) { return fn(v, k, this$1$1); }, reverse); + }; + + ToKeyedSequence.prototype.__iterator = function __iterator (type, reverse) { + return this._iter.__iterator(type, reverse); + }; + + return ToKeyedSequence; + }(KeyedSeq)); + ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true; + + var ToIndexedSequence = /*@__PURE__*/(function (IndexedSeq) { + function ToIndexedSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( IndexedSeq ) ToIndexedSequence.__proto__ = IndexedSeq; + ToIndexedSequence.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ToIndexedSequence.prototype.constructor = ToIndexedSequence; + + ToIndexedSequence.prototype.includes = function includes (value) { + return this._iter.includes(value); + }; + + ToIndexedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); + return this._iter.__iterate( + function (v) { return fn(v, reverse ? this$1$1.size - ++i : i++, this$1$1); }, + reverse + ); + }; + + ToIndexedSequence.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue( + type, + reverse ? this$1$1.size - ++i : i++, + step.value, + step + ); + }); + }; + + return ToIndexedSequence; + }(IndexedSeq)); + + var ToSetSequence = /*@__PURE__*/(function (SetSeq) { + function ToSetSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( SetSeq ) ToSetSequence.__proto__ = SetSeq; + ToSetSequence.prototype = Object.create( SetSeq && SetSeq.prototype ); + ToSetSequence.prototype.constructor = ToSetSequence; + + ToSetSequence.prototype.has = function has (key) { + return this._iter.includes(key); + }; + + ToSetSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v) { return fn(v, v, this$1$1); }, reverse); + }; + + ToSetSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue(type, step.value, step.value, step); + }); + }; + + return ToSetSequence; + }(SetSeq)); + + var FromEntriesSequence = /*@__PURE__*/(function (KeyedSeq) { + function FromEntriesSequence(entries) { + this._iter = entries; + this.size = entries.size; + } + + if ( KeyedSeq ) FromEntriesSequence.__proto__ = KeyedSeq; + FromEntriesSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + FromEntriesSequence.prototype.constructor = FromEntriesSequence; + + FromEntriesSequence.prototype.entrySeq = function entrySeq () { + return this._iter.toSeq(); + }; + + FromEntriesSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (entry) { + // Check if entry exists first so array access doesn't throw for holes + // in the parent iteration. + if (entry) { + validateEntry(entry); + var indexedCollection = isCollection(entry); + return fn( + indexedCollection ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], + this$1$1 + ); + } + }, reverse); + }; + + FromEntriesSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + // Check if entry exists first so array access doesn't throw for holes + // in the parent iteration. + if (entry) { + validateEntry(entry); + var indexedCollection = isCollection(entry); + return iteratorValue( + type, + indexedCollection ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], + step + ); + } + } + }); + }; + + return FromEntriesSequence; + }(KeyedSeq)); + + ToIndexedSequence.prototype.cacheResult = + ToKeyedSequence.prototype.cacheResult = + ToSetSequence.prototype.cacheResult = + FromEntriesSequence.prototype.cacheResult = + cacheResultThrough; + + function flipFactory(collection) { + var flipSequence = makeSequence(collection); + flipSequence._iter = collection; + flipSequence.size = collection.size; + flipSequence.flip = function () { return collection; }; + flipSequence.reverse = function () { + var reversedSequence = collection.reverse.apply(this); // super.reverse() + reversedSequence.flip = function () { return collection.reverse(); }; + return reversedSequence; + }; + flipSequence.has = function (key) { return collection.includes(key); }; + flipSequence.includes = function (key) { return collection.has(key); }; + flipSequence.cacheResult = cacheResultThrough; + flipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate(function (v, k) { return fn(k, v, this$1$1) !== false; }, reverse); + }; + flipSequence.__iteratorUncached = function (type, reverse) { + if (type === ITERATE_ENTRIES) { + var iterator = collection.__iterator(type, reverse); + return new Iterator(function () { + var step = iterator.next(); + if (!step.done) { + var k = step.value[0]; + step.value[0] = step.value[1]; + step.value[1] = k; + } + return step; + }); + } + return collection.__iterator( + type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, + reverse + ); + }; + return flipSequence; + } + + function mapFactory(collection, mapper, context) { + var mappedSequence = makeSequence(collection); + mappedSequence.size = collection.size; + mappedSequence.has = function (key) { return collection.has(key); }; + mappedSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v === NOT_SET + ? notSetValue + : mapper.call(context, v, key, collection); + }; + mappedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate( + function (v, k, c) { return fn(mapper.call(context, v, k, c), k, this$1$1) !== false; }, + reverse + ); + }; + mappedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + return new Iterator(function () { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + return iteratorValue( + type, + key, + mapper.call(context, entry[1], key, collection), + step + ); + }); + }; + return mappedSequence; + } + + function reverseFactory(collection, useKeys) { + var reversedSequence = makeSequence(collection); + reversedSequence._iter = collection; + reversedSequence.size = collection.size; + reversedSequence.reverse = function () { return collection; }; + if (collection.flip) { + reversedSequence.flip = function () { + var flipSequence = flipFactory(collection); + flipSequence.reverse = function () { return collection.flip(); }; + return flipSequence; + }; + } + reversedSequence.get = function (key, notSetValue) { return collection.get(useKeys ? key : -1 - key, notSetValue); }; + reversedSequence.has = function (key) { return collection.has(useKeys ? key : -1 - key); }; + reversedSequence.includes = function (value) { return collection.includes(value); }; + reversedSequence.cacheResult = cacheResultThrough; + reversedSequence.__iterate = function (fn, reverse) { + var this$1$1 = this; + + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + return collection.__iterate( + function (v, k) { return fn(v, useKeys ? k : reverse ? this$1$1.size - ++i : i++, this$1$1); }, + !reverse + ); + }; + reversedSequence.__iterator = function (type, reverse) { + var i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + var iterator = collection.__iterator(ITERATE_ENTRIES, !reverse); + return new Iterator(function () { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + return iteratorValue( + type, + // `__iterator` is an arrow function, so `this` is not the reversed + // sequence here — read `reversedSequence.size` explicitly. + useKeys ? entry[0] : reverse ? reversedSequence.size - ++i : i++, + entry[1], + step + ); + }); + }; + return reversedSequence; + } + + function filterFactory(collection, predicate, context, useKeys) { + var filterSequence = makeSequence(collection); + if (useKeys) { + filterSequence.has = function (key) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, collection); + }; + filterSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, collection) + ? v + : notSetValue; + }; + } + filterSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }, reverse); + return iterations; + }; + filterSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterations = 0; + return new Iterator(function () { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + var value = entry[1]; + if (predicate.call(context, value, key, collection)) { + return iteratorValue(type, useKeys ? key : iterations++, value, step); + } + } + }); + }; + return filterSequence; + } + + function countByFactory(collection, grouper, context) { + var groups = Map().asMutable(); + collection.__iterate(function (v, k) { + groups.update(grouper.call(context, v, k, collection), 0, function (a) { return a + 1; }); + }); + return groups.asImmutable(); + } + + function groupByFactory(collection, grouper, context) { + var isKeyedIter = isKeyed(collection); + var groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable(); + collection.__iterate(function (v, k) { + groups.update( + grouper.call(context, v, k, collection), + function (a) { return ((a = a || []), a.push(isKeyedIter ? [k, v] : v), a); } + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }).asImmutable(); + } + + function partitionFactory(collection, predicate, context) { + var isKeyedIter = isKeyed(collection); + var groups = [[], []]; + collection.__iterate(function (v, k) { + groups[predicate.call(context, v, k, collection) ? 1 : 0].push( + isKeyedIter ? [k, v] : v + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }); + } + + function sliceFactory(collection, begin, end, useKeys) { + var originalSize = collection.size; + + if (wholeSlice(begin, end, originalSize)) { + return collection; + } + + // begin or end can not be resolved if they were provided as negative numbers and + // this collection's size is unknown. In that case, cache first so there is + // a known size and these do not resolve to NaN. + if (typeof originalSize === 'undefined' && (begin < 0 || end < 0)) { + return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys); + } + + var resolvedBegin = resolveBegin(begin, originalSize); + var resolvedEnd = resolveEnd(end, originalSize); + + // Note: resolvedEnd is undefined when the original sequence's length is + // unknown and this slice did not supply an end and should contain all + // elements after resolvedBegin. + // In that case, resolvedSize will be NaN and sliceSize will remain undefined. + var resolvedSize = resolvedEnd - resolvedBegin; + var sliceSize; + if (resolvedSize === resolvedSize) { + sliceSize = resolvedSize < 0 ? 0 : resolvedSize; + } + + var sliceSeq = makeSequence(collection); + + // If collection.size is undefined, the size of the realized sliceSeq is + // unknown at this point unless the number of items to slice is 0 + sliceSeq.size = + sliceSize === 0 ? sliceSize : (collection.size && sliceSize) || undefined; + + if (!useKeys && isSeq(collection) && sliceSize >= 0) { + sliceSeq.get = function (index, notSetValue) { + index = wrapIndex(this, index); + return index >= 0 && index < sliceSize + ? collection.get(index + resolvedBegin, notSetValue) + : notSetValue; + }; + } + + sliceSeq.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (sliceSize === 0) { + return 0; + } + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var skipped = 0; + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k) { + if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { + iterations++; + return ( + fn(v, useKeys ? k : iterations - 1, this$1$1) !== false && + iterations !== sliceSize + ); + } + }); + return iterations; + }; + + sliceSeq.__iteratorUncached = function (type, reverse) { + if (sliceSize !== 0 && reverse) { + return this.cacheResult().__iterator(type, reverse); + } + // Don't bother instantiating parent iterator if taking 0. + if (sliceSize === 0) { + return new Iterator(iteratorDone); + } + var iterator = collection.__iterator(type, reverse); + var skipped = 0; + var iterations = 0; + return new Iterator(function () { + while (skipped++ < resolvedBegin) { + iterator.next(); + } + if (++iterations > sliceSize) { + return iteratorDone(); + } + var step = iterator.next(); + if (useKeys || type === ITERATE_VALUES || step.done) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations - 1, undefined, step); + } + return iteratorValue(type, iterations - 1, step.value[1], step); + }); + }; + + return sliceSeq; + } + + function takeWhileFactory(collection, predicate, context) { + var takeSequence = makeSequence(collection); + takeSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + collection.__iterate( + function (v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1$1); } + ); + return iterations; + }; + takeSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterating = true; + return new Iterator(function () { + if (!iterating) { + return iteratorDone(); + } + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var k = entry[0]; + var v = entry[1]; + if (!predicate.call(context, v, k, this$1$1)) { + iterating = false; + return iteratorDone(); + } + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return takeSequence; + } + + function skipWhileFactory(collection, predicate, context, useKeys) { + var skipSequence = makeSequence(collection); + skipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }); + return iterations; + }; + skipSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var skipping = true; + var iterations = 0; + return new Iterator(function () { + var step; + var k; + var v; + do { + step = iterator.next(); + if (step.done) { + if (useKeys || type === ITERATE_VALUES) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations++, undefined, step); + } + return iteratorValue(type, iterations++, step.value[1], step); + } + var entry = step.value; + k = entry[0]; + v = entry[1]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + skipping && (skipping = predicate.call(context, v, k, this$1$1)); + } while (skipping); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return skipSequence; + } + + var ConcatSeq = /*@__PURE__*/(function (Seq) { + function ConcatSeq(iterables) { + this._wrappedIterables = iterables.flatMap(function (iterable) { + if (iterable._wrappedIterables) { + return iterable._wrappedIterables; + } + return [iterable]; + }); + this.size = this._wrappedIterables.reduce(function (sum, iterable) { + if (sum !== undefined) { + var size = iterable.size; + if (size !== undefined) { + return sum + size; + } + } + }, 0); + this[IS_KEYED_SYMBOL] = this._wrappedIterables[0][IS_KEYED_SYMBOL]; + this[IS_INDEXED_SYMBOL] = this._wrappedIterables[0][IS_INDEXED_SYMBOL]; + this[IS_ORDERED_SYMBOL] = this._wrappedIterables[0][IS_ORDERED_SYMBOL]; + } + + if ( Seq ) ConcatSeq.__proto__ = Seq; + ConcatSeq.prototype = Object.create( Seq && Seq.prototype ); + ConcatSeq.prototype.constructor = ConcatSeq; + + ConcatSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) { + if (this._wrappedIterables.length === 0) { + return; + } + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + + var iterableIndex = 0; + var useKeys = isKeyed(this); + var iteratorType = useKeys ? ITERATE_ENTRIES : ITERATE_VALUES; + var currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + + var keepGoing = true; + var index = 0; + while (keepGoing) { + var next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this._wrappedIterables.length) { + return index; + } + currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + next = currentIterator.next(); + } + var fnResult = useKeys + ? fn(next.value[1], next.value[0], this) + : fn(next.value, index, this); + keepGoing = fnResult !== false; + index++; + } + return index; + }; + + ConcatSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) { + var this$1$1 = this; + + if (this._wrappedIterables.length === 0) { + return new Iterator(iteratorDone); + } + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + + var iterableIndex = 0; + var currentIterator = this._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + return new Iterator(function () { + var next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this$1$1._wrappedIterables.length) { + return next; + } + currentIterator = this$1$1._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + next = currentIterator.next(); + } + return next; + }); + }; + + return ConcatSeq; + }(Seq)); + + function concatFactory(collection, values) { + var isKeyedCollection = isKeyed(collection); + var iters = [collection] + .concat(values) + .map(function (v) { + if (!isCollection(v)) { + v = isKeyedCollection + ? keyedSeqFromValue(v) + : indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedCollection) { + v = KeyedCollection(v); + } + return v; + }) + .filter(function (v) { return v.size !== 0; }); + + if (iters.length === 0) { + return collection; + } + + if (iters.length === 1) { + var singleton = iters[0]; + if ( + singleton === collection || + (isKeyedCollection && isKeyed(singleton)) || + (isIndexed(collection) && isIndexed(singleton)) + ) { + return singleton; + } + } + + return new ConcatSeq(iters); + } + + function flattenFactory(collection, depth, useKeys) { + var flatSequence = makeSequence(collection); + flatSequence.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + var stopped = false; + function flatDeep(iter, currentDepth) { + iter.__iterate(function (v, k) { + if ((!depth || currentDepth < depth) && isCollection(v)) { + flatDeep(v, currentDepth + 1); + } else { + iterations++; + if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) { + stopped = true; + } + } + return !stopped; + }, reverse); + } + flatDeep(collection, 0); + return iterations; + }; + flatSequence.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(type, reverse); + var stack = []; + var iterations = 0; + return new Iterator(function () { + while (iterator) { + var step = iterator.next(); + if (step.done !== false) { + iterator = stack.pop(); + continue; + } + var v = step.value; + if (type === ITERATE_ENTRIES) { + v = v[1]; + } + if ((!depth || stack.length < depth) && isCollection(v)) { + stack.push(iterator); + iterator = v.__iterator(type, reverse); + } else { + return useKeys ? step : iteratorValue(type, iterations++, v, step); + } + } + return iteratorDone(); + }); + }; + return flatSequence; + } + + function flatMapFactory(collection, mapper, context) { + var coerce = collectionClass(collection); + return collection + .toSeq() + .map(function (v, k) { return coerce(mapper.call(context, v, k, collection)); }) + .flatten(true); + } + + function interposeFactory(collection, separator) { + var interposedSequence = makeSequence(collection); + interposedSequence.size = collection.size && collection.size * 2 - 1; + interposedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate( + function (v) { return (!iterations || fn(separator, iterations++, this$1$1) !== false) && + fn(v, iterations++, this$1$1) !== false; }, + reverse + ); + return iterations; + }; + interposedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + var step; + return new Iterator(function () { + if (!step || iterations % 2) { + step = iterator.next(); + if (step.done) { + return step; + } + } + return iterations % 2 + ? iteratorValue(type, iterations++, separator) + : iteratorValue(type, iterations++, step.value, step); + }); + }; + return interposedSequence; + } + + function sortFactory(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + var isKeyedCollection = isKeyed(collection); + var index = 0; + var entries = collection + .toSeq() + .map(function (v, k) { return [k, v, index++, mapper ? mapper(v, k, collection) : v]; }) + .valueSeq() + .toArray(); + entries + .sort(function (a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; }) + .forEach( + isKeyedCollection + ? function (v, i) { + entries[i].length = 2; + } + : function (v, i) { + entries[i] = v[1]; + } + ); + return isKeyedCollection + ? KeyedSeq(entries) + : isIndexed(collection) + ? IndexedSeq(entries) + : SetSeq(entries); + } + + function maxFactory(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + if (mapper) { + var entry = collection + .toSeq() + .map(function (v, k) { return [v, mapper(v, k, collection)]; }) + .reduce(function (a, b) { return (maxCompare(comparator, a[1], b[1]) ? b : a); }); + return entry && entry[0]; + } + return collection.reduce(function (a, b) { return (maxCompare(comparator, a, b) ? b : a); }); + } + + function maxCompare(comparator, a, b) { + var comp = comparator(b, a); + // b is considered the new max if the comparator declares them equal, but + // they are not equal and b is in fact a nullish value. + return ( + (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || + comp > 0 + ); + } + + function zipWithFactory(keyIter, zipper, iters, zipAll) { + var zipSequence = makeSequence(keyIter); + var sizes = new ArraySeq(iters).map(function (i) { return i.size; }); + zipSequence.size = zipAll ? sizes.max() : sizes.min(); + // Note: this a generic base implementation of __iterate in terms of + // __iterator which may be more generically useful in the future. + zipSequence.__iterate = function (fn, reverse) { + /* generic: + var iterator = this.__iterator(ITERATE_ENTRIES, reverse); + var step; + var iterations = 0; + while (!(step = iterator.next()).done) { + iterations++; + if (fn(step.value[1], step.value[0], this) === false) { + break; + } + } + return iterations; + */ + // indexed: + var iterator = this.__iterator(ITERATE_VALUES, reverse); + var step; + var iterations = 0; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + return iterations; + }; + zipSequence.__iteratorUncached = function (type, reverse) { + var iterators = iters.map( + function (i) { return ((i = Collection(i)), getIterator(reverse ? i.reverse() : i)); } + ); + var iterations = 0; + var isDone = false; + return new Iterator(function () { + var steps; + if (!isDone) { + steps = iterators.map(function (i) { return i.next(); }); + isDone = zipAll + ? steps.every(function (s) { return s.done; }) + : steps.some(function (s) { return s.done; }); + } + if (isDone) { + return iteratorDone(); + } + return iteratorValue( + type, + iterations++, + zipper.apply( + null, + steps.map(function (s) { return s.value; }) + ) + ); + }); + }; + return zipSequence; + } + + // #pragma Helper Functions + + function reify(iter, seq) { + return iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq); + } + + function validateEntry(entry) { + if (entry !== Object(entry)) { + throw new TypeError('Expected [K, V] tuple: ' + entry); + } + } + + function collectionClass(collection) { + return isKeyed(collection) + ? KeyedCollection + : isIndexed(collection) + ? IndexedCollection + : SetCollection; + } + + function makeSequence(collection) { + return Object.create( + (isKeyed(collection) + ? KeyedSeq + : isIndexed(collection) + ? IndexedSeq + : SetSeq + ).prototype + ); + } + + function cacheResultThrough() { + if (this._iter.cacheResult) { + this._iter.cacheResult(); + this.size = this._iter.size; + return this; + } + return Seq.prototype.cacheResult.call(this); + } + + function defaultComparator(a, b) { + if (a === undefined && b === undefined) { + return 0; + } + + if (a === undefined) { + return 1; + } + + if (b === undefined) { + return -1; + } + + return a > b ? 1 : a < b ? -1 : 0; + } + + /** + * True if `maybeValue` is a JavaScript Object which has *both* `equals()` + * and `hashCode()` methods. + * + * Any two instances of *value objects* can be compared for value equality with + * `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. + */ + function isValueObject(maybeValue) { + return Boolean(maybeValue && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.equals === 'function' && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.hashCode === 'function'); + } + + /** + * An extension of the "same-value" algorithm as [described for use by ES6 Map + * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) + * + * NaN is considered the same as NaN, however -0 and 0 are considered the same + * value, which is different from the algorithm described by + * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * This is extended further to allow Objects to describe the values they + * represent, by way of `valueOf` or `equals` (and `hashCode`). + * + * Note: because of this extension, the key equality of Immutable.Map and the + * value equality of Immutable.Set will differ from ES6 Map and Set. + * + * ### Defining custom values + * + * The easiest way to describe the value an object represents is by implementing + * `valueOf`. For example, `Date` represents a value by returning a unix + * timestamp for `valueOf`: + * + * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... + * var date2 = new Date(1234567890000); + * date1.valueOf(); // 1234567890000 + * assert( date1 !== date2 ); + * assert( Immutable.is( date1, date2 ) ); + * + * Note: overriding `valueOf` may have other implications if you use this object + * where JavaScript expects a primitive, such as implicit string coercion. + * + * For more complex types, especially collections, implementing `valueOf` may + * not be performant. An alternative is to implement `equals` and `hashCode`. + * + * `equals` takes another object, presumably of similar type, and returns true + * if it is equal. Equality is symmetrical, so the same result should be + * returned if this and the argument are flipped. + * + * assert( a.equals(b) === b.equals(a) ); + * + * `hashCode` returns a 32bit integer number representing the object which will + * be used to determine how to store the value object in a Map or Set. You must + * provide both or neither methods, one must not exist without the other. + * + * Also, an important relationship between these methods must be upheld: if two + * values are equal, they *must* return the same hashCode. If the values are not + * equal, they might have the same hashCode; this is called a hash collision, + * and while undesirable for performance reasons, it is acceptable. + * + * if (a.equals(b)) { + * assert( a.hashCode() === b.hashCode() ); + * } + * + * All Immutable collections are Value Objects: they implement `equals()` + * and `hashCode()`. + */ + function is(valueA, valueB) { + if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { + return true; + } + if (!valueA || !valueB) { + return false; + } + if (typeof valueA.valueOf === 'function' && + typeof valueB.valueOf === 'function') { + valueA = valueA.valueOf(); + valueB = valueB.valueOf(); + if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { + return true; + } + if (!valueA || !valueB) { + return false; + } + } + return !!(isValueObject(valueA) && + isValueObject(valueB) && + valueA.equals(valueB)); + } + + function update$1(collection, key, notSetValue, updater) { + return updateIn( + // @ts-expect-error Index signature for type string is missing in type V[] + collection, [key], notSetValue, updater); + } + + function merge$1() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeIntoKeyedWith(this, iters); + } + + function mergeWith$1(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + if (typeof merger !== 'function') { + throw new TypeError('Invalid merger function: ' + merger); + } + return mergeIntoKeyedWith(this, iters, merger); + } + + function mergeIntoKeyedWith(collection, collections, merger) { + var iters = []; + for (var ii = 0; ii < collections.length; ii++) { + var collection$1 = KeyedCollection(collections[ii]); + if (collection$1.size !== 0) { + iters.push(collection$1); + } + } + if (iters.length === 0) { + return collection; + } + if ( + collection.toSeq().size === 0 && + !collection.__ownerID && + iters.length === 1 + ) { + return isRecord(collection) + ? collection // Record is empty and will not be updated: return the same instance + : collection.constructor(iters[0]); + } + return collection.withMutations(function (collection) { + var mergeIntoCollection = merger + ? function (value, key) { + update$1(collection, key, NOT_SET, function (oldVal) { return oldVal === NOT_SET ? value : merger(oldVal, value, key); } + ); + } + : function (value, key) { + collection.set(key, value); + }; + for (var ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoCollection); + } + }); + } + + var toString = Object.prototype.toString; + function isPlainObject(value) { + // The base prototype's toString deals with Argument objects and native namespaces like Math + if (!value || + typeof value !== 'object' || + toString.call(value) !== '[object Object]') { + return false; + } + var proto = Object.getPrototypeOf(value); + if (proto === null) { + return true; + } + // Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc) + var parentProto = proto; + var nextProto = Object.getPrototypeOf(proto); + while (nextProto !== null) { + parentProto = nextProto; + nextProto = Object.getPrototypeOf(parentProto); + } + return parentProto === proto; + } + + /** + * Returns true if the value is a potentially-persistent data structure, either + * provided by Immutable.js or a plain Array or Object. + */ + function isDataStructure(value) { + return (typeof value === 'object' && + (isImmutable(value) || Array.isArray(value) || isPlainObject(value))); + } + + function isProtoKey(key) { + return (typeof key === 'string' && (key === '__proto__' || key === 'constructor')); + } + + // http://jsperf.com/copy-array-inline + function arrCopy(arr, offset) { + offset = offset || 0; + var len = Math.max(0, arr.length - offset); + var newArr = new Array(len); + for (var ii = 0; ii < len; ii++) { + // @ts-expect-error We may want to guard for undefined values with `if (arr[ii + offset] !== undefined`, but ths should not happen by design + newArr[ii] = arr[ii + offset]; + } + return newArr; + } + + function shallowCopy(from) { + if (Array.isArray(from)) { + return arrCopy(from); + } + var to = {}; + for (var key in from) { + if (isProtoKey(key)) { + continue; + } + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + return to; + } + + function merge(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeWithSources(collection, sources); + } + + function mergeWith(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeWithSources(collection, sources, merger); + } + + function mergeDeep$1(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(collection, sources); + } + + function mergeDeepWith$1(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeDeepWithSources(collection, sources, merger); + } + + function mergeDeepWithSources(collection, sources, merger) { + return mergeWithSources(collection, sources, deepMergerWith(merger)); + } + + function mergeWithSources(collection, sources, merger) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot merge into non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + return typeof merger === 'function' && collection.mergeWith + ? collection.mergeWith.apply(collection, [ merger ].concat( sources )) + : collection.merge + ? collection.merge.apply(collection, sources) + : collection.concat.apply(collection, sources); + } + var isArray = Array.isArray(collection); + var merged = collection; + var Collection = isArray ? IndexedCollection : KeyedCollection; + var mergeItem = isArray + ? function (value) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged.push(value); + } + : function (value, key) { + if (isProtoKey(key)) { + return; + } + + var hasVal = hasOwnProperty.call(merged, key); + var nextVal = + hasVal && merger ? merger(merged[key], value, key) : value; + if (!hasVal || nextVal !== merged[key]) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged[key] = nextVal; + } + }; + for (var i = 0; i < sources.length; i++) { + Collection(sources[i]).forEach(mergeItem); + } + return merged; + } + + function deepMergerWith(merger) { + function deepMerger(oldValue, newValue, key) { + return isDataStructure(oldValue) && + isDataStructure(newValue) && + areMergeable(oldValue, newValue) + ? mergeWithSources(oldValue, [newValue], deepMerger) + : merger + ? merger(oldValue, newValue, key) + : newValue; + } + return deepMerger; + } + + /** + * It's unclear what the desired behavior is for merging two collections that + * fall into separate categories between keyed, indexed, or set-like, so we only + * consider them mergeable if they fall into the same category. + */ + function areMergeable(oldDataStructure, newDataStructure) { + var oldSeq = Seq(oldDataStructure); + var newSeq = Seq(newDataStructure); + // This logic assumes that a sequence can only fall into one of the three + // categories mentioned above (since there's no `isSetLike()` method). + return ( + isIndexed(oldSeq) === isIndexed(newSeq) && + isKeyed(oldSeq) === isKeyed(newSeq) + ); + } + + function mergeDeep() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeDeepWithSources(this, iters); + } + + function mergeDeepWith(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(this, iters, merger); + } + + function mergeDeepIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn(this, keyPath, emptyMap(), function (m) { return mergeDeepWithSources(m, iters); } + ); + } + + function mergeIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn(this, keyPath, emptyMap(), function (m) { return mergeWithSources(m, iters); }); + } + + /** + * Returns a copy of the collection with the value at the key path set to the + * provided value. + * + * A functional alternative to `collection.setIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function setIn$1(collection, keyPath, value) { + return updateIn(collection, keyPath, NOT_SET, function () { return value; }); + } + + function setIn(keyPath, v) { + return setIn$1(this, keyPath, v); + } + + function update(key, notSetValue, updater) { + return arguments.length === 1 + ? key(this) + : update$1(this, key, notSetValue, updater); + } + + function updateIn$1(keyPath, notSetValue, updater) { + return updateIn(this, keyPath, notSetValue, updater); + } + + function wasAltered() { + return this.__altered; + } + + function withMutations(fn) { + var mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; + } + + var IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@'; + /** + * True if `maybeMap` is a Map. + * + * Also true for OrderedMaps. + */ + function isMap(maybeMap) { + return Boolean(maybeMap && + // @ts-expect-error: maybeMap is typed as `{}`, need to change in 6.0 to `maybeMap && typeof maybeMap === 'object' && IS_MAP_SYMBOL in maybeMap` + maybeMap[IS_MAP_SYMBOL]); + } + + function invariant(condition, error) { + if (!condition) + { throw new Error(error); } + } + + function assertNotInfinite(size) { + invariant(size !== Infinity, 'Cannot perform this action with an infinite size.'); + } + + var Map = /*@__PURE__*/(function (KeyedCollection) { + function Map(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyMap() + : isMap(value) && !isOrdered(value) + ? value + : emptyMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( KeyedCollection ) Map.__proto__ = KeyedCollection; + Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype ); + Map.prototype.constructor = Map; + + Map.prototype.toString = function toString () { + return this.__toString('Map {', '}'); + }; + + // @pragma Access + + Map.prototype.get = function get (k, notSetValue) { + return this._root + ? this._root.get(0, undefined, k, notSetValue) + : notSetValue; + }; + + // @pragma Modification + + Map.prototype.set = function set (k, v) { + return updateMap(this, k, v); + }; + + Map.prototype.remove = function remove (k) { + return updateMap(this, k, NOT_SET); + }; + + Map.prototype.deleteAll = function deleteAll (keys) { + var collection = Collection(keys); + + if (collection.size === 0) { + return this; + } + + return this.withMutations(function (map) { + collection.forEach(function (key) { return map.remove(key); }); + }); + }; + + Map.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._root = null; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyMap(); + }; + + // @pragma Composition + + Map.prototype.sort = function sort (comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator)); + }; + + Map.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator, mapper)); + }; + + Map.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (map) { + map.forEach(function (value, key) { + map.set(key, mapper.call(context, value, key, this$1$1)); + }); + }); + }; + + // @pragma Mutability + + Map.prototype.__iterator = function __iterator (type, reverse) { + return new MapIterator(this, type, reverse); + }; + + Map.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + this._root && + this._root.iterate(function (entry) { + iterations++; + return fn(entry[1], entry[0], this$1$1); + }, reverse); + return iterations; + }; + + Map.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyMap(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeMap(this.size, this._root, ownerID, this.__hash); + }; + + return Map; + }(KeyedCollection)); + + Map.isMap = isMap; + + var MapPrototype = Map.prototype; + MapPrototype[IS_MAP_SYMBOL] = true; + MapPrototype[DELETE] = MapPrototype.remove; + MapPrototype.removeAll = MapPrototype.deleteAll; + MapPrototype.setIn = setIn; + MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn; + MapPrototype.update = update; + MapPrototype.updateIn = updateIn$1; + MapPrototype.merge = MapPrototype.concat = merge$1; + MapPrototype.mergeWith = mergeWith$1; + MapPrototype.mergeDeep = mergeDeep; + MapPrototype.mergeDeepWith = mergeDeepWith; + MapPrototype.mergeIn = mergeIn; + MapPrototype.mergeDeepIn = mergeDeepIn; + MapPrototype.withMutations = withMutations; + MapPrototype.wasAltered = wasAltered; + MapPrototype.asImmutable = asImmutable; + MapPrototype['@@transducer/init'] = MapPrototype.asMutable = asMutable; + MapPrototype['@@transducer/step'] = function (result, arr) { + return result.set(arr[0], arr[1]); + }; + MapPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); + }; + + // #pragma Trie Nodes + + var ArrayMapNode = function ArrayMapNode(ownerID, entries) { + this.ownerID = ownerID; + this.entries = entries; + }; + + ArrayMapNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + if (is(key, entries[ii][0])) { + return entries[ii][1]; + } + } + return notSetValue; + }; + + ArrayMapNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + + var entries = this.entries; + var idx = 0; + var len = entries.length; + for (; idx < len; idx++) { + if (is(key, entries[idx][0])) { + break; + } + } + var exists = idx < len; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + (removed || !exists) && SetRef(didChangeSize); + + if (removed && entries.length === 1) { + return; // undefined + } + + if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { + return createNodes(ownerID, entries, key, value); + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); + } else { + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new ArrayMapNode(ownerID, newEntries); + }; + + var BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) { + this.ownerID = ownerID; + this.bitmap = bitmap; + this.nodes = nodes; + }; + + BitmapIndexedNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK); + var bitmap = this.bitmap; + return (bitmap & bit) === 0 + ? notSetValue + : this.nodes[popCount(bitmap & (bit - 1))].get( + shift + SHIFT, + keyHash, + key, + notSetValue + ); + }; + + BitmapIndexedNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var bit = 1 << keyHashFrag; + var bitmap = this.bitmap; + var exists = (bitmap & bit) !== 0; + + if (!exists && value === NOT_SET) { + return this; + } + + var idx = popCount(bitmap & (bit - 1)); + var nodes = this.nodes; + var node = exists ? nodes[idx] : undefined; + var newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); + + if (newNode === node) { + return this; + } + + if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { + return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); + } + + if ( + exists && + !newNode && + nodes.length === 2 && + isLeafNode(nodes[idx ^ 1]) + ) { + return nodes[idx ^ 1]; + } + + if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { + return newNode; + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newBitmap = exists ? (newNode ? bitmap : bitmap ^ bit) : bitmap | bit; + var newNodes = exists + ? newNode + ? setAt(nodes, idx, newNode, isEditable) + : spliceOut(nodes, idx, isEditable) + : spliceIn(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.bitmap = newBitmap; + this.nodes = newNodes; + return this; + } + + return new BitmapIndexedNode(ownerID, newBitmap, newNodes); + }; + + var HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) { + this.ownerID = ownerID; + this.count = count; + this.nodes = nodes; + }; + + HashArrayMapNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var node = this.nodes[idx]; + return node + ? node.get(shift + SHIFT, keyHash, key, notSetValue) + : notSetValue; + }; + + HashArrayMapNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var removed = value === NOT_SET; + var nodes = this.nodes; + var node = nodes[idx]; + + if (removed && !node) { + return this; + } + + var newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); + if (newNode === node) { + return this; + } + + var newCount = this.count; + if (!node) { + newCount++; + } else if (!newNode) { + newCount--; + if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { + return packNodes(ownerID, nodes, newCount, idx); + } + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newNodes = setAt(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.count = newCount; + this.nodes = newNodes; + return this; + } + + return new HashArrayMapNode(ownerID, newCount, newNodes); + }; + + /** + * Trie leaf gathering entries whose keys all share the same 32-bit `hash()`. + * The trie routes by hash, so colliding keys cannot be separated and land here + * in a flat `entries` array, disambiguated by `is()`. + * + * To guard against hash-flooding DoS (CWE-407), large buckets build a secondary + * index keyed by a per-process seeded hash (`hashCollisionKey`). `is()` still + * decides equality, so the index can only ever narrow candidates, never lose a key. + */ + var HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entries = entries; + // Lazy `{ [secondaryHash]: number[] }`, built only past + // MIN_HASH_COLLISION_INDEX_SIZE so small buckets keep their linear path. + this._index = undefined; + }; + + // Returns the position of `key` in `this.entries`, or -1. Uses the secondary + // index when present; builds it only when `buildIndex` is true (reads and + // transient inserts, where the node is reused so the O(n) build amortizes). + // Persistent inserts already pay an O(n) copy, so a throwaway index is skipped. + HashCollisionNode.prototype._positionOf = function _positionOf (key, buildIndex) { + var entries = this.entries; + var index = this._index; + if ( + index === undefined && + buildIndex && + entries.length >= MIN_HASH_COLLISION_INDEX_SIZE + ) { + index = this._buildIndex(); + } + if (index !== undefined) { + var positions = index[hashCollisionKey(key)]; + if (positions !== undefined) { + for (var jj = 0; jj < positions.length; jj++) { + var ii = positions[jj]; + if (is(key, entries[ii][0])) { + return ii; + } + } + } + return -1; + } + for (var ii$1 = 0, len = entries.length; ii$1 < len; ii$1++) { + if (is(key, entries[ii$1][0])) { + return ii$1; + } + } + return -1; + }; + + // Builds and memoizes the secondary index. A plain object, not `Map` — which + // in this module resolves to the *Immutable* Map, not the native one. + HashCollisionNode.prototype._buildIndex = function _buildIndex () { + var index = Object.create(null); + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + var secondaryHash = hashCollisionKey(entries[ii][0]); + var positions = index[secondaryHash]; + if (positions !== undefined) { + positions.push(ii); + } else { + index[secondaryHash] = [ii]; + } + } + this._index = index; + return index; + }; + + HashCollisionNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + var idx = this._positionOf(key, true); + return idx === -1 ? notSetValue : this.entries[idx][1]; + }; + + HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + + var removed = value === NOT_SET; + + if (keyHash !== this.keyHash) { + if (removed) { + return this; + } + SetRef(didAlter); + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); + } + + var entries = this.entries; + var len = entries.length; + var isEditable = ownerID && ownerID === this.ownerID; + var foundIdx = this._positionOf(key, isEditable); + var idx = foundIdx === -1 ? len : foundIdx; + var exists = foundIdx !== -1; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + (removed || !exists) && SetRef(didChangeSize); + + if (removed && len === 2) { + return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); + } + + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); + // The swap-pop reshuffles positions; drop the stale index (rebuilt lazily). + if (isEditable) { + this._index = undefined; + } + } else { + // Same key, same position: the index stays valid. + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + // Keep the index in sync on the transient insert path. Persistent inserts + // return a fresh node below whose index rebuilds lazily, so skip them. + if (isEditable && this._index !== undefined) { + var secondaryHash = hashCollisionKey(key); + var positions = this._index[secondaryHash]; + if (positions !== undefined) { + positions.push(len); + } else { + this._index[secondaryHash] = [len]; + } + } + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new HashCollisionNode(ownerID, this.keyHash, newEntries); + }; + + var ValueNode = function ValueNode(ownerID, keyHash, entry) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entry = entry; + }; + + ValueNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + return is(key, this.entry[0]) ? this.entry[1] : notSetValue; + }; + + ValueNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + var keyMatch = is(key, this.entry[0]); + if (keyMatch ? value === this.entry[1] : removed) { + return this; + } + + SetRef(didAlter); + + if (removed) { + SetRef(didChangeSize); + return; // undefined + } + + if (keyMatch) { + if (ownerID && ownerID === this.ownerID) { + this.entry[1] = value; + return this; + } + return new ValueNode(ownerID, this.keyHash, [key, value]); + } + + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); + }; + + // #pragma Iterators + + ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = + function (fn, reverse) { + var entries = this.entries; + for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { + if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { + return false; + } + } + }; + + BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = + function (fn, reverse) { + var nodes = this.nodes; + for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { + var node = nodes[reverse ? maxIndex - ii : ii]; + if (node && node.iterate(fn, reverse) === false) { + return false; + } + } + }; + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + ValueNode.prototype.iterate = function (fn, reverse) { + return fn(this.entry); + }; + + var MapIterator = /*@__PURE__*/(function (Iterator) { + function MapIterator(map, type, reverse) { + this._type = type; + this._reverse = reverse; + this._stack = map._root && mapIteratorFrame(map._root); + } + + if ( Iterator ) MapIterator.__proto__ = Iterator; + MapIterator.prototype = Object.create( Iterator && Iterator.prototype ); + MapIterator.prototype.constructor = MapIterator; + + MapIterator.prototype.next = function next () { + var type = this._type; + var stack = this._stack; + while (stack) { + var node = stack.node; + var index = stack.index++; + var maxIndex = (void 0); + if (node.entry) { + if (index === 0) { + return mapIteratorValue(type, node.entry); + } + } else if (node.entries) { + maxIndex = node.entries.length - 1; + if (index <= maxIndex) { + return mapIteratorValue( + type, + node.entries[this._reverse ? maxIndex - index : index] + ); + } + } else { + maxIndex = node.nodes.length - 1; + if (index <= maxIndex) { + var subNode = node.nodes[this._reverse ? maxIndex - index : index]; + if (subNode) { + if (subNode.entry) { + return mapIteratorValue(type, subNode.entry); + } + stack = this._stack = mapIteratorFrame(subNode, stack); + } + continue; + } + } + stack = this._stack = this._stack.__prev; + } + return iteratorDone(); + }; + + return MapIterator; + }(Iterator)); + + function mapIteratorValue(type, entry) { + return iteratorValue(type, entry[0], entry[1]); + } + + function mapIteratorFrame(node, prev) { + return { + node: node, + index: 0, + __prev: prev, + }; + } + + function makeMap(size, root, ownerID, hash) { + var map = Object.create(MapPrototype); + map.size = size; + map._root = root; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; + } + + var EMPTY_MAP; + function emptyMap() { + return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); + } + + function updateMap(map, k, v) { + var newRoot; + var newSize; + if (!map._root) { + if (v === NOT_SET) { + return map; + } + newSize = 1; + newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); + } else { + var didChangeSize = MakeRef(); + var didAlter = MakeRef(); + newRoot = updateNode( + map._root, + map.__ownerID, + 0, + undefined, + k, + v, + didChangeSize, + didAlter + ); + if (!didAlter.value) { + return map; + } + newSize = map.size + (didChangeSize.value ? (v === NOT_SET ? -1 : 1) : 0); + } + if (map.__ownerID) { + map.size = newSize; + map._root = newRoot; + map.__hash = undefined; + map.__altered = true; + return map; + } + return newRoot ? makeMap(newSize, newRoot) : emptyMap(); + } + + function updateNode( + node, + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter + ) { + if (!node) { + if (value === NOT_SET) { + return node; + } + SetRef(didAlter); + SetRef(didChangeSize); + return new ValueNode(ownerID, keyHash, [key, value]); + } + return node.update( + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter + ); + } + + function isLeafNode(node) { + return ( + node.constructor === ValueNode || node.constructor === HashCollisionNode + ); + } + + function mergeIntoNode(node, ownerID, shift, keyHash, entry) { + if (node.keyHash === keyHash) { + return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); + } + + var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; + var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + + var newNode; + var nodes = + idx1 === idx2 + ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] + : ((newNode = new ValueNode(ownerID, keyHash, entry)), + idx1 < idx2 ? [node, newNode] : [newNode, node]); + + return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); + } + + function createNodes(ownerID, entries, key, value) { + if (!ownerID) { + ownerID = new OwnerID(); + } + var node = new ValueNode(ownerID, hash(key), [key, value]); + for (var ii = 0; ii < entries.length; ii++) { + var entry = entries[ii]; + node = node.update(ownerID, 0, undefined, entry[0], entry[1]); + } + return node; + } + + function packNodes(ownerID, nodes, count, excluding) { + var bitmap = 0; + var packedII = 0; + var packedNodes = new Array(count); + for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { + var node = nodes[ii]; + if (node !== undefined && ii !== excluding) { + bitmap |= bit; + packedNodes[packedII++] = node; + } + } + return new BitmapIndexedNode(ownerID, bitmap, packedNodes); + } + + function expandNodes(ownerID, nodes, bitmap, including, node) { + var count = 0; + var expandedNodes = new Array(SIZE); + for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { + expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; + } + expandedNodes[including] = node; + return new HashArrayMapNode(ownerID, count + 1, expandedNodes); + } + + function popCount(x) { + x -= (x >> 1) & 0x55555555; + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0f0f0f0f; + x += x >> 8; + x += x >> 16; + return x & 0x7f; + } + + function setAt(array, idx, val, canEdit) { + var newArray = canEdit ? array : arrCopy(array); + newArray[idx] = val; + return newArray; + } + + function spliceIn(array, idx, val, canEdit) { + var newLen = array.length + 1; + if (canEdit && idx + 1 === newLen) { + array[idx] = val; + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + newArray[ii] = val; + after = -1; + } else { + newArray[ii] = array[ii + after]; + } + } + return newArray; + } + + function spliceOut(array, idx, canEdit) { + var newLen = array.length - 1; + if (canEdit && idx === newLen) { + array.pop(); + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + after = 1; + } + newArray[ii] = array[ii + after]; + } + return newArray; + } + + var MAX_ARRAY_MAP_SIZE = SIZE / 4; + var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; + var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; + + // Above this many colliding entries, a `HashCollisionNode` builds a seeded + // secondary index instead of scanning linearly. Kept small so the rare, + // naturally-occurring collision buckets stay overhead-free, while adversarial + // hash-flooding (thousands of keys sharing one hash) degrades gracefully. + var MIN_HASH_COLLISION_INDEX_SIZE = 16; + + function coerceKeyPath(keyPath) { + if (isArrayLike(keyPath) && typeof keyPath !== 'string') { + return keyPath; + } + if (isOrdered(keyPath)) { + return keyPath.toArray(); + } + throw new TypeError('Invalid keyPath: expected Ordered Collection or Array: ' + keyPath); + } + + /** + * Converts a value to a string, adding quotes if a string was provided. + */ + function quoteString(value) { + try { + return typeof value === 'string' ? JSON.stringify(value) : String(value); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } + catch (_ignoreError) { + return JSON.stringify(value); + } + } + + /** + * Returns true if the key is defined in the provided collection. + * + * A functional alternative to `collection.has(key)` which will also work with + * plain Objects and Arrays as an alternative for + * `collection.hasOwnProperty(key)`. + */ + function has(collection, key) { + return isImmutable(collection) + ? // @ts-expect-error key might be a number or symbol, which is not handled be Record key type + collection.has(key) + : // @ts-expect-error key might be anything else than PropertyKey, and will return false in that case but runtime is OK + isDataStructure(collection) && hasOwnProperty.call(collection, key); + } + + function get(collection, key, notSetValue) { + return isImmutable(collection) + ? collection.get(key, notSetValue) + : !has(collection, key) + ? notSetValue + : // @ts-expect-error weird "get" here, + typeof collection.get === 'function' + ? // @ts-expect-error weird "get" here, + collection.get(key) + : // @ts-expect-error key is unknown here, + collection[key]; + } + + function remove(collection, key) { + if (!isDataStructure(collection)) { + throw new TypeError('Cannot update non-data-structure value: ' + collection); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "remove" here, + if (!collection.remove) { + throw new TypeError('Cannot update immutable value without .remove() method: ' + collection); + } + // @ts-expect-error weird "remove" here, + return collection.remove(key); + } + // @ts-expect-error assert that key is a string, a number or a symbol here + if (!hasOwnProperty.call(collection, key)) { + return collection; + } + var collectionCopy = shallowCopy(collection); + if (Array.isArray(collectionCopy)) { + // @ts-expect-error assert that key is a number here + collectionCopy.splice(key, 1); + } + else { + // @ts-expect-error assert that key is a string, a number or a symbol here + delete collectionCopy[key]; + } + return collectionCopy; + } + + function set(collection, key, value) { + if (isProtoKey(key)) { + return collection; + } + if (!isDataStructure(collection)) { + throw new TypeError('Cannot update non-data-structure value: ' + collection); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "set" here, + if (!collection.set) { + throw new TypeError('Cannot update immutable value without .set() method: ' + collection); + } + // @ts-expect-error weird "set" here, + return collection.set(key, value); + } + // @ts-expect-error mix of key and string here. Probably need a more fine type here + if (hasOwnProperty.call(collection, key) && value === collection[key]) { + return collection; + } + var collectionCopy = shallowCopy(collection); + // @ts-expect-error mix of key and string here. Probably need a more fine type here + collectionCopy[key] = value; + return collectionCopy; + } + + function updateIn(collection, keyPath, notSetValue, updater) { + if (!updater) { + // handle the fact that `notSetValue` is optional here, in that case `updater` is the updater function + // @ts-expect-error updater is a function here + updater = notSetValue; + notSetValue = undefined; + } + var updatedValue = updateInDeeply(isImmutable(collection), + // @ts-expect-error type issues with Record and mixed types + collection, coerceKeyPath(keyPath), 0, notSetValue, updater); + // @ts-expect-error mixed return type + return updatedValue === NOT_SET ? notSetValue : updatedValue; + } + function updateInDeeply(inImmutable, existing, keyPath, i, notSetValue, updater) { + var wasNotSet = existing === NOT_SET; + if (i === keyPath.length) { + var existingValue = wasNotSet ? notSetValue : existing; + // @ts-expect-error mixed type with optional value + var newValue = updater(existingValue); + // @ts-expect-error mixed type + return newValue === existingValue ? existing : newValue; + } + if (!wasNotSet && !isDataStructure(existing)) { + throw new TypeError('Cannot update within non-data-structure value in path [' + + Array.from(keyPath).slice(0, i).map(quoteString) + + ']: ' + + existing); + } + var key = keyPath[i]; + var nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); + var nextUpdated = updateInDeeply(nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), + // @ts-expect-error mixed type + nextExisting, keyPath, i + 1, notSetValue, updater); + return nextUpdated === nextExisting + ? existing + : nextUpdated === NOT_SET + ? remove(existing, key) + : set(wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, key, nextUpdated); + } + + /** + * Returns a copy of the collection with the value at the key path removed. + * + * A functional alternative to `collection.removeIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function removeIn(collection, keyPath) { + return updateIn(collection, keyPath, function () { return NOT_SET; }); + } + + function deleteIn(keyPath) { + return removeIn(this, keyPath); + } + + var IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@'; + /** + * True if `maybeList` is a List. + */ + function isList(maybeList) { + return Boolean(maybeList && + // @ts-expect-error: maybeList is typed as `{}`, need to change in 6.0 to `maybeList && typeof maybeList === 'object' && IS_LIST_SYMBOL in maybeList` + maybeList[IS_LIST_SYMBOL]); + } + + var List = /*@__PURE__*/(function (IndexedCollection) { + function List(value) { + var empty = emptyList(); + if (value === undefined || value === null) { + // eslint-disable-next-line no-constructor-return + return empty; + } + if (isList(value)) { + // eslint-disable-next-line no-constructor-return + return value; + } + var iter = IndexedCollection(value); + var size = iter.size; + if (size === 0) { + // eslint-disable-next-line no-constructor-return + return empty; + } + assertNotInfinite(size); + if (size > 0 && size < SIZE) { + // eslint-disable-next-line no-constructor-return + return makeList(0, size, SHIFT, undefined, new VNode(iter.toArray())); + } + // eslint-disable-next-line no-constructor-return + return empty.withMutations(function (list) { + list.setSize(size); + iter.forEach(function (v, i) { return list.set(i, v); }); + }); + } + + if ( IndexedCollection ) List.__proto__ = IndexedCollection; + List.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + List.prototype.constructor = List; + + List.of = function of (/*...values*/) { + return this(arguments); + }; + + List.prototype.toString = function toString () { + return this.__toString('List [', ']'); + }; + + // @pragma Access + + List.prototype.get = function get (index, notSetValue) { + index = wrapIndex(this, index); + if (index >= 0 && index < this.size) { + index += this._origin; + var node = listNodeFor(this, index); + return node && node.array[index & MASK]; + } + return notSetValue; + }; + + // @pragma Modification + + List.prototype.set = function set (index, value) { + return updateList(this, index, value); + }; + + List.prototype.remove = function remove (index) { + return !this.has(index) + ? this + : index === 0 + ? this.shift() + : index === this.size - 1 + ? this.pop() + : this.splice(index, 1); + }; + + List.prototype.insert = function insert (index, value) { + return this.splice(index, 0, value); + }; + + List.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = this._origin = this._capacity = 0; + this._level = SHIFT; + this._root = this._tail = this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyList(); + }; + + List.prototype.push = function push (/*...values*/) { + var values = arguments; + var oldSize = this.size; + return this.withMutations(function (list) { + setListBounds(list, 0, oldSize + values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(oldSize + ii, values[ii]); + } + }); + }; + + List.prototype.pop = function pop () { + return setListBounds(this, 0, -1); + }; + + List.prototype.unshift = function unshift (/*...values*/) { + var values = arguments; + return this.withMutations(function (list) { + setListBounds(list, -values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(ii, values[ii]); + } + }); + }; + + List.prototype.shift = function shift () { + return setListBounds(this, 1); + }; + + List.prototype.shuffle = function shuffle (random) { + if ( random === void 0 ) random = Math.random; + + return this.withMutations(function (mutable) { + // implementation of the Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle + var current = mutable.size; + var destination; + var tmp; + + while (current) { + destination = Math.floor(random() * current--); + + tmp = mutable.get(destination); + mutable.set(destination, mutable.get(current)); + mutable.set(current, tmp); + } + }); + }; + + // @pragma Composition + + List.prototype.concat = function concat (/*...collections*/) { + var arguments$1 = arguments; + + var seqs = []; + for (var i = 0; i < arguments.length; i++) { + var argument = arguments$1[i]; + var seq = IndexedCollection( + typeof argument !== 'string' && hasIterator(argument) + ? argument + : [argument] + ); + if (seq.size !== 0) { + seqs.push(seq); + } + } + if (seqs.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && seqs.length === 1) { + return this.constructor(seqs[0]); + } + return this.withMutations(function (list) { + seqs.forEach(function (seq) { return seq.forEach(function (value) { return list.push(value); }); }); + }); + }; + + List.prototype.setSize = function setSize (size) { + return setListBounds(this, 0, size); + }; + + List.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (list) { + for (var i = 0; i < this$1$1.size; i++) { + list.set(i, mapper.call(context, list.get(i), i, this$1$1)); + } + }); + }; + + // @pragma Iteration + + List.prototype.slice = function slice (begin, end) { + var size = this.size; + if (wholeSlice(begin, end, size)) { + return this; + } + return setListBounds( + this, + resolveBegin(begin, size), + resolveEnd(end, size) + ); + }; + + List.prototype.__iterator = function __iterator (type, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + return new Iterator(function () { + var value = values(); + return value === DONE + ? iteratorDone() + : iteratorValue(type, reverse ? --index : index++, value); + }); + }; + + List.prototype.__iterate = function __iterate (fn, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + var value; + while ((value = values()) !== DONE) { + if (fn(value, reverse ? --index : index++, this) === false) { + break; + } + } + return index; + }; + + List.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyList(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeList( + this._origin, + this._capacity, + this._level, + this._root, + this._tail, + ownerID, + this.__hash + ); + }; + + return List; + }(IndexedCollection)); + + List.isList = isList; + + var ListPrototype = List.prototype; + ListPrototype[IS_LIST_SYMBOL] = true; + ListPrototype[DELETE] = ListPrototype.remove; + ListPrototype.merge = ListPrototype.concat; + ListPrototype.setIn = setIn; + ListPrototype.deleteIn = ListPrototype.removeIn = deleteIn; + ListPrototype.update = update; + ListPrototype.updateIn = updateIn$1; + ListPrototype.mergeIn = mergeIn; + ListPrototype.mergeDeepIn = mergeDeepIn; + ListPrototype.withMutations = withMutations; + ListPrototype.wasAltered = wasAltered; + ListPrototype.asImmutable = asImmutable; + ListPrototype['@@transducer/init'] = ListPrototype.asMutable = asMutable; + ListPrototype['@@transducer/step'] = function (result, arr) { + return result.push(arr); + }; + ListPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); + }; + + /** + * A node in the List's 32-wide trie. At inner levels `array` holds child + * `VNode`s; at the leaf level it holds the List's values. Missing slots are + * `undefined` array holes. + * + * @template T + */ + var VNode = function VNode(array, ownerID) { + this.array = array; + this.ownerID = ownerID; + }; + + // TODO: seems like these methods are very similar + + VNode.prototype.removeBefore = function removeBefore (ownerID, level, index) { + if ( + (index & ((1 << (level + SHIFT)) - 1)) === 0 || + this.array.length === 0 + ) { + return this; + } + var originIndex = (index >>> level) & MASK; + if (originIndex >= this.array.length) { + return new VNode([], ownerID); + } + var removingFirst = originIndex === 0; + var newChild; + if (level > 0) { + var oldChild = this.array[originIndex]; + newChild = + oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); + if (newChild === oldChild && removingFirst) { + return this; + } + } + if (removingFirst && !newChild) { + return this; + } + var editable = editableVNode(this, ownerID); + if (!removingFirst) { + for (var ii = 0; ii < originIndex; ii++) { + editable.array[ii] = undefined; + } + } + if (newChild) { + editable.array[originIndex] = newChild; + } + return editable; + }; + + VNode.prototype.removeAfter = function removeAfter (ownerID, level, index) { + if ( + index === (level ? 1 << (level + SHIFT) : SIZE) || + this.array.length === 0 + ) { + return this; + } + var sizeIndex = ((index - 1) >>> level) & MASK; + if (sizeIndex >= this.array.length) { + return this; + } + + var newChild; + if (level > 0) { + var oldChild = this.array[sizeIndex]; + newChild = + oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + if (newChild === oldChild && sizeIndex === this.array.length - 1) { + return this; + } + } + + var editable = editableVNode(this, ownerID); + editable.array.splice(sizeIndex + 1); + if (newChild) { + editable.array[sizeIndex] = newChild; + } + return editable; + }; + + var DONE = {}; + + function iterateList(list, reverse) { + var left = list._origin; + var right = list._capacity; + var tailPos = getTailOffset(right); + var tail = list._tail; + + return iterateNodeOrLeaf(list._root, list._level, 0); + + function iterateNodeOrLeaf(node, level, offset) { + return level === 0 + ? iterateLeaf(node, offset) + : iterateNode(node, level, offset); + } + + function iterateLeaf(node, offset) { + var array = offset === tailPos ? tail && tail.array : node && node.array; + var from = offset > left ? 0 : left - offset; + var to = right - offset; + if (to > SIZE) { + to = SIZE; + } + return function () { + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + return array && array[idx]; + }; + } + + function iterateNode(node, level, offset) { + var values; + var array = node && node.array; + var from = offset > left ? 0 : (left - offset) >> level; + var to = ((right - offset) >> level) + 1; + if (to > SIZE) { + to = SIZE; + } + return function () { + while (true) { + if (values) { + var value = values(); + if (value !== DONE) { + return value; + } + values = null; + } + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + values = iterateNodeOrLeaf( + array && array[idx], + level - SHIFT, + offset + (idx << level) + ); + } + }; + } + } + + /** + * @param {number} origin + * @param {number} capacity + * @param {number} level + * @param {VNode | undefined} [root] The trie root, or `undefined` when every + * in-range value lives in the tail (or is a virtual `undefined`). + * @param {VNode | undefined} [tail] + * @param {OwnerID} [ownerID] + * @param {number} [hash] + */ + function makeList(origin, capacity, level, root, tail, ownerID, hash) { + var list = Object.create(ListPrototype); + list.size = capacity - origin; + list._origin = origin; + list._capacity = capacity; + list._level = level; + list._root = root; + list._tail = tail; + list.__ownerID = ownerID; + list.__hash = hash; + list.__altered = false; + return list; + } + + function emptyList() { + return makeList(0, 0, SHIFT); + } + + function updateList(list, index, value) { + index = wrapIndex(list, index); + + if (index !== index) { + return list; + } + + if (index >= list.size || index < 0) { + return list.withMutations(function (list) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + index < 0 + ? setListBounds(list, index).set(0, value) + : setListBounds(list, 0, index + 1).set(index, value); + }); + } + + index += list._origin; + + var newTail = list._tail; + var newRoot = list._root; + var didAlter = MakeRef(); + if (index >= getTailOffset(list._capacity)) { + newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); + } else { + newRoot = updateVNode( + newRoot, + list.__ownerID, + list._level, + index, + value, + didAlter + ); + } + + if (!didAlter.value) { + return list; + } + + if (list.__ownerID) { + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(list._origin, list._capacity, list._level, newRoot, newTail); + } + + function updateVNode(node, ownerID, level, index, value, didAlter) { + var idx = (index >>> level) & MASK; + var nodeHas = node && idx < node.array.length; + if (!nodeHas && value === undefined) { + return node; + } + + var newNode; + + if (level > 0) { + var lowerNode = node && node.array[idx]; + var newLowerNode = updateVNode( + lowerNode, + ownerID, + level - SHIFT, + index, + value, + didAlter + ); + if (newLowerNode === lowerNode) { + return node; + } + newNode = editableVNode(node, ownerID); + newNode.array[idx] = newLowerNode; + return newNode; + } + + if (nodeHas && node.array[idx] === value) { + return node; + } + + if (didAlter) { + SetRef(didAlter); + } + + newNode = editableVNode(node, ownerID); + if (value === undefined && idx === newNode.array.length - 1) { + newNode.array.pop(); + } else { + newNode.array[idx] = value; + } + return newNode; + } + + function editableVNode(node, ownerID) { + if (ownerID && node && ownerID === node.ownerID) { + return node; + } + return new VNode(node ? node.array.slice() : [], ownerID); + } + + /** + * Returns the leaf `VNode` holding `rawIndex`, or `undefined` when no node is + * allocated for it (an all-`undefined` region). + * + * @param {List} list + * @param {number} rawIndex + * @returns {VNode | undefined} + */ + function listNodeFor(list, rawIndex) { + if (rawIndex >= getTailOffset(list._capacity)) { + return list._tail; + } + if (rawIndex < 1 << (list._level + SHIFT)) { + var node = list._root; + var level = list._level; + while (node && level > 0) { + node = node.array[(rawIndex >>> level) & MASK]; + level -= SHIFT; + } + return node; + } + } + + /** + * Validates requested bounds before int32 coercion in setListBounds(). + * Throws when origin/capacity would exceed the trie's safe range. + */ + function validateListBoundsRequest(list, begin, end) { + var requestedOrigin = list._origin + (begin === undefined ? 0 : begin); + var requestedCapacity = + end === undefined + ? list._capacity + : end < 0 + ? list._capacity + end + : list._origin + end; + + // Keep origin/capacity within the trie's safe signed 32-bit range. + if ( + (Number.isFinite(requestedCapacity) && requestedCapacity > MAX_LIST_SIZE) || + (Number.isFinite(requestedOrigin) && requestedOrigin < -MAX_LIST_SIZE) || + (Number.isFinite(requestedCapacity) && + Number.isFinite(requestedOrigin) && + requestedCapacity - requestedOrigin > MAX_LIST_SIZE) + ) { + throw new RangeError( + 'Invalid List size: a List cannot hold more than ' + + MAX_LIST_SIZE + + ' (2 ** 30) values.' + ); + } + } + + function setListBounds(list, begin, end) { + // Validate full-precision bounds before int32 coercion. + validateListBoundsRequest(list, begin, end); + + // Sanitize begin & end using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + if (begin !== undefined) { + begin |= 0; + } + if (end !== undefined) { + end |= 0; + } + var owner = list.__ownerID || new OwnerID(); + var oldOrigin = list._origin; + var oldCapacity = list._capacity; + var newOrigin = oldOrigin + begin; + var newCapacity = + end === undefined + ? oldCapacity + : end < 0 + ? oldCapacity + end + : oldOrigin + end; + if (newOrigin === oldOrigin && newCapacity === oldCapacity) { + return list; + } + + // If it's going to end after it starts, it's empty. + if (newOrigin >= newCapacity) { + return list.clear(); + } + + var newLevel = list._level; + var newRoot = list._root; + + // New origin might need creating a higher root. + var offsetShift = 0; + while (newOrigin + offsetShift < 0) { + newRoot = new VNode( + newRoot && newRoot.array.length ? [undefined, newRoot] : [], + owner + ); + newLevel += SHIFT; + // Shift origin into non-negative space as trie height grows. + offsetShift += levelCapacity(newLevel); + } + if (offsetShift) { + newOrigin += offsetShift; + oldOrigin += offsetShift; + newCapacity += offsetShift; + oldCapacity += offsetShift; + } + + var oldTailOffset = getTailOffset(oldCapacity); + var newTailOffset = getTailOffset(newCapacity); + + // New size might need creating a higher root. + while (newTailOffset >= levelCapacity(newLevel + SHIFT)) { + newRoot = new VNode( + newRoot && newRoot.array.length ? [newRoot] : [], + owner + ); + newLevel += SHIFT; + } + + // Locate or create the new tail. + var oldTail = list._tail; + var newTail = + newTailOffset < oldTailOffset + ? listNodeFor(list, newCapacity - 1) + : newTailOffset > oldTailOffset + ? new VNode([], owner) + : oldTail; + + // Merge Tail into tree. + if ( + oldTail && + newTailOffset > oldTailOffset && + newOrigin < oldCapacity && + oldTail.array.length + ) { + newRoot = editableVNode(newRoot, owner); + var node = newRoot; + for (var level = newLevel; level > SHIFT; level -= SHIFT) { + var idx = (oldTailOffset >>> level) & MASK; + node = node.array[idx] = editableVNode(node.array[idx], owner); + } + node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; + } + + // If the size has been reduced, there's a chance the tail needs to be trimmed. + if (newCapacity < oldCapacity) { + newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); + } + + // If the new origin is within the tail, then we do not need a root. + if (newOrigin >= newTailOffset) { + newOrigin -= newTailOffset; + newCapacity -= newTailOffset; + newLevel = SHIFT; + newRoot = undefined; + newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); + + // Otherwise, if the root has been trimmed, garbage collect. + } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { + offsetShift = 0; + + // Identify the new top root node of the subtree of the old root. + while (newRoot) { + var beginIndex = (newOrigin >>> newLevel) & MASK; + if ((beginIndex !== newTailOffset >>> newLevel) & MASK) { + break; + } + if (beginIndex) { + offsetShift += (1 << newLevel) * beginIndex; + } + newLevel -= SHIFT; + newRoot = newRoot.array[beginIndex]; + } + + // Trim the new sides of the new root. + if (newRoot && newOrigin > oldOrigin) { + newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); + } + if (newRoot && newTailOffset < oldTailOffset) { + newRoot = newRoot.removeAfter( + owner, + newLevel, + newTailOffset - offsetShift + ); + } + if (offsetShift) { + newOrigin -= offsetShift; + newCapacity -= offsetShift; + } + } + + if (list.__ownerID) { + list.size = newCapacity - newOrigin; + list._origin = newOrigin; + list._capacity = newCapacity; + list._level = newLevel; + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); + } + + function getTailOffset(size) { + return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT; + } + + // The largest number of values a List can hold. Above this the 32-bit trie math + // in setListBounds() stays in the safe signed 32-bit range. + var MAX_LIST_SIZE = Math.pow( 2, 30 ); // 1073741824 + + /** + * Computes 2 ** exp for the trie level-raising loops in setListBounds(). + * Use the cheap bitwise operator shift whenever possible, otherwise fall back to exponentiation. + * This is necessary because bitwise operators in JavaScript only work on 32-bit signed integers, so for exp >= 31, we need to use exponentiation to avoid overflow. + */ + function levelCapacity(exp) { + return exp < 31 ? 1 << exp : Math.pow( 2, exp ); + } + + /** + * True if `maybeOrderedMap` is an OrderedMap. + */ + function isOrderedMap(maybeOrderedMap) { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); + } + + var OrderedMap = /*@__PURE__*/(function (Map) { + function OrderedMap(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedMap() + : isOrderedMap(value) + ? value + : emptyOrderedMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( Map ) OrderedMap.__proto__ = Map; + OrderedMap.prototype = Object.create( Map && Map.prototype ); + OrderedMap.prototype.constructor = OrderedMap; + + OrderedMap.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedMap.prototype.toString = function toString () { + return this.__toString('OrderedMap {', '}'); + }; + + // @pragma Access + + OrderedMap.prototype.get = function get (k, notSetValue) { + var index = this._map.get(k); + return index !== undefined ? this._list.get(index)[1] : notSetValue; + }; + + // @pragma Modification + + OrderedMap.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._map.clear(); + this._list.clear(); + this.__altered = true; + return this; + } + return emptyOrderedMap(); + }; + + OrderedMap.prototype.set = function set (k, v) { + return updateOrderedMap(this, k, v); + }; + + OrderedMap.prototype.remove = function remove (k) { + return updateOrderedMap(this, k, NOT_SET); + }; + + OrderedMap.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._list.__iterate( + function (entry) { return entry && fn(entry[1], entry[0], this$1$1); }, + reverse + ); + }; + + OrderedMap.prototype.__iterator = function __iterator (type, reverse) { + return this._list.fromEntrySeq().__iterator(type, reverse); + }; + + OrderedMap.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + var newList = this._list.__ensureOwner(ownerID); + if (!ownerID) { + if (this.size === 0) { + return emptyOrderedMap(); + } + this.__ownerID = ownerID; + this.__altered = false; + this._map = newMap; + this._list = newList; + return this; + } + return makeOrderedMap(newMap, newList, ownerID, this.__hash); + }; + + return OrderedMap; + }(Map)); + + OrderedMap.isOrderedMap = isOrderedMap; + + OrderedMap.prototype[IS_ORDERED_SYMBOL] = true; + OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; + + function makeOrderedMap(map, list, ownerID, hash) { + var omap = Object.create(OrderedMap.prototype); + omap.size = map ? map.size : 0; + omap._map = map; + omap._list = list; + omap.__ownerID = ownerID; + omap.__hash = hash; + omap.__altered = false; + return omap; + } + + var EMPTY_ORDERED_MAP; + function emptyOrderedMap() { + return ( + EMPTY_ORDERED_MAP || + (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())) + ); + } + + function updateOrderedMap(omap, k, v) { + var map = omap._map; + var list = omap._list; + var i = map.get(k); + var has = i !== undefined; + var newMap; + var newList; + if (v === NOT_SET) { + // removed + if (!has) { + return omap; + } + if (list.size >= SIZE && list.size >= map.size * 2) { + newList = list.filter(function (entry, idx) { return entry !== undefined && i !== idx; }); + newMap = newList + .toKeyedSeq() + .map(function (entry) { return entry[0]; }) + .flip() + .toMap(); + if (omap.__ownerID) { + newMap.__ownerID = newList.__ownerID = omap.__ownerID; + } + } else { + newMap = map.remove(k); + newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); + } + } else if (has) { + if (v === list.get(i)[1]) { + return omap; + } + newMap = map; + newList = list.set(i, [k, v]); + } else { + newMap = map.set(k, list.size); + newList = list.set(list.size, [k, v]); + } + if (omap.__ownerID) { + omap.size = newMap.size; + omap._map = newMap; + omap._list = newList; + omap.__hash = undefined; + omap.__altered = true; + return omap; + } + return makeOrderedMap(newMap, newList); + } + + var IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@'; + /** + * True if `maybeStack` is a Stack. + */ + function isStack(maybeStack) { + return Boolean(maybeStack && + // @ts-expect-error: maybeStack is typed as `{}`, need to change in 6.0 to `maybeStack && typeof maybeStack === 'object' && MAYBE_STACK_SYMBOL in maybeStack` + maybeStack[IS_STACK_SYMBOL]); + } + + var Stack = /*@__PURE__*/(function (IndexedCollection) { + function Stack(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyStack() + : isStack(value) + ? value + : emptyStack().pushAll(value); + } + + if ( IndexedCollection ) Stack.__proto__ = IndexedCollection; + Stack.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + Stack.prototype.constructor = Stack; + + Stack.of = function of (/*...values*/) { + return this(arguments); + }; + + Stack.prototype.toString = function toString () { + return this.__toString('Stack [', ']'); + }; + + // @pragma Access + + Stack.prototype.get = function get (index, notSetValue) { + var head = this._head; + index = wrapIndex(this, index); + while (head && index--) { + head = head.next; + } + return head ? head.value : notSetValue; + }; + + Stack.prototype.peek = function peek () { + return this._head && this._head.value; + }; + + // @pragma Modification + + Stack.prototype.push = function push (/*...values*/) { + var arguments$1 = arguments; + + if (arguments.length === 0) { + return this; + } + var newSize = this.size + arguments.length; + var head = this._head; + for (var ii = arguments.length - 1; ii >= 0; ii--) { + head = { + value: arguments$1[ii], + next: head, + }; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pushAll = function pushAll (iter) { + iter = IndexedCollection(iter); + if (iter.size === 0) { + return this; + } + if (this.size === 0 && isStack(iter)) { + return iter; + } + assertNotInfinite(iter.size); + var newSize = this.size; + var head = this._head; + iter.__iterate(function (value) { + newSize++; + head = { + value: value, + next: head, + }; + }, /* reverse */ true); + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pop = function pop () { + return this.slice(1); + }; + + Stack.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._head = undefined; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyStack(); + }; + + Stack.prototype.slice = function slice (begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + var resolvedBegin = resolveBegin(begin, this.size); + var resolvedEnd = resolveEnd(end, this.size); + if (resolvedEnd !== this.size) { + // super.slice(begin, end); + return IndexedCollection.prototype.slice.call(this, begin, end); + } + var newSize = this.size - resolvedBegin; + var head = this._head; + while (resolvedBegin--) { + head = head.next; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + // @pragma Mutability + + Stack.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyStack(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeStack(this.size, this._head, ownerID, this.__hash); + }; + + // @pragma Iteration + + Stack.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return new ArraySeq(this.toArray()).__iterate( + function (v, k) { return fn(v, k, this$1$1); }, + reverse + ); + } + var iterations = 0; + var node = this._head; + while (node) { + if (fn(node.value, iterations++, this) === false) { + break; + } + node = node.next; + } + return iterations; + }; + + Stack.prototype.__iterator = function __iterator (type, reverse) { + if (reverse) { + return new ArraySeq(this.toArray()).__iterator(type, reverse); + } + var iterations = 0; + var node = this._head; + return new Iterator(function () { + if (node) { + var value = node.value; + node = node.next; + return iteratorValue(type, iterations++, value); + } + return iteratorDone(); + }); + }; + + return Stack; + }(IndexedCollection)); + + Stack.isStack = isStack; + + var StackPrototype = Stack.prototype; + StackPrototype[IS_STACK_SYMBOL] = true; + StackPrototype.shift = StackPrototype.pop; + StackPrototype.unshift = StackPrototype.push; + StackPrototype.unshiftAll = StackPrototype.pushAll; + StackPrototype.withMutations = withMutations; + StackPrototype.wasAltered = wasAltered; + StackPrototype.asImmutable = asImmutable; + StackPrototype['@@transducer/init'] = StackPrototype.asMutable = asMutable; + StackPrototype['@@transducer/step'] = function (result, arr) { + return result.unshift(arr); + }; + StackPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); + }; + + function makeStack(size, head, ownerID, hash) { + var map = Object.create(StackPrototype); + map.size = size; + map._head = head; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; + } + + var EMPTY_STACK; + function emptyStack() { + return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); + } + + function reduce(collection, reducer, reduction, context, useFirst, reverse) { + // @ts-expect-error Migrate to CollectionImpl in v6 + assertNotInfinite(collection.size); + // @ts-expect-error Migrate to CollectionImpl in v6 + collection.__iterate(function (v, k, c) { + if (useFirst) { + useFirst = false; + reduction = v; + } + else { + // `reduction` has already been seeded here (either with the provided + // initial value or with the first iterated value), so it is never the + // `undefined` placeholder — only a `V` or a `R`. + reduction = reducer.call(context, reduction, v, k, c); + } + }, reverse); + return reduction; + } + function keyMapper(v, k) { + return k; + } + function entryMapper(v, k) { + return [k, v]; + } + function not(predicate) { + return function () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return !predicate.apply(this, args); + }; + } + function neg(predicate) { + return function () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return -predicate.apply(this, args); + }; + } + function defaultNegComparator(a, b) { + return a < b ? 1 : a > b ? -1 : 0; + } + + function deepEqual(a, b) { + if (a === b) { + return true; + } + if (!isCollection(b) || + // @ts-expect-error size should exists on Collection + (a.size !== undefined && b.size !== undefined && a.size !== b.size) || + // @ts-expect-error __hash exists on Collection + (a.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + b.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + a.__hash !== b.__hash) || + isKeyed(a) !== isKeyed(b) || + isIndexed(a) !== isIndexed(b) || + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + isOrdered(a) !== isOrdered(b)) { + return false; + } + // @ts-expect-error size should exists on Collection + if (a.size === 0 && b.size === 0) { + return true; + } + var notAssociative = !isAssociative(a); + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + if (isOrdered(a)) { + var entries = a.entries(); + // @ts-expect-error need to cast as boolean + return (b.every(function (v, k) { + var entry = entries.next().value; + return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); + }) && entries.next().done); + } + var flipped = false; + if (a.size === undefined) { + // @ts-expect-error size should exists on Collection + if (b.size === undefined) { + if (typeof a.cacheResult === 'function') { + a.cacheResult(); + } + } + else { + flipped = true; + var _ = a; + a = b; + b = _; + } + } + var allEqual = true; + var bSize = + // @ts-expect-error b is Range | Repeat | Collection as it may have been flipped, and __iterate is valid + b.__iterate(function (v, k) { + if (notAssociative + ? // @ts-expect-error has exists on Collection + !a.has(v) + : flipped + ? // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(v, a.get(k, NOT_SET)) + : // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(a.get(k, NOT_SET), v)) { + allEqual = false; + return false; + } + }); + return (allEqual && + // @ts-expect-error size should exists on Collection + a.size === bSize); + } + + /** + * Returns a lazy seq of nums from start (inclusive) to end + * (exclusive), by step, where start defaults to 0, step to 1, and end to + * infinity. When start is equal to end, returns empty list. + */ + var Range = /*@__PURE__*/(function (IndexedSeq) { + function Range(start, end, step) { + if ( step === void 0 ) step = 1; + + if (!(this instanceof Range)) { + // eslint-disable-next-line no-constructor-return + return new Range(start, end, step); + } + invariant(step !== 0, 'Cannot step a Range by 0'); + invariant( + start !== undefined, + 'You must define a start value when using Range' + ); + invariant( + end !== undefined, + 'You must define an end value when using Range' + ); + + step = Math.abs(step); + if (end < start) { + step = -step; + } + this._start = start; + this._end = end; + this._step = step; + this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); + if (this.size === 0) { + if (EMPTY_RANGE) { + // eslint-disable-next-line no-constructor-return + return EMPTY_RANGE; + } + // eslint-disable-next-line @typescript-eslint/no-this-alias + EMPTY_RANGE = this; + } + } + + if ( IndexedSeq ) Range.__proto__ = IndexedSeq; + Range.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Range.prototype.constructor = Range; + + Range.prototype.toString = function toString () { + return this.size === 0 + ? 'Range []' + : ("Range [ " + (this._start) + "..." + (this._end) + (this._step !== 1 ? ' by ' + this._step : '') + " ]"); + }; + + Range.prototype.get = function get (index, notSetValue) { + return this.has(index) + ? this._start + wrapIndex(this, index) * this._step + : notSetValue; + }; + + Range.prototype.includes = function includes (searchValue) { + var possibleIndex = (searchValue - this._start) / this._step; + return ( + possibleIndex >= 0 && + possibleIndex < this.size && + possibleIndex === Math.floor(possibleIndex) + ); + }; + + Range.prototype.slice = function slice (begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + begin = resolveBegin(begin, this.size); + end = resolveEnd(end, this.size); + if (end <= begin) { + return new Range(0, 0); + } + return new Range( + this.get(begin, this._end), + this.get(end, this._end), + this._step + ); + }; + + Range.prototype.indexOf = function indexOf (searchValue) { + var offsetValue = searchValue - this._start; + if (offsetValue % this._step === 0) { + var index = offsetValue / this._step; + if (index >= 0 && index < this.size) { + return index; + } + } + return -1; + }; + + Range.prototype.lastIndexOf = function lastIndexOf (searchValue) { + return this.indexOf(searchValue); + }; + + Range.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + while (i !== size) { + if (fn(value, reverse ? size - ++i : i++, this) === false) { + break; + } + value += reverse ? -step : step; + } + return i; + }; + + Range.prototype.__iterator = function __iterator (type, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var v = value; + value += reverse ? -step : step; + return iteratorValue(type, reverse ? size - ++i : i++, v); + }); + }; + + Range.prototype.equals = function equals (other) { + return other instanceof Range + ? this._start === other._start && + this._end === other._end && + this._step === other._step + : deepEqual(this, other); + }; + + return Range; + }(IndexedSeq)); + + var EMPTY_RANGE; + + var IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@'; + /** + * True if `maybeSet` is a Set. + * + * Also true for OrderedSets. + */ + function isSet(maybeSet) { + return Boolean(maybeSet && + // @ts-expect-error: maybeSet is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSet === 'object' && MAYBE_SET_SYMBOL in maybeSet` + maybeSet[IS_SET_SYMBOL]); + } + + var Set = /*@__PURE__*/(function (SetCollection) { + function Set(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySet() + : isSet(value) && !isOrdered(value) + ? value + : emptySet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( SetCollection ) Set.__proto__ = SetCollection; + Set.prototype = Object.create( SetCollection && SetCollection.prototype ); + Set.prototype.constructor = Set; + + Set.of = function of (/*...values*/) { + return this(arguments); + }; + + Set.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + Set.intersect = function intersect (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.intersect.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.union = function union (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.union.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.prototype.toString = function toString () { + return this.__toString('Set {', '}'); + }; + + // @pragma Access + + Set.prototype.has = function has (value) { + return this._map.has(value); + }; + + // @pragma Modification + + Set.prototype.add = function add (value) { + return updateSet(this, this._map.set(value, value)); + }; + + Set.prototype.remove = function remove (value) { + return updateSet(this, this._map.remove(value)); + }; + + Set.prototype.clear = function clear () { + return updateSet(this, this._map.clear()); + }; + + // @pragma Composition + + Set.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + // keep track if the set is altered by the map function + var didChanges = false; + + var newMap = updateSet( + this, + this._map.mapEntries(function (ref) { + var v = ref[1]; + + var mapped = mapper.call(context, v, v, this$1$1); + + if (mapped !== v) { + didChanges = true; + } + + return [mapped, mapped]; + }, context) + ); + + return didChanges ? newMap : this; + }; + + Set.prototype.union = function union () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + iters = iters.filter(function (x) { return x.size !== 0; }); + if (iters.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && iters.length === 1) { + return this.constructor(iters[0]); + } + return this.withMutations(function (set) { + for (var ii = 0; ii < iters.length; ii++) { + if (typeof iters[ii] === 'string') { + set.add(iters[ii]); + } else { + SetCollection(iters[ii]).forEach(function (value) { return set.add(value); }); + } + } + }); + }; + + Set.prototype.intersect = function intersect () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (!iters.every(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.subtract = function subtract () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (iters.some(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.sort = function sort (comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator)); + }; + + Set.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator, mapper)); + }; + + Set.prototype.wasAltered = function wasAltered () { + return this._map.wasAltered(); + }; + + Set.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._map.__iterate(function (k) { return fn(k, k, this$1$1); }, reverse); + }; + + Set.prototype.__iterator = function __iterator (type, reverse) { + return this._map.__iterator(type, reverse); + }; + + Set.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + if (!ownerID) { + if (this.size === 0) { + return this.__empty(); + } + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return this.__make(newMap, ownerID); + }; + + return Set; + }(SetCollection)); + + Set.isSet = isSet; + + var SetPrototype = Set.prototype; + SetPrototype[IS_SET_SYMBOL] = true; + SetPrototype[DELETE] = SetPrototype.remove; + SetPrototype.merge = SetPrototype.concat = SetPrototype.union; + SetPrototype.withMutations = withMutations; + SetPrototype.asImmutable = asImmutable; + SetPrototype['@@transducer/init'] = SetPrototype.asMutable = asMutable; + SetPrototype['@@transducer/step'] = function (result, arr) { + return result.add(arr); + }; + SetPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); + }; + + SetPrototype.__empty = emptySet; + SetPrototype.__make = makeSet; + + function updateSet(set, newMap) { + if (set.__ownerID) { + set.size = newMap.size; + set._map = newMap; + return set; + } + return newMap === set._map + ? set + : newMap.size === 0 + ? set.__empty() + : set.__make(newMap); + } + + function makeSet(map, ownerID) { + var set = Object.create(SetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; + } + + var EMPTY_SET; + function emptySet() { + return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); + } + + /** + * Returns the value at the provided key path starting at the provided + * collection, or notSetValue if the key path is not defined. + * + * A functional alternative to `collection.getIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function getIn$1(collection, searchKeyPath, notSetValue) { + var keyPath = coerceKeyPath(searchKeyPath); + var i = 0; + while (i !== keyPath.length) { + // @ts-expect-error keyPath[i++] can not be undefined by design + collection = get(collection, keyPath[i++], NOT_SET); + if (collection === NOT_SET) { + return notSetValue; + } + } + return collection; + } + + function getIn(searchKeyPath, notSetValue) { + return getIn$1(this, searchKeyPath, notSetValue); + } + + /** + * Returns true if the key path is defined in the provided collection. + * + * A functional alternative to `collection.hasIn(keypath)` which will also + * work with plain Objects and Arrays. + */ + function hasIn$1(collection, keyPath) { + return getIn$1(collection, keyPath, NOT_SET) !== NOT_SET; + } + + function hasIn(searchKeyPath) { + return hasIn$1(this, searchKeyPath); + } + + function toObject() { + assertNotInfinite(this.size); + var object = {}; + this.__iterate(function (v, k) { + if (isProtoKey(k)) { + return; + } + + object[k] = v; + }); + return object; + } + + function toJS(value) { + if (!value || typeof value !== 'object') { + return value; + } + if (!isCollection(value)) { + if (!isDataStructure(value)) { + return value; + } + // @ts-expect-error until Seq has been migrated to TypeScript + value = Seq(value); + } + if (isKeyed(value)) { + var result$1 = {}; + // @ts-expect-error `__iterate` exists on all Keyed collections but method is not defined in the type + value.__iterate(function (v, k) { + if (isProtoKey(k)) { + return; + } + result$1[k] = toJS(v); + }); + return result$1; + } + var result = []; + // @ts-expect-error value "should" be a non-keyed collection, but we may need to assert for stricter types + value.__iterate(function (v) { + result.push(toJS(v)); + }); + return result; + } + + function hashCollection(collection) { + // @ts-expect-error Migrate to CollectionImpl in v6 + if (collection.size === Infinity) { + return 0; + } + var ordered = isOrdered(collection); + var keyed = isKeyed(collection); + var h = ordered ? 1 : 0; + // @ts-expect-error Migrate to CollectionImpl in v6 + collection.__iterate(keyed + ? ordered + ? function (v, k) { + h = (31 * h + hashMerge(hash(v), hash(k))) | 0; + } + : function (v, k) { + h = (h + hashMerge(hash(v), hash(k))) | 0; + } + : ordered + ? function (v) { + h = (31 * h + hash(v)) | 0; + } + : function (v) { + h = (h + hash(v)) | 0; + }); + // @ts-expect-error Migrate to CollectionImpl in v6 + return murmurHashOfSize(collection.size, h); + } + function murmurHashOfSize(size, h) { + h = imul(h, 0xcc9e2d51); + h = imul((h << 15) | (h >>> -15), 0x1b873593); + h = imul((h << 13) | (h >>> -13), 5); + h = ((h + 0xe6546b64) | 0) ^ size; + h = imul(h ^ (h >>> 16), 0x85ebca6b); + h = imul(h ^ (h >>> 13), 0xc2b2ae35); + h = smi(h ^ (h >>> 16)); + return h; + } + function hashMerge(a, b) { + return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; // int + } + + /** + * Contributes additional methods to a constructor + */ + function mixin(ctor, + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + methods) { + var keyCopier = function (key) { + // @ts-expect-error how to handle symbol ? + ctor.prototype[key] = methods[key]; + }; + Object.keys(methods).forEach(keyCopier); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + Object.getOwnPropertySymbols && + Object.getOwnPropertySymbols(methods).forEach(keyCopier); + return ctor; + } + + Collection.Iterator = Iterator; + + mixin(Collection, { + // ### Conversion to other types + + toArray: function toArray() { + assertNotInfinite(this.size); + var array = new Array(this.size || 0); + var useTuples = isKeyed(this); + var i = 0; + this.__iterate(function (v, k) { + // Keyed collections produce an array of tuples. + array[i++] = useTuples ? [k, v] : v; + }); + return array; + }, + + toIndexedSeq: function toIndexedSeq() { + return new ToIndexedSequence(this); + }, + + toJS: function toJS$1() { + return toJS(this); + }, + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, true); + }, + + toMap: function toMap() { + // Use Late Binding here to solve the circular dependency. + return Map(this.toKeyedSeq()); + }, + + toObject: toObject, + + toOrderedMap: function toOrderedMap() { + // Use Late Binding here to solve the circular dependency. + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet: function toOrderedSet() { + // Use Late Binding here to solve the circular dependency. + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet: function toSet() { + // Use Late Binding here to solve the circular dependency. + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq: function toSetSeq() { + return new ToSetSequence(this); + }, + + toSeq: function toSeq() { + return isIndexed(this) + ? this.toIndexedSeq() + : isKeyed(this) + ? this.toKeyedSeq() + : this.toSetSeq(); + }, + + toStack: function toStack() { + // Use Late Binding here to solve the circular dependency. + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList: function toList() { + // Use Late Binding here to solve the circular dependency. + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + // ### Common JavaScript methods and properties + + toString: function toString() { + return '[Collection]'; + }, + + __toString: function __toString(head, tail) { + if (this.size === 0) { + return head + tail; + } + return ( + head + + ' ' + + this.toSeq().map(this.__toStringMapper).join(', ') + + ' ' + + tail + ); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + concat: function concat() { + var values = [], len = arguments.length; + while ( len-- ) values[ len ] = arguments[ len ]; + + return reify(this, concatFactory(this, values)); + }, + + includes: function includes(searchValue) { + return this.some(function (value) { return is(value, searchValue); }); + }, + + entries: function entries() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every: function every(predicate, context) { + assertNotInfinite(this.size); + var returnValue = true; + this.__iterate(function (v, k, c) { + if (!predicate.call(context, v, k, c)) { + returnValue = false; + return false; + } + }); + return returnValue; + }, + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + partition: function partition(predicate, context) { + return partitionFactory(this, predicate, context); + }, + + find: function find(predicate, context, notSetValue) { + var entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + forEach: function forEach(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join: function join(separator) { + assertNotInfinite(this.size); + separator = separator !== undefined ? '' + separator : ','; + var joined = ''; + var isFirst = true; + this.__iterate(function (v) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + isFirst ? (isFirst = false) : (joined += separator); + joined += v !== null && v !== undefined ? v.toString() : ''; + }); + return joined; + }, + + keys: function keys() { + return this.__iterator(ITERATE_KEYS); + }, + + map: function map(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce: function reduce$1(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + false + ); + }, + + reduceRight: function reduceRight(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + true + ); + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, true)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some: function some(predicate, context) { + assertNotInfinite(this.size); + var returnValue = false; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + returnValue = true; + return false; + } + }); + return returnValue; + }, + + sort: function sort(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values: function values() { + return this.__iterator(ITERATE_VALUES); + }, + + // ### More sequential methods + + butLast: function butLast() { + return this.slice(0, -1); + }, + + isEmpty: function isEmpty() { + return this.size !== undefined ? this.size === 0 : !this.some(function () { return true; }); + }, + + count: function count(predicate, context) { + return ensureSize( + predicate ? this.toSeq().filter(predicate, context) : this + ); + }, + + countBy: function countBy(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals: function equals(other) { + return deepEqual(this, other); + }, + + entrySeq: function entrySeq() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + var collection = this; + if (collection._cache) { + // We cache as an entries array, so we can just return the cache! + return new ArraySeq(collection._cache); + } + var entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = function () { return collection.toSeq(); }; + return entriesSequence; + }, + + filterNot: function filterNot(predicate, context) { + return this.filter(not(predicate), context); + }, + + findEntry: function findEntry(predicate, context, notSetValue) { + var found = notSetValue; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findKey: function findKey(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLast: function findLast(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + findLastEntry: function findLastEntry(predicate, context, notSetValue) { + return this.toKeyedSeq() + .reverse() + .findEntry(predicate, context, notSetValue); + }, + + findLastKey: function findLastKey(predicate, context) { + return this.toKeyedSeq().reverse().findKey(predicate, context); + }, + + first: function first(notSetValue) { + return this.find(returnTrue, null, notSetValue); + }, + + flatMap: function flatMap(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq: function fromEntrySeq() { + return new FromEntriesSequence(this); + }, + + get: function get(searchKey, notSetValue) { + return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue); + }, + + getIn: getIn, + + groupBy: function groupBy(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has: function has(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: hasIn, + + isSubset: function isSubset(iter) { + iter = typeof iter.includes === 'function' ? iter : Collection(iter); + return this.every(function (value) { return iter.includes(value); }); + }, + + isSuperset: function isSuperset(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Collection(iter); + return iter.isSubset(this); + }, + + keyOf: function keyOf(searchValue) { + return this.findKey(function (value) { return is(value, searchValue); }); + }, + + keySeq: function keySeq() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last: function last(notSetValue) { + return this.toSeq().reverse().first(notSetValue); + }, + + lastKeyOf: function lastKeyOf(searchValue) { + return this.toKeyedSeq().reverse().keyOf(searchValue); + }, + + max: function max(comparator) { + return maxFactory(this, comparator); + }, + + maxBy: function maxBy(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min: function min(comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator + ); + }, + + minBy: function minBy(mapper, comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator, + mapper + ); + }, + + rest: function rest() { + return this.slice(1); + }, + + skip: function skip(amount) { + return amount === 0 ? this : this.slice(Math.max(0, amount)); + }, + + skipLast: function skipLast(amount) { + return amount === 0 ? this : this.slice(0, -Math.max(0, amount)); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil: function skipUntil(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy: function sortBy(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take: function take(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast: function takeLast(amount) { + return this.slice(-Math.max(0, amount)); + }, + + takeWhile: function takeWhile(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil: function takeUntil(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + update: function update(fn) { + return fn(this); + }, + + valueSeq: function valueSeq() { + return this.toIndexedSeq(); + }, + + // ### Hashable Object + + hashCode: function hashCode() { + return this.__hash || (this.__hash = hashCollection(this)); + }, + + // ### Internal + + // abstract __iterate(fn, reverse) + + // abstract __iterator(type, reverse) + }); + + var CollectionPrototype = Collection.prototype; + CollectionPrototype[IS_COLLECTION_SYMBOL] = true; + CollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.values; + CollectionPrototype.toJSON = CollectionPrototype.toArray; + CollectionPrototype.__toStringMapper = quoteString; + CollectionPrototype.inspect = CollectionPrototype.toSource = function () { + return this.toString(); + }; + CollectionPrototype.chain = CollectionPrototype.flatMap; + CollectionPrototype.contains = CollectionPrototype.includes; + + mixin(KeyedCollection, { + // ### More sequential methods + + flip: function flip() { + return reify(this, flipFactory(this)); + }, + + mapEntries: function mapEntries(mapper, context) { + var this$1$1 = this; + + var iterations = 0; + return reify( + this, + this.toSeq() + .map(function (v, k) { return mapper.call(context, [k, v], iterations++, this$1$1); }) + .fromEntrySeq() + ); + }, + + mapKeys: function mapKeys(mapper, context) { + var this$1$1 = this; + + return reify( + this, + this.toSeq() + .flip() + .map(function (k, v) { return mapper.call(context, k, v, this$1$1); }) + .flip() + ); + }, + }); + + var KeyedCollectionPrototype = KeyedCollection.prototype; + KeyedCollectionPrototype[IS_KEYED_SYMBOL] = true; + KeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries; + KeyedCollectionPrototype.toJSON = toObject; + KeyedCollectionPrototype.__toStringMapper = function (v, k) { return quoteString(k) + ': ' + quoteString(v); }; + + mixin(IndexedCollection, { + // ### Conversion to other types + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, false); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex: function findIndex(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf: function indexOf(searchValue) { + var key = this.keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf: function lastIndexOf(searchValue) { + var key = this.lastKeyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, false)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice: function splice(index, removeNum /*, ...values*/) { + var numArgs = arguments.length; + removeNum = Math.max(removeNum || 0, 0); + if (numArgs === 0 || (numArgs === 2 && !removeNum)) { + return this; + } + // If index is negative, it should resolve relative to the size of the + // collection. However size may be expensive to compute if not cached, so + // only call count() if the number is in fact negative. + index = resolveBegin(index, index < 0 ? this.count() : this.size); + var spliced = this.slice(0, index); + return reify( + this, + numArgs === 1 + ? spliced + : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) + ); + }, + + // ### More collection methods + + findLastIndex: function findLastIndex(predicate, context) { + var entry = this.findLastEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + first: function first(notSetValue) { + return this.get(0, notSetValue); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get: function get(index, notSetValue) { + index = wrapIndex(this, index); + return index < 0 || + this.size === Infinity || + (this.size !== undefined && index > this.size) + ? notSetValue + : this.find(function (_, key) { return key === index; }, undefined, notSetValue); + }, + + has: function has(index) { + index = wrapIndex(this, index); + + return ( + index >= 0 && + (this.size !== undefined + ? this.size === Infinity || index < this.size + : this.find(function (_, key) { return key === index; }, undefined, NOT_SET) !== NOT_SET) + ); + }, + + interpose: function interpose(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave: function interleave(/*...collections*/) { + var collections = [this].concat(arrCopy(arguments)); + var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections); + var interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * collections.length; + } + return reify(this, interleaved); + }, + + keySeq: function keySeq() { + return Range(0, this.size); + }, + + last: function last(notSetValue) { + return this.get(-1, notSetValue); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip: function zip(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections)); + }, + + zipAll: function zipAll(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections, true)); + }, + + zipWith: function zipWith(zipper /*, ...collections */) { + var collections = arrCopy(arguments); + collections[0] = this; + return reify(this, zipWithFactory(this, zipper, collections)); + }, + }); + + var IndexedCollectionPrototype = IndexedCollection.prototype; + IndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true; + IndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true; + + mixin(SetCollection, { + // ### ES6 Collection methods (ES6 Array and Map) + + get: function get(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes: function includes(value) { + return this.has(value); + }, + + // ### More sequential methods + + keySeq: function keySeq() { + return this.valueSeq(); + }, + }); + + var SetCollectionPrototype = SetCollection.prototype; + SetCollectionPrototype.has = CollectionPrototype.includes; + SetCollectionPrototype.contains = SetCollectionPrototype.includes; + SetCollectionPrototype.keys = SetCollectionPrototype.values; + + // Mixin subclasses + + mixin(KeyedSeq, KeyedCollectionPrototype); + mixin(IndexedSeq, IndexedCollectionPrototype); + mixin(SetSeq, SetCollectionPrototype); + + // #pragma Helper functions + + function defaultZipper() { + return arrCopy(arguments); + } + + /** + * True if `maybeOrderedSet` is an OrderedSet. + */ + function isOrderedSet(maybeOrderedSet) { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); + } + + var OrderedSet = /*@__PURE__*/(function (Set) { + function OrderedSet(value) { + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedSet() + : isOrderedSet(value) + ? value + : emptyOrderedSet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( Set ) OrderedSet.__proto__ = Set; + OrderedSet.prototype = Object.create( Set && Set.prototype ); + OrderedSet.prototype.constructor = OrderedSet; + + OrderedSet.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedSet.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + OrderedSet.prototype.toString = function toString () { + return this.__toString('OrderedSet {', '}'); + }; + + return OrderedSet; + }(Set)); + + OrderedSet.isOrderedSet = isOrderedSet; + + var OrderedSetPrototype = OrderedSet.prototype; + OrderedSetPrototype[IS_ORDERED_SYMBOL] = true; + OrderedSetPrototype.zip = IndexedCollectionPrototype.zip; + OrderedSetPrototype.zipWith = IndexedCollectionPrototype.zipWith; + OrderedSetPrototype.zipAll = IndexedCollectionPrototype.zipAll; + + OrderedSetPrototype.__empty = emptyOrderedSet; + OrderedSetPrototype.__make = makeOrderedSet; + + function makeOrderedSet(map, ownerID) { + var set = Object.create(OrderedSetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; + } + + var EMPTY_ORDERED_SET; + function emptyOrderedSet() { + return ( + EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())) + ); + } + + /** + * Describes which item in a pair should be placed first when sorting + */ + var PairSorting = { + LeftThenRight: -1, + RightThenLeft: 1, + }; + + function throwOnInvalidDefaultValues(defaultValues) { + if (isRecord(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.' + ); + } + + if (isImmutable(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.' + ); + } + + if (defaultValues === null || typeof defaultValues !== 'object') { + throw new Error( + 'Can not call `Record` with a non-object as default values. Use a plain javascript object instead.' + ); + } + } + + var Record = function Record(defaultValues, name) { + var hasInitialized; + + throwOnInvalidDefaultValues(defaultValues); + + var RecordType = function Record(values) { + var this$1$1 = this; + + if (values instanceof RecordType) { + return values; + } + if (!(this instanceof RecordType)) { + return new RecordType(values); + } + if (!hasInitialized) { + hasInitialized = true; + var keys = Object.keys(defaultValues); + var indices = (RecordTypePrototype._indices = {}); + // Deprecated: left to attempt not to break any external code which + // relies on a ._name property existing on record instances. + // Use Record.getDescriptiveName() instead + RecordTypePrototype._name = name; + RecordTypePrototype._keys = keys; + RecordTypePrototype._defaultValues = defaultValues; + for (var i = 0; i < keys.length; i++) { + var propName = keys[i]; + indices[propName] = i; + if (RecordTypePrototype[propName]) { + /* eslint-disable no-console */ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + typeof console === 'object' && + console.warn && + console.warn( + 'Cannot define ' + + recordName(this) + + ' with property "' + + propName + + '" since that property name is part of the Record API.' + ); + /* eslint-enable no-console */ + } else { + setProp(RecordTypePrototype, propName); + } + } + } + this.__ownerID = undefined; + this._values = List().withMutations(function (l) { + l.setSize(this$1$1._keys.length); + KeyedCollection(values).forEach(function (v, k) { + l.set(this$1$1._indices[k], v === this$1$1._defaultValues[k] ? undefined : v); + }); + }); + return this; + }; + + var RecordTypePrototype = (RecordType.prototype = + Object.create(RecordPrototype)); + RecordTypePrototype.constructor = RecordType; + + if (name) { + RecordType.displayName = name; + } + + // eslint-disable-next-line no-constructor-return + return RecordType; + }; + + Record.prototype.toString = function toString () { + var str = recordName(this) + ' { '; + var keys = this._keys; + var k; + for (var i = 0, l = keys.length; i !== l; i++) { + k = keys[i]; + str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k)); + } + return str + ' }'; + }; + + Record.prototype.equals = function equals (other) { + return ( + this === other || + (isRecord(other) && recordSeq(this).equals(recordSeq(other))) + ); + }; + + Record.prototype.hashCode = function hashCode () { + return recordSeq(this).hashCode(); + }; + + // @pragma Access + + Record.prototype.has = function has (k) { + return this._indices.hasOwnProperty(k); + }; + + Record.prototype.get = function get (k, notSetValue) { + if (!this.has(k)) { + return notSetValue; + } + var index = this._indices[k]; + var value = this._values.get(index); + return value === undefined ? this._defaultValues[k] : value; + }; + + // @pragma Modification + + Record.prototype.set = function set (k, v) { + if (this.has(k)) { + var newValues = this._values.set( + this._indices[k], + v === this._defaultValues[k] ? undefined : v + ); + if (newValues !== this._values && !this.__ownerID) { + return makeRecord(this, newValues); + } + } + return this; + }; + + Record.prototype.remove = function remove (k) { + return this.set(k); + }; + + Record.prototype.clear = function clear () { + var newValues = this._values.clear().setSize(this._keys.length); + + return this.__ownerID ? this : makeRecord(this, newValues); + }; + + Record.prototype.wasAltered = function wasAltered () { + return this._values.wasAltered(); + }; + + Record.prototype.toSeq = function toSeq () { + return recordSeq(this); + }; + + Record.prototype.toJS = function toJS$1 () { + return toJS(this); + }; + + Record.prototype.entries = function entries () { + return this.__iterator(ITERATE_ENTRIES); + }; + + Record.prototype.__iterator = function __iterator (type, reverse) { + return recordSeq(this).__iterator(type, reverse); + }; + + Record.prototype.__iterate = function __iterate (fn, reverse) { + return recordSeq(this).__iterate(fn, reverse); + }; + + Record.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newValues = this._values.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._values = newValues; + return this; + } + return makeRecord(this, newValues, ownerID); + }; + + Record.isRecord = isRecord; + Record.getDescriptiveName = recordName; + var RecordPrototype = Record.prototype; + RecordPrototype[IS_RECORD_SYMBOL] = true; + RecordPrototype[DELETE] = RecordPrototype.remove; + RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn; + RecordPrototype.getIn = getIn; + RecordPrototype.hasIn = CollectionPrototype.hasIn; + RecordPrototype.merge = merge$1; + RecordPrototype.mergeWith = mergeWith$1; + RecordPrototype.mergeIn = mergeIn; + RecordPrototype.mergeDeep = mergeDeep; + RecordPrototype.mergeDeepWith = mergeDeepWith; + RecordPrototype.mergeDeepIn = mergeDeepIn; + RecordPrototype.setIn = setIn; + RecordPrototype.update = update; + RecordPrototype.updateIn = updateIn$1; + RecordPrototype.withMutations = withMutations; + RecordPrototype.asMutable = asMutable; + RecordPrototype.asImmutable = asImmutable; + RecordPrototype[ITERATOR_SYMBOL] = RecordPrototype.entries; + RecordPrototype.toJSON = RecordPrototype.toObject = + CollectionPrototype.toObject; + RecordPrototype.inspect = RecordPrototype.toSource = function () { + return this.toString(); + }; + + function makeRecord(likeRecord, values, ownerID) { + var record = Object.create(Object.getPrototypeOf(likeRecord)); + record._values = values; + record.__ownerID = ownerID; + return record; + } + + function recordName(record) { + return record.constructor.displayName || record.constructor.name || 'Record'; + } + + function recordSeq(record) { + return keyedSeqFromValue(record._keys.map(function (k) { return [k, record.get(k)]; })); + } + + function setProp(prototype, name) { + try { + Object.defineProperty(prototype, name, { + get: function () { + return this.get(name); + }, + set: function (value) { + invariant(this.__ownerID, 'Cannot set on an immutable record.'); + this.set(name, value); + }, + }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO enable eslint here + } catch (error) { + // Object.defineProperty failed. Probably IE8. + } + } + + /** + * Returns a lazy Seq of `value` repeated `times` times. When `times` is + * undefined, returns an infinite sequence of `value`. + */ + var Repeat = /*@__PURE__*/(function (IndexedSeq) { + function Repeat(value, times) { + if (!(this instanceof Repeat)) { + // eslint-disable-next-line no-constructor-return + return new Repeat(value, times); + } + this._value = value; + this.size = times === undefined ? Infinity : Math.max(0, times); + if (this.size === 0) { + if (EMPTY_REPEAT) { + // eslint-disable-next-line no-constructor-return + return EMPTY_REPEAT; + } + // eslint-disable-next-line @typescript-eslint/no-this-alias + EMPTY_REPEAT = this; + } + } + + if ( IndexedSeq ) Repeat.__proto__ = IndexedSeq; + Repeat.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Repeat.prototype.constructor = Repeat; + + Repeat.prototype.toString = function toString () { + if (this.size === 0) { + return 'Repeat []'; + } + return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; + }; + + Repeat.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._value : notSetValue; + }; + + Repeat.prototype.includes = function includes (searchValue) { + return is(this._value, searchValue); + }; + + Repeat.prototype.slice = function slice (begin, end) { + var size = this.size; + return wholeSlice(begin, end, size) + ? this + : new Repeat( + this._value, + resolveEnd(end, size) - resolveBegin(begin, size) + ); + }; + + Repeat.prototype.reverse = function reverse () { + return this; + }; + + Repeat.prototype.indexOf = function indexOf (searchValue) { + if (this.size !== 0 && is(this._value, searchValue)) { + return 0; + } + return -1; + }; + + Repeat.prototype.lastIndexOf = function lastIndexOf (searchValue) { + if (this.size !== 0 && is(this._value, searchValue)) { + return this.size - 1; + } + return -1; + }; + + Repeat.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var i = 0; + while (i !== size) { + if (fn(this._value, reverse ? size - ++i : i++, this) === false) { + break; + } + } + return i; + }; + + Repeat.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var size = this.size; + var i = 0; + return new Iterator(function () { return i === size + ? iteratorDone() + : iteratorValue(type, reverse ? size - ++i : i++, this$1$1._value); } + ); + }; + + Repeat.prototype.equals = function equals (other) { + return other instanceof Repeat + ? is(this._value, other._value) + : deepEqual(this, other); + }; + + return Repeat; + }(IndexedSeq)); + + var EMPTY_REPEAT; + + function fromJS(value, converter) { + return fromJSWith( + [], + converter || defaultConverter, + value, + '', + converter && converter.length > 2 ? [] : undefined, + { '': value } + ); + } + + function fromJSWith(stack, converter, value, key, keyPath, parentValue) { + if ( + typeof value !== 'string' && + !isImmutable(value) && + (isArrayLike(value) || hasIterator(value) || isPlainObject(value)) + ) { + if (~stack.indexOf(value)) { + throw new TypeError('Cannot convert circular structure to Immutable'); + } + stack.push(value); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && key !== '' && keyPath.push(key); + var converted = converter.call( + parentValue, + key, + Seq(value).map(function (v, k) { return fromJSWith(stack, converter, v, k, keyPath, value); } + ), + keyPath && keyPath.slice() + ); + stack.pop(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && keyPath.pop(); + return converted; + } + return value; + } + + function defaultConverter(k, v) { + // Effectively the opposite of "Collection.toSeq()" + return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet(); + } + + var version = "5.1.9"; + + /* eslint-disable import/order */ + + // Note: Iterable is deprecated + var Iterable = Collection; + + exports.Collection = Collection; + exports.Iterable = Iterable; + exports.List = List; + exports.Map = Map; + exports.OrderedMap = OrderedMap; + exports.OrderedSet = OrderedSet; + exports.PairSorting = PairSorting; + exports.Range = Range; + exports.Record = Record; + exports.Repeat = Repeat; + exports.Seq = Seq; + exports.Set = Set; + exports.Stack = Stack; + exports.fromJS = fromJS; + exports.get = get; + exports.getIn = getIn$1; + exports.has = has; + exports.hasIn = hasIn$1; + exports.hash = hash; + exports.is = is; + exports.isAssociative = isAssociative; + exports.isCollection = isCollection; + exports.isImmutable = isImmutable; + exports.isIndexed = isIndexed; + exports.isKeyed = isKeyed; + exports.isList = isList; + exports.isMap = isMap; + exports.isOrdered = isOrdered; + exports.isOrderedMap = isOrderedMap; + exports.isOrderedSet = isOrderedSet; + exports.isPlainObject = isPlainObject; + exports.isRecord = isRecord; + exports.isSeq = isSeq; + exports.isSet = isSet; + exports.isStack = isStack; + exports.isValueObject = isValueObject; + exports.merge = merge; + exports.mergeDeep = mergeDeep$1; + exports.mergeDeepWith = mergeDeepWith$1; + exports.mergeWith = mergeWith; + exports.remove = remove; + exports.removeIn = removeIn; + exports.set = set; + exports.setIn = setIn$1; + exports.update = update$1; + exports.updateIn = updateIn; + exports.version = version; + +})); diff --git a/tools/ui/node_modules/immutable/dist/immutable.js.flow b/tools/ui/node_modules/immutable/dist/immutable.js.flow new file mode 100644 index 0000000000000000000000000000000000000000..9ab444d234685d373bf636878b091572ce58d6ca --- /dev/null +++ b/tools/ui/node_modules/immutable/dist/immutable.js.flow @@ -0,0 +1,2414 @@ +/** + * This file provides type definitions for use with the Flow type checker. + * + * An important caveat when using these definitions is that the types for + * `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs. + * When referring to those types, you can get the proper definitions by + * importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc. + * For example, + * + * import { Seq } from 'immutable' + * import type { IndexedCollection, IndexedSeq } from 'immutable' + * + * const someSeq: IndexedSeq = Seq.Indexed.of(1, 2, 3) + * + * function takesASeq>(iter: TS): TS { + * return iter.butLast() + * } + * + * takesASeq(someSeq) + * + * @flow strict + */ + +// Helper type that represents plain objects allowed as arguments to +// some constructors and functions. +type PlainObjInput = { +[key: K]: V, __proto__: null }; + +type K = $Keys; + +// Helper types to extract the "keys" and "values" use by the *In() methods. +type $KeyOf = $Call< + ((?_Collection) => K) & + ((?$ReadOnlyArray) => number) & + ((?RecordInstance | T) => $Keys) & + ((T) => $Keys), + C, +>; + +type $ValOf> = $Call< + ((?_Collection) => V) & + ((?$ReadOnlyArray) => T) & + (>(?RecordInstance | T, K) => $ElementType) & + ((T) => $Values), + C, + K, +>; + +type $IterableOf = $Call< + ( | IndexedCollection | SetCollection>( + V + ) => Iterable<$ValOf>) & + (< + V: + | KeyedCollection + | RecordInstance + | PlainObjInput, + >( + V + ) => Iterable<[$KeyOf, $ValOf]>), + C, +>; + +const PairSorting: $ReadOnly<{ LeftThenRight: number, RightThenLeft: number }> = + { + LeftThenRight: -1, + RightThenLeft: +1, + }; + +type Comparator = (left: T, right: T) => number; + +declare class _Collection implements ValueObject { + equals(other: mixed): boolean; + hashCode(): number; + get(key: K, ..._: []): V | void; + get(key: K, notSetValue: NSV): V | NSV; + has(key: K): boolean; + includes(value: V): boolean; + contains(value: V): boolean; + first(): V | void; + first(notSetValue: NSV): V | NSV; + last(): V | void; + last(notSetValue: NSV): V | NSV; + + hasIn(keyPath: Iterable): boolean; + + getIn(keyPath: [], notSetValue?: mixed): this; + getIn(keyPath: [K], notSetValue: NSV): V | NSV; + getIn>( + keyPath: [K, K2], + notSetValue: NSV + ): $ValOf | NSV; + getIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3], + notSetValue: NSV + ): $ValOf<$ValOf, K3> | NSV; + getIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf, K3>, K4> | NSV; + getIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV; + + update(updater: (value: this) => U): U; + + toJS(): Array | { [key: string]: mixed }; + toJSON(): Array | { [key: string]: V }; + toArray(): Array | Array<[K, V]>; + toObject(): { [key: string]: V }; + toMap(): Map; + toOrderedMap(): OrderedMap; + toSet(): Set; + toOrderedSet(): OrderedSet; + toList(): List; + toStack(): Stack; + toSeq(): Seq; + toKeyedSeq(): KeyedSeq; + toIndexedSeq(): IndexedSeq; + toSetSeq(): SetSeq; + + keys(): Iterator; + values(): Iterator; + entries(): Iterator<[K, V]>; + + keySeq(): IndexedSeq; + valueSeq(): IndexedSeq; + entrySeq(): IndexedSeq<[K, V]>; + + reverse(): this; + sort(comparator?: Comparator): this; + + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): this; + + groupBy( + grouper: (value: V, key: K, iter: this) => G, + context?: mixed + ): KeyedSeq; + + forEach( + sideEffect: (value: V, key: K, iter: this) => any, + context?: mixed + ): number; + + slice(begin?: number, end?: number): this; + rest(): this; + butLast(): this; + skip(amount: number): this; + skipLast(amount: number): this; + skipWhile( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + skipUntil( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + take(amount: number): this; + takeLast(amount: number): this; + takeWhile( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + takeUntil( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + + filterNot( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + + reduce( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: mixed + ): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + + reduceRight( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: mixed + ): R; + reduceRight( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + every( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): boolean; + some( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): boolean; + join(separator?: string): string; + isEmpty(): boolean; + count( + predicate?: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): number; + countBy( + grouper: (value: V, key: K, iter: this) => G, + context?: mixed + ): Map; + + find( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed, + notSetValue?: V + ): V | void; + findLast( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed, + notSetValue?: V + ): V | void; + + findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void; + findLastEntry( + predicate: (value: V, key: K, iter: this) => mixed + ): [K, V] | void; + + findKey( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): K | void; + findLastKey( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): K | void; + + keyOf(searchValue: V): K | void; + lastKeyOf(searchValue: V): K | void; + + max(comparator?: Comparator): V; + maxBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V; + min(comparator?: Comparator): V; + minBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V; + + isSubset(iter: Iterable): boolean; + isSuperset(iter: Iterable): boolean; +} + +declare function isImmutable( + maybeImmutable: mixed +): boolean %checks(maybeImmutable instanceof Collection); +declare function isCollection( + maybeCollection: mixed +): boolean %checks(maybeCollection instanceof Collection); +declare function isKeyed( + maybeKeyed: mixed +): boolean %checks(maybeKeyed instanceof KeyedCollection); +declare function isIndexed( + maybeIndexed: mixed +): boolean %checks(maybeIndexed instanceof IndexedCollection); +declare function isAssociative( + maybeAssociative: mixed +): boolean %checks(maybeAssociative instanceof KeyedCollection || + maybeAssociative instanceof IndexedCollection); +declare function isOrdered( + maybeOrdered: mixed +): boolean %checks(maybeOrdered instanceof IndexedCollection || + maybeOrdered instanceof OrderedMap || + maybeOrdered instanceof OrderedSet); +declare function isValueObject(maybeValue: mixed): boolean; + +declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq); +declare function isList(maybeList: any): boolean %checks(maybeList instanceof + List); +declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map); +declare function isOrderedMap( + maybeOrderedMap: any +): boolean %checks(maybeOrderedMap instanceof OrderedMap); +declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof + Stack); +declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set); +declare function isOrderedSet( + maybeOrderedSet: any +): boolean %checks(maybeOrderedSet instanceof OrderedSet); +declare function isRecord( + maybeRecord: any +): boolean %checks(maybeRecord instanceof Record); + +declare interface ValueObject { + equals(other: mixed): boolean; + hashCode(): number; +} + +declare class Collection extends _Collection { + static Keyed: typeof KeyedCollection; + static Indexed: typeof IndexedCollection; + static Set: typeof SetCollection; + + static isCollection: typeof isCollection; + static isKeyed: typeof isKeyed; + static isIndexed: typeof isIndexed; + static isAssociative: typeof isAssociative; + static isOrdered: typeof isOrdered; +} + +declare class KeyedCollection extends Collection { + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): KeyedCollection; + + toJS(): { [key: string]: mixed }; + toJSON(): { [key: string]: V }; + toArray(): Array<[K, V]>; + @@iterator(): Iterator<[K, V]>; + toSeq(): KeyedSeq; + flip(): KeyedCollection; + + concat( + ...iters: Array | PlainObjInput> + ): KeyedCollection; + + filter(predicate: typeof Boolean): KeyedCollection>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): KeyedCollection; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): KeyedCollection; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): KeyedCollection; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): KeyedCollection; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): KeyedCollection; + + flatten(depth?: number): KeyedCollection; + flatten(shallow?: boolean): KeyedCollection; +} + +Collection.Keyed = KeyedCollection; + +declare class IndexedCollection<+T> extends Collection { + static (iter?: Iterable): IndexedCollection; + + toJS(): Array; + toJSON(): Array; + toArray(): Array; + @@iterator(): Iterator; + toSeq(): IndexedSeq; + fromEntrySeq(): KeyedSeq; + interpose(separator: T): this; + interleave(...collections: Iterable[]): this; + splice(index: number, removeNum: number, ...values: T[]): this; + + zip(a: Iterable, ..._: []): IndexedCollection<[T, A]>; + zip( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): IndexedCollection<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection< + [T | void, A | void, B | void, C | void, D | void, E | void], + >; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection; + + indexOf(searchValue: T): number; + lastIndexOf(searchValue: T): number; + findIndex( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): number; + findLastIndex( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): number; + + concat(...iters: Array | C>): IndexedCollection; + + filter(predicate: typeof Boolean): IndexedCollection<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): IndexedCollection; + + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): IndexedCollection; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): IndexedCollection; + + flatten(depth?: number): IndexedCollection; + flatten(shallow?: boolean): IndexedCollection; +} + +declare class SetCollection<+T> extends Collection { + static (iter?: Iterable): SetCollection; + + toJS(): Array; + toJSON(): Array; + toArray(): Array; + @@iterator(): Iterator; + toSeq(): SetSeq; + + concat(...collections: Iterable[]): SetCollection; + + // `filter`, `map` and `flatMap` cannot be defined further up the hierarchy, + // because the implementation for `KeyedCollection` allows the value type to + // change without constraining the key type. That does not work for + // `SetCollection` - the value and key types *must* match. + filter(predicate: typeof Boolean): SetCollection<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): SetCollection; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): SetCollection; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): SetCollection; + + flatten(depth?: number): SetCollection; + flatten(shallow?: boolean): SetCollection; +} + +declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof + Seq); +declare class Seq extends _Collection { + static Keyed: typeof KeyedSeq; + static Indexed: typeof IndexedSeq; + static Set: typeof SetSeq; + + static (values: KeyedSeq): KeyedSeq; + static (values: SetSeq): SetSeq; + static (values: Iterable): IndexedSeq; + static (values?: PlainObjInput): KeyedSeq; + + static isSeq: typeof isSeq; + + size: number | void; + cacheResult(): this; + toSeq(): this; +} + +declare class KeyedSeq extends Seq mixins KeyedCollection { + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): KeyedSeq; + + // Override specialized return types + flip(): KeyedSeq; + + concat( + ...iters: Array | PlainObjInput> + ): KeyedSeq; + + filter(predicate: typeof Boolean): KeyedSeq>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): KeyedSeq; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): KeyedSeq; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): KeyedSeq; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): KeyedSeq; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): KeyedSeq; + + flatten(depth?: number): KeyedSeq; + flatten(shallow?: boolean): KeyedSeq; +} + +declare class IndexedSeq<+T> + extends Seq + mixins IndexedCollection +{ + static (values?: Iterable): IndexedSeq; + + static of(...values: T[]): IndexedSeq; + + // Override specialized return types + + concat(...iters: Array | C>): IndexedSeq; + + filter(predicate: typeof Boolean): IndexedSeq<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): IndexedSeq; + + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): IndexedSeq; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): IndexedSeq; + + flatten(depth?: number): IndexedSeq; + flatten(shallow?: boolean): IndexedSeq; + + zip(a: Iterable, ..._: []): IndexedSeq<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): IndexedSeq<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): IndexedSeq<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq; +} + +declare class SetSeq<+T> extends Seq mixins SetCollection { + static (values?: Iterable): SetSeq; + + static of(...values: T[]): SetSeq; + + // Override specialized return types + + concat(...collections: Iterable[]): SetSeq; + + filter(predicate: typeof Boolean): SetSeq<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): SetSeq; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): SetSeq; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): SetSeq; + + flatten(depth?: number): SetSeq; + flatten(shallow?: boolean): SetSeq; +} + +declare class UpdatableInCollection { + setIn(keyPath: [], value: S): S; + setIn(keyPath: [K], value: V): this; + setIn, S: $ValOf>(keyPath: [K, K2], value: S): this; + setIn, K3: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K3>>( + keyPath: [K, K2, K3], + value: S + ): this; + setIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + value: S + ): this; + setIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + value: S + ): this; + + deleteIn(keyPath: []): void; + deleteIn(keyPath: [K]): this; + deleteIn>(keyPath: [K, K2]): this; + deleteIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3] + ): this; + deleteIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this; + deleteIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this; + + removeIn(keyPath: []): void; + removeIn(keyPath: [K]): this; + removeIn>(keyPath: [K, K2]): this; + removeIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3] + ): this; + removeIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this; + removeIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this; + + updateIn(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U; + updateIn(keyPath: [], updater: (value: this) => U): U; + updateIn(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this; + updateIn(keyPath: [K], updater: (value: V) => V): this; + updateIn, S: $ValOf>( + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf | NSV) => S + ): this; + updateIn, S: $ValOf>( + keyPath: [K, K2], + updater: (value: $ValOf) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K3>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K3> | NSV) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K3>, + >( + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf, K3>) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4> | NSV) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4>) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV + ) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>) => S + ): this; +} + +declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof + List); +declare class List<+T> + extends IndexedCollection + mixins UpdatableInCollection +{ + static (collection?: Iterable): List; + + static of(...values: T[]): List; + + static isList: typeof isList; + + size: number; + + set(index: number, value: U): List; + delete(index: number): this; + remove(index: number): this; + insert(index: number, value: U): List; + clear(): this; + push(...values: U[]): List; + pop(): this; + unshift(...values: U[]): List; + shift(): this; + + update(updater: (value: this) => U): U; + update(index: number, updater: (value: T) => U): List; + update( + index: number, + notSetValue: U, + updater: (value: T) => U + ): List; + + merge(...collections: Iterable[]): List; + + setSize(size: number): this; + + mergeIn(keyPath: Iterable, ...collections: Iterable[]): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: Iterable[] + ): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + concat(...iters: Array | C>): List; + + filter(predicate: typeof Boolean): List<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): List; + + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): List; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): List; + + flatten(depth?: number): List; + flatten(shallow?: boolean): List; + + zip(a: Iterable, ..._: []): List<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): List<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): List<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List; +} + +declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof + Map); +declare class Map + extends KeyedCollection + mixins UpdatableInCollection +{ + static (values?: Iterable<[K, V]> | PlainObjInput): Map; + + static isMap: typeof isMap; + + size: number; + + set(key: K_, value: V_): Map; + delete(key: K): this; + remove(key: K): this; + clear(): this; + + deleteAll(keys: Iterable): Map; + removeAll(keys: Iterable): Map; + + update(updater: (value: this) => U): U; + update(key: K, updater: (value: V) => V_): Map; + update( + key: K, + notSetValue: V_, + updater: (value: V) => V_ + ): Map; + + merge( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + concat( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeWith( + merger: (oldVal: V, newVal: W, key: K) => X, + ...collections: (Iterable<[K_, W]> | PlainObjInput)[] + ): Map; + + mergeDeep( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + flip(): Map; + + filter(predicate: typeof Boolean): Map>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): Map; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): Map; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): Map; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): Map; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): Map; + + flatten(depth?: number): Map; + flatten(shallow?: boolean): Map; +} + +declare function isOrderedMap( + maybeOrderedMap: mixed +): boolean %checks(maybeOrderedMap instanceof OrderedMap); +declare class OrderedMap + extends Map + mixins UpdatableInCollection +{ + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): OrderedMap; + + static isOrderedMap: typeof isOrderedMap; + + size: number; + + set(key: K_, value: V_): OrderedMap; + delete(key: K): this; + remove(key: K): this; + clear(): this; + + update(updater: (value: this) => U): U; + update(key: K, updater: (value: V) => V_): OrderedMap; + update( + key: K, + notSetValue: V_, + updater: (value: V) => V_ + ): OrderedMap; + + merge( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + concat( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeWith( + merger: (oldVal: V, newVal: W, key: K) => X, + ...collections: (Iterable<[K_, W]> | PlainObjInput)[] + ): OrderedMap; + + mergeDeep( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + flip(): OrderedMap; + + filter(predicate: typeof Boolean): OrderedMap>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): OrderedMap; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): OrderedMap; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): OrderedMap; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): OrderedMap; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): OrderedMap; + + flatten(depth?: number): OrderedMap; + flatten(shallow?: boolean): OrderedMap; +} + +declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof + Set); +declare class Set<+T> extends SetCollection { + static (values?: Iterable): Set; + + static of(...values: T[]): Set; + static fromKeys( + values: Iterable<[T, mixed]> | PlainObjInput + ): Set; + + static intersect(sets: Iterable>): Set; + static union(sets: Iterable>): Set; + + static isSet: typeof isSet; + + size: number; + + add(value: U): Set; + delete(value: T): this; + remove(value: T): this; + clear(): this; + union(...collections: Iterable[]): Set; + merge(...collections: Iterable[]): Set; + concat(...collections: Iterable[]): Set; + intersect(...collections: Iterable[]): Set; + subtract(...collections: Iterable[]): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + filter(predicate: typeof Boolean): Set<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): Set; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): Set; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): Set; + + flatten(depth?: number): Set; + flatten(shallow?: boolean): Set; +} + +// Overrides except for `isOrderedSet` are for specialized return types +declare function isOrderedSet( + maybeOrderedSet: mixed +): boolean %checks(maybeOrderedSet instanceof OrderedSet); +declare class OrderedSet<+T> extends Set { + static (values?: Iterable): OrderedSet; + + static of(...values: T[]): OrderedSet; + static fromKeys( + values: Iterable<[T, mixed]> | PlainObjInput + ): OrderedSet; + + static isOrderedSet: typeof isOrderedSet; + + size: number; + + add(value: U): OrderedSet; + union(...collections: Iterable[]): OrderedSet; + merge(...collections: Iterable[]): OrderedSet; + concat(...collections: Iterable[]): OrderedSet; + intersect(...collections: Iterable[]): OrderedSet; + + filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): OrderedSet; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): OrderedSet; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): OrderedSet; + + flatten(depth?: number): OrderedSet; + flatten(shallow?: boolean): OrderedSet; + + zip(a: Iterable, ..._: []): OrderedSet<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): OrderedSet<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): OrderedSet<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet; +} + +declare function isStack( + maybeStack: mixed +): boolean %checks(maybeStack instanceof Stack); +declare class Stack<+T> extends IndexedCollection { + static (collection?: Iterable): Stack; + + static isStack(maybeStack: mixed): boolean; + static of(...values: T[]): Stack; + + static isStack: typeof isStack; + + size: number; + + peek(): T; + clear(): this; + unshift(...values: U[]): Stack; + unshiftAll(iter: Iterable): Stack; + shift(): this; + push(...values: U[]): Stack; + pushAll(iter: Iterable): Stack; + pop(): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + concat(...iters: Array | C>): Stack; + + filter(predicate: typeof Boolean): Stack<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): Stack; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): Stack; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): Stack; + + flatten(depth?: number): Stack; + flatten(shallow?: boolean): Stack; + + zip(a: Iterable, ..._: []): Stack<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): Stack<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): Stack<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack; +} + +declare function Range( + start?: number, + end?: number, + step?: number +): IndexedSeq; +declare function Repeat(value: T, times?: number): IndexedSeq; + +// The type of a Record factory function. +type RecordFactory = Class>; + +// The type of runtime Record instances. +type RecordOf = RecordInstance & $ReadOnly; + +// The values of a Record instance. +type _RecordValues | T> = R; +type RecordValues = _RecordValues<*, R>; + +declare function isRecord( + maybeRecord: any +): boolean %checks(maybeRecord instanceof RecordInstance); +declare class Record { + static (spec: Values, name?: string): typeof RecordInstance; + constructor( + spec: Values, + name?: string + ): typeof RecordInstance; + + static isRecord: typeof isRecord; + + static getDescriptiveName(record: RecordInstance): string; +} + +declare class RecordInstance { + static (values?: Iterable<[$Keys, $ValOf]> | $Shape): RecordOf; + // Note: a constructor can only create an instance of RecordInstance, + // it's encouraged to not use `new` when creating Records. + constructor(values?: Iterable<[$Keys, $ValOf]> | $Shape): void; + + size: number; + + has(key: string): boolean; + + get>(key: K, ..._: []): $ElementType; + get, NSV>(key: K, notSetValue: NSV): $ElementType | NSV; + + hasIn(keyPath: Iterable): boolean; + + getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly; + getIn>(keyPath: [K], notSetValue?: mixed): $ElementType; + getIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2], + notSetValue: NSV + ): $ValOf<$ValOf, K2> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; + + equals(other: any): boolean; + hashCode(): number; + + set>(key: K, value: $ElementType): this & $ReadOnly; + update>( + key: K, + updater: (value: $ElementType) => $ElementType + ): this & $ReadOnly; + merge( + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + mergeDeep( + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + + mergeWith( + merger: (oldVal: $ValOf, newVal: $ValOf, key: $Keys) => $ValOf, + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => any, + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + + delete>(key: K): this & $ReadOnly; + remove>(key: K): this & $ReadOnly; + clear(): this & $ReadOnly; + + setIn(keyPath: [], value: S): S; + setIn, S: $ValOf>( + keyPath: [K], + value: S + ): this & $ReadOnly; + setIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( + keyPath: [K, K2], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + value: S + ): this & $ReadOnly; + + deleteIn(keyPath: []): void; + deleteIn>(keyPath: [K]): this & $ReadOnly; + deleteIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this & $ReadOnly; + + removeIn(keyPath: []): void; + removeIn>(keyPath: [K]): this & $ReadOnly; + removeIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this & $ReadOnly; + + updateIn( + keyPath: [], + notSetValue: mixed, + updater: (value: this & T) => U + ): U; + updateIn(keyPath: [], updater: (value: this & T) => U): U; + updateIn, S: $ValOf>( + keyPath: [K], + notSetValue: NSV, + updater: (value: $ValOf) => S + ): this & $ReadOnly; + updateIn, S: $ValOf>( + keyPath: [K], + updater: (value: $ValOf) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, + >( + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K2> | NSV) => S + ): this & $ReadOnly; + updateIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( + keyPath: [K, K2], + updater: (value: $ValOf<$ValOf, K2>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV + ) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV + ) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> + ) => S + ): this & $ReadOnly; + + mergeIn( + keyPath: Iterable, + ...collections: Array + ): this & $ReadOnly; + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this & $ReadOnly; + + toSeq(): KeyedSeq<$Keys, any>; + + toJS(): { [key: $Keys]: mixed }; + toJSON(): T; + toObject(): T; + + withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly; + asMutable(): this & $ReadOnly; + wasAltered(): boolean; + asImmutable(): this & $ReadOnly; + + @@iterator(): Iterator<[$Keys, $ValOf]>; +} + +declare function fromJS( + jsValue: mixed, + reviver?: ( + key: string | number, + sequence: KeyedCollection | IndexedCollection, + path?: Array + ) => mixed +): Collection; + +declare function is(first: mixed, second: mixed): boolean; +declare function hash(value: mixed): number; + +declare function get>( + collection: C, + key: K, + notSetValue: mixed +): $ValOf; +declare function get, NSV>( + collection: C, + key: K, + notSetValue: NSV +): $ValOf | NSV; + +declare function has(collection: Object, key: mixed): boolean; +declare function remove(collection: C, key: $KeyOf): C; +declare function set, V: $ValOf>( + collection: C, + key: K, + value: V +): C; +declare function update, V: $ValOf, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: ($ValOf | NSV) => V +): C; +declare function update, V: $ValOf>( + collection: C, + key: K, + updater: ($ValOf) => V +): C; + +declare function getIn(collection: C, keyPath: [], notSetValue?: mixed): C; +declare function getIn, NSV>( + collection: C, + keyPath: [K], + notSetValue: NSV +): $ValOf | NSV; +declare function getIn, K2: $KeyOf<$ValOf>, NSV>( + collection: C, + keyPath: [K, K2], + notSetValue: NSV +): $ValOf<$ValOf, K2> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; + +declare function hasIn(collection: Object, keyPath: Iterable): boolean; + +declare function removeIn(collection: C, keyPath: []): void; +declare function removeIn>(collection: C, keyPath: [K]): C; +declare function removeIn, K2: $KeyOf<$ValOf>>( + collection: C, + keyPath: [K, K2] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, +>( + collection: C, + keyPath: [K, K2, K3] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, +>( + collection: C, + keyPath: [K, K2, K3, K4] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5] +): C; + +declare function setIn(collection: Object, keyPath: [], value: S): S; +declare function setIn, S: $ValOf>( + collection: C, + keyPath: [K], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, +>( + collection: C, + keyPath: [K, K2], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, +>( + collection: C, + keyPath: [K, K2, K3], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, +>( + collection: C, + keyPath: [K, K2, K3, K4], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + value: S +): C; + +declare function updateIn( + collection: C, + keyPath: [], + notSetValue: mixed, + updater: (value: C) => S +): S; +declare function updateIn( + collection: C, + keyPath: [], + updater: (value: C) => S +): S; +declare function updateIn, S: $ValOf, NSV>( + collection: C, + keyPath: [K], + notSetValue: NSV, + updater: (value: $ValOf | NSV) => S +): C; +declare function updateIn, S: $ValOf>( + collection: C, + keyPath: [K], + updater: (value: $ValOf) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, + NSV, +>( + collection: C, + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K2> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, +>( + collection: C, + keyPath: [K, K2], + updater: (value: $ValOf<$ValOf, K2>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, +>( + collection: C, + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, +>( + collection: C, + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV + ) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> + ) => S +): C; + +declare function merge( + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeWith( + merger: (oldVal: $ValOf, newVal: $ValOf, key: $KeyOf) => $ValOf, + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeDeep( + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; + +export { + Collection, + Seq, + List, + Map, + OrderedMap, + OrderedSet, + Range, + Repeat, + Record, + Set, + Stack, + fromJS, + is, + hash, + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isRecord, + isValueObject, + get, + has, + remove, + set, + update, + getIn, + hasIn, + removeIn, + setIn, + updateIn, + merge, + mergeWith, + mergeDeep, + mergeDeepWith, +}; + +export default { + Collection, + Seq, + + List, + Map, + OrderedMap, + OrderedSet, + PairSorting, + Range, + Repeat, + Record, + Set, + Stack, + + fromJS, + is, + hash, + + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isRecord, + isValueObject, + + get, + has, + remove, + set, + update, + getIn, + hasIn, + removeIn, + setIn, + updateIn, + merge, + mergeWith, + mergeDeep, + mergeDeepWith, +}; + +export type { + Comparator, + KeyedCollection, + IndexedCollection, + SetCollection, + KeyedSeq, + IndexedSeq, + SetSeq, + RecordFactory, + RecordOf, + RecordInstance, + ValueObject, + $KeyOf, + $ValOf, +}; diff --git a/tools/ui/node_modules/immutable/dist/immutable.min.js b/tools/ui/node_modules/immutable/dist/immutable.min.js new file mode 100644 index 0000000000000000000000000000000000000000..a023d43aa564465891375ca1b1323800a02c4d0e --- /dev/null +++ b/tools/ui/node_modules/immutable/dist/immutable.min.js @@ -0,0 +1,25 @@ +/** + * @license + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,(function(t){"use strict";var e="@@__IMMUTABLE_INDEXED__@@";function r(t){return Boolean(t&&t[e])}var n="@@__IMMUTABLE_KEYED__@@";function i(t){return Boolean(t&&t[n])}function o(t){return i(t)||r(t)}var u="@@__IMMUTABLE_ITERABLE__@@";function s(t){return Boolean(t&&t[u])}var a=function(t){return s(t)?t:Q(t)},c=function(t){function e(t){return i(t)?t:X(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),f=function(t){function e(t){return r(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),h=function(t){function e(t){return s(t)&&!o(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a);a.Keyed=c,a.Indexed=f,a.Set=h;var p=0,_=1,l=2,v="function"==typeof Symbol&&Symbol.iterator,y="@@iterator",d=v||y,g=function(t){this.next=t};function w(t,e,r,n){var i=t===p?e:t===_?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function m(){return{value:void 0,done:!0}}function b(t){return!!Array.isArray(t)||!!I(t)}function z(t){return!(!t||"function"!=typeof t.next)}function S(t){var e=I(t);return e&&e.call(t)}function I(t){var e=t&&(v&&t[v]||t[y]);if("function"==typeof e)return e}g.prototype.toString=function(){return"[Iterator]"},g.KEYS=p,g.VALUES=_,g.ENTRIES=l,g.prototype.inspect=g.prototype.toSource=function(){return this.toString()},g.prototype[d]=function(){return this};var O="delete",E=5,j=1<>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?A(t)+e:e}function R(){return!0}function U(t,e,r){return(0===t&&!L(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function T(t,e){return K(t,e,0)}function B(t,e){return K(t,e,e)}function K(t,e,r){return void 0===t?r:L(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function L(t){return t<0||0===t&&1/t==-1/0}var C="@@__IMMUTABLE_RECORD__@@";function N(t){return Boolean(t&&t[C])}function P(t){return s(t)||N(t)}var W="@@__IMMUTABLE_ORDERED__@@";function H(t){return Boolean(t&&t[W])}var J="@@__IMMUTABLE_SEQ__@@";function V(t){return Boolean(t&&t[J])}var F=Object.prototype.hasOwnProperty;function Y(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var Q=function(t){function e(t){return null==t?nt():P(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=I(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=I(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new g((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return w(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(a),X=function(t){function e(t){return null==t?nt().toKeyedSeq():s(t)?i(t)?t.toSeq():t.fromEntrySeq():N(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(Q),G=function(t){function e(t){return null==t?nt():s(t)?i(t)?t.entrySeq():t.toIndexedSeq():N(t)?t.toSeq().entrySeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(Q),Z=function(t){function e(t){return(s(t)&&!o(t)?t:G(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(Q);Q.isSeq=V,Q.Keyed=X,Q.Set=Z,Q.Indexed=G,Q.prototype[J]=!0;var $=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[k(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,i=0;return new g((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return w(t,o,r[o])}))},e}(G),tt=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return F.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length,o=0;return new g((function(){if(o===i)return{value:void 0,done:!0};var u=n[e?i-++o:o++];return w(t,u,r[u])}))},e}(X);tt.prototype[W]=!0;var et,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=S(this._collection),n=0;if(z(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=S(this._collection);if(!z(r))return new g(m);var n=0;return new g((function(){var e=r.next();return e.done?e:w(t,n++,e.value)}))},e}(G);function nt(){return et||(et=new $([]))}function it(t){var e=ut(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ot(t){var e=ut(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ut(t){return Y(t)?new $(t):b(t)?new rt(t):void 0}function st(){return this.__ensureOwner()}function at(){return this.__ownerID?this:this.__ensureOwner(new D)}var ct="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function ft(t){return t>>>1&1073741824|3221225471&t}var ht=Object.prototype.valueOf;function pt(t){if(null==t)return _t(t);if("function"==typeof t.hashCode)return ft(t.hashCode(t));var e,r=(e=t).valueOf!==ht&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return _t(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return ft(e)}(r);case"string":return r.length>Ot?function(t){var e=Mt[t];void 0===e&&(e=lt(t),jt===Et&&(jt=0,Mt={}),jt++,Mt[t]=e);return e}(r):lt(r);case"object":case"function":return function(t){var e;if(bt&&void 0!==(e=mt.get(t)))return e;if(e=t[It],void 0!==e)return e;if(!gt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[It]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=wt(),bt)mt.set(t,e);else{if(void 0!==dt&&!1===dt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(gt)Object.defineProperty(t,It,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[It]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[It]=e}}return e}(r);case"symbol":return function(t){var e=zt[t];if(void 0!==e)return e;return e=wt(),zt[t]=e,e}(r);default:if("function"==typeof r.toString)return lt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function _t(t){return null===t?1108378658:1108378659}function lt(t){for(var e=0,r=0;r=0&&(a.get=function(e,r){return(e=k(this,e))>=0&&eo)return{value:void 0,done:!0};var t=i.next();return n||e===_||t.done?t:w(e,a-1,e===p?void 0:t.value[1],t)}))},a}function Kt(t,e,r,n){var i=Yt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate((function(t,o,c){if(!s||!(s=e.call(r,t,o,c)))return a++,i(t,n?o:a-1,u)})),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(l,o),a=!0,c=0;return new g((function(){var t,o,f;do{if((t=s.next()).done)return n||i===_?t:w(i,c++,i===p?void 0:t.value[1],t);var h=t.value;o=h[0],f=h[1],a&&(a=e.call(r,f,o,u))}while(a);return i===l?t:w(i,o,f,t)}))},i}xt.prototype.cacheResult=qt.prototype.cacheResult=Dt.prototype.cacheResult=At.prototype.cacheResult=Qt;var Lt=function(t){function r(t){this._wrappedIterables=t.flatMap((function(t){return t._wrappedIterables?t._wrappedIterables:[t]})),this.size=this._wrappedIterables.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),this[n]=this._wrappedIterables[0][n],this[e]=this._wrappedIterables[0][e],this[W]=this._wrappedIterables[0][W]}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.__iterateUncached=function(t,e){if(0!==this._wrappedIterables.length){if(e)return this.cacheResult().__iterate(t,e);for(var r=0,n=i(this),o=n?l:_,u=this._wrappedIterables[r].__iterator(o,e),s=!0,a=0;s;){for(var c=u.next();c.done;){if(++r===this._wrappedIterables.length)return a;c=(u=this._wrappedIterables[r].__iterator(o,e)).next()}s=!1!==(n?t(c.value[1],c.value[0],this):t(c.value,a,this)),a++}return a}},r.prototype.__iteratorUncached=function(t,e){var r=this;if(0===this._wrappedIterables.length)return new g(m);if(e)return this.cacheResult().__iterator(t,e);var n=0,i=this._wrappedIterables[n].__iterator(t,e);return new g((function(){for(var o=i.next();o.done;){if(++n===r._wrappedIterables.length)return o;o=(i=r._wrappedIterables[n].__iterator(t,e)).next()}return o}))},r}(Q);function Ct(t,e,r){var n=Yt(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var u=0,a=!1;return function t(c,f){c.__iterate((function(o,c){return(!e||f0}function Ht(t,e,r,n){var i=Yt(t),o=new $(r).map((function(t){return t.size}));return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(_,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map((function(t){return t=a(t),S(i?t.reverse():t)})),u=0,s=!1;return new g((function(){var r;return s||(r=o.map((function(t){return t.next()})),s=n?r.every((function(t){return t.done})):r.some((function(t){return t.done}))),s?{value:void 0,done:!0}:w(t,u++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Jt(t,e){return t===e?t:V(t)?e:t.constructor(e)}function Vt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ft(t){return i(t)?c:r(t)?f:h}function Yt(t){return Object.create((i(t)?X:r(t)?G:Z).prototype)}function Qt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Q.prototype.cacheResult.call(this)}function Xt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return re(this,e,t)}function re(t,e,r){for(var n=[],i=0;i0;)e[r]=arguments[r+1];return ce(this,e,t)}function _e(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return tr(this,t,Be(),(function(t){return ce(t,e)}))}function le(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return tr(this,t,Be(),(function(t){return fe(t,e)}))}function ve(t,e,r){return tr(t,e,q,(function(){return r}))}function ye(t,e){return ve(this,t,e)}function de(t,e,r){return 1===arguments.length?t(this):$t(this,t,e,r)}function ge(t,e,r){return tr(this,t,e,r)}function we(){return this.__altered}function me(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}var be="@@__IMMUTABLE_MAP__@@";function ze(t){return Boolean(t&&t[be])}function Se(t,e){if(!t)throw new Error(e)}function Ie(t){Se(t!==1/0,"Cannot perform this action with an infinite size.")}var Oe=function(t){function e(e){return null==e?Be():ze(e)&&!H(e)?e:Be().withMutations((function(r){var n=t(e);Ie(n.size),n.forEach((function(t,e){return r.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Ke(this,t,e)},e.prototype.remove=function(t){return Ke(this,t,q)},e.prototype.deleteAll=function(t){var e=a(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Be()},e.prototype.sort=function(t){return zr(Nt(this,t))},e.prototype.sortBy=function(t,e){return zr(Nt(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,t.call(e,i,o,r))}))}))},e.prototype.__iterator=function(t,e){return new ke(this,t,e)},e.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate((function(e){return n++,t(e[1],e[0],r)}),e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Te(this.size,this._root,t,this.__hash):0===this.size?Be():(this.__ownerID=t,this.__altered=!1,this)},e}(c);Oe.isMap=ze;var Ee=Oe.prototype;Ee[be]=!0,Ee[O]=Ee.remove,Ee.removeAll=Ee.deleteAll,Ee.setIn=ye,Ee.removeIn=Ee.deleteIn=nr,Ee.update=de,Ee.updateIn=ge,Ee.merge=Ee.concat=te,Ee.mergeWith=ee,Ee.mergeDeep=he,Ee.mergeDeepWith=pe,Ee.mergeIn=le,Ee.mergeDeepIn=_e,Ee.withMutations=me,Ee.wasAltered=we,Ee.asImmutable=st,Ee["@@transducer/init"]=Ee.asMutable=at,Ee["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ee["@@transducer/result"]=function(t){return t.asImmutable()};var je=function(t,e){this.ownerID=t,this.entries=e};je.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o=He)return function(t,e,r,n){t||(t=new D);for(var i=new De(t,pt(r),[r,n]),o=0;o>>t)&M),o=this.bitmap;return 0==(o&i)?n:this.nodes[Pe(o&i-1)].get(t+E,e,r,n)},Me.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&M,a=1<=Je)return function(t,e,r,n,i){for(var o=0,u=new Array(j),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new qe(t,o+1,u)}(t,p,c,s,l);if(f&&!l&&2===p.length&&Ce(p[1^h]))return p[1^h];if(f&&l&&1===p.length&&Ce(l))return l;var v=t&&t===this.ownerID,y=f?l?c:c^a:c|a,d=f?l?We(p,h,l,v):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;u>>t)&M,o=this.nodes[i];return o?o.get(t+E,e,r,n):n},qe.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&M,a=i===q,c=this.nodes,f=c[s];if(a&&!f)return this;var h=Le(f,t,e+E,r,n,i,o,u);if(h===f)return this;var p=this.count;if(f){if(!h&&--p=Fe&&(n=this._buildIndex()),void 0!==n){var i=n[yt(t)];if(void 0!==i)for(var o=0;o>>r)&M,s=(0===r?n:n>>>r)&M,a=u===s?[Ne(t,e,r+E,n,i)]:(o=new De(e,n,i),u>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function We(t,e,r,n){var i=n?t:se(t);return i[e]=r,i}var He=j/4,Je=j/2,Ve=j/4,Fe=16;function Ye(t){if(Y(t)&&"string"!=typeof t)return t;if(H(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}function Qe(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function Xe(t,e){return P(t)?t.has(e):oe(t)&&F.call(t,e)}function Ge(t,e,r){return P(t)?t.get(e,r):Xe(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function Ze(t,e){if(!oe(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(P(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!F.call(t,e))return t;var r=ae(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function $e(t,e,r){if(ue(e))return t;if(!oe(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(P(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(F.call(t,e)&&r===t[e])return t;var n=ae(t);return n[e]=r,n}function tr(t,e,r,n){n||(n=r,r=void 0);var i=er(P(t),t,Ye(e),0,r,n);return i===q?r:i}function er(t,e,r,n,i,o){var u=e===q;if(n===r.length){var s=u?i:e,a=o(s);return a===s?e:a}if(!u&&!oe(e))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Qe)+"]: "+e);var c=r[n],f=u?q:Ge(e,c,q),h=er(f===q?t:P(f),f,r,n+1,i,o);return h===f?e:h===q?Ze(e,c):$e(u?t?Be():{}:e,c,h)}function rr(t,e){return tr(t,e,(function(){return q}))}function nr(t){return rr(this,t)}var ir="@@__IMMUTABLE_LIST__@@";function or(t){return Boolean(t&&t[ir])}var ur=function(t){function e(e){var r=pr();if(null==e)return r;if(or(e))return e;var n=t(e),i=n.size;return 0===i?r:(Ie(i),i>0&&i=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?yr(t,e).set(0,r):yr(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=dr(t._capacity)?n=_r(n,t.__ownerID,0,e,r,o):i=_r(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return hr(t._origin,t._capacity,t._level,i,n)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=E,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):pr()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){yr(r,0,e+t.length);for(var n=0;n>>e&M;if(n>=this.array.length)return new ar([],t);var i,o=0===n;if(e>0){var u=this.array[n];if((i=u&&u.removeBefore(t,e-E,r))===u&&o)return this}if(o&&!i)return this;var s=lr(this,t);if(!o)for(var a=0;a>>e&M;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((n=o&&o.removeAfter(t,e-E,r))===o&&i===this.array.length-1)return this}var u=lr(this,t);return u.array.splice(i+1),n&&(u.array[i]=n),u};var cr={};function fr(t,e){var r=t._origin,n=t._capacity,i=dr(n),o=t._tail;return u(t._root,t._level,0);function u(t,s,a){return 0===s?function(t,u){var s=u===i?o&&o.array:t&&t.array,a=u>r?0:r-u,c=n-u;c>j&&(c=j);return function(){if(a===c)return cr;var t=e?--c:a++;return s&&s[t]}}(t,a):function(t,i,o){var s,a=t&&t.array,c=o>r?0:r-o>>i,f=1+(n-o>>i);f>j&&(f=j);return function(){for(;;){if(s){var t=s();if(t!==cr)return t;s=null}if(c===f)return cr;var r=e?--f:c++;s=u(a&&a[r],i-E,o+(r<>>r&M,a=t&&s0){var c=t&&t.array[s],f=_r(c,e,r-E,n,i,o);return f===c?t:((u=lr(t,e)).array[s]=f,u)}return a&&t.array[s]===i?t:(o&&x(o),u=lr(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function lr(t,e){return e&&t&&e===t.ownerID?t:new ar(t?t.array.slice():[],e)}function vr(t,e){if(e>=dr(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&M],n-=E;return r}}function yr(t,e,r){!function(t,e,r){var n=t._origin+(void 0===e?0:e),i=void 0===r?t._capacity:r<0?t._capacity+r:t._origin+r;if(Number.isFinite(i)&&i>gr||Number.isFinite(n)&&n<-gr||Number.isFinite(i)&&Number.isFinite(n)&&i-n>gr)throw new RangeError("Invalid List size: a List cannot hold more than "+gr+" (2 ** 30) values.")}(t,e,r),void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new D,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:r<0?o+r:i+r;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new ar(c&&c.array.length?[void 0,c]:[],n),f+=wr(a+=E);f&&(u+=f,i+=f,s+=f,o+=f);for(var h=dr(o),p=dr(s);p>=wr(a+E);)c=new ar(c&&c.array.length?[c]:[],n),a+=E;var _=t._tail,l=ph?new ar([],n):_;if(_&&p>h&&uE;y-=E){var d=h>>>y&M;v=v.array[d]=lr(v.array[d],n)}v.array[h>>>E&M]=_}if(s=p)u-=p,s-=p,a=E,c=void 0,l=l&&l.removeBefore(n,0,u);else if(u>i||p>>a&M;if(g!==p>>>a&M)break;g&&(f+=(1<i&&(c=c.removeBefore(n,a,u-f)),c&&p>>E<=j&&u.size>=2*o.size?(n=(i=u.filter((function(t,e){return void 0!==t&&s!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):Sr(n,i)}zr.isOrderedMap=mr,zr.prototype[W]=!0,zr.prototype[O]=zr.prototype.remove;var Er="@@__IMMUTABLE_STACK__@@";function jr(t){return Boolean(t&&t[Er])}var Mr=function(t){function e(t){return null==t?Ar():jr(t)?t:Ar().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=k(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Dr(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&jr(e))return e;Ie(e.size);var r=this.size,n=this._head;return e.__iterate((function(t){r++,n={value:t,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Dr(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Ar()},e.prototype.slice=function(e,r){if(U(e,r,this.size))return this;var n=T(e,this.size);if(B(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Dr(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Dr(this.size,this._head,t,this.__hash):0===this.size?Ar():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new $(this.toArray()).__iterate((function(e,n){return t(e,n,r)}),e);for(var n=0,i=this._head;i&&!1!==t(i.value,n++,this);)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new $(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new g((function(){if(n){var e=n.value;return n=n.next,w(t,r++,e)}return{value:void 0,done:!0}}))},e}(f);Mr.isStack=jr;var qr,xr=Mr.prototype;function Dr(t,e,r,n){var i=Object.create(xr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Ar(){return qr||(qr=Dr(0))}function kr(t,e,r,n,i,o){return Ie(t.size),t.__iterate((function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)}),o),r}function Rr(t,e){return e}function Ur(t,e){return[e,t]}function Tr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return!t.apply(this,e)}}function Br(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return-t.apply(this,e)}}function Kr(t,e){return te?-1:0}function Lr(t,e){if(t===e)return!0;if(!s(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||i(t)!==i(e)||r(t)!==r(e)||H(t)!==H(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!o(t);if(H(t)){var u=t.entries();return e.every((function(t,e){var r=u.next().value;return r&&Zt(r[1],t)&&(n||Zt(r[0],e))}))&&u.next().done}var a=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{a=!0;var c=t;t=e,e=c}var f=!0,h=e.__iterate((function(e,r){if(n?!t.has(e):a?!Zt(e,t.get(r,q)):!Zt(t.get(r,q),e))return f=!1,!1}));return f&&t.size===h}xr[Er]=!0,xr.shift=xr.pop,xr.unshift=xr.push,xr.unshiftAll=xr.pushAll,xr.withMutations=me,xr.wasAltered=we,xr.asImmutable=st,xr["@@transducer/init"]=xr.asMutable=at,xr["@@transducer/step"]=function(t,e){return t.unshift(e)},xr["@@transducer/result"]=function(t){return t.asImmutable()};var Cr,Nr=function(t){function e(t,r,n){if(void 0===n&&(n=1),!(this instanceof e))return new e(t,r,n);if(Se(0!==n,"Cannot step a Range by 0"),Se(void 0!==t,"You must define a start value when using Range"),Se(void 0!==r,"You must define an end value when using Range"),n=Math.abs(n),r=0&&e=0&&r>>-15,461845907),e=ct(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=ct(e^e>>>16,2246822507),e=ct(e^e>>>13,3266489909),e=ft(e^e>>>16),e}(t.size,n)}function rn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function nn(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}Vr[Pr]=!0,Vr[O]=Vr.remove,Vr.merge=Vr.concat=Vr.union,Vr.withMutations=me,Vr.asImmutable=st,Vr["@@transducer/init"]=Vr.asMutable=at,Vr["@@transducer/step"]=function(t,e){return t.add(e)},Vr["@@transducer/result"]=function(t){return t.asImmutable()},Vr.__empty=Qr,Vr.__make=Yr,a.Iterator=g,nn(a,{toArray:function(){Ie(this.size);var t=new Array(this.size||0),e=i(this),r=0;return this.__iterate((function(n,i){t[r++]=e?[i,n]:n})),t},toIndexedSeq:function(){return new xt(this)},toJS:function(){return tn(this)},toKeyedSeq:function(){return new qt(this,!0)},toMap:function(){return Oe(this.toKeyedSeq())},toObject:$r,toOrderedMap:function(){return zr(this.toKeyedSeq())},toOrderedSet:function(){return hn(i(this)?this.valueSeq():this)},toSet:function(){return Hr(i(this)?this.valueSeq():this)},toSetSeq:function(){return new Dt(this)},toSeq:function(){return r(this)?this.toIndexedSeq():i(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Mr(i(this)?this.valueSeq():this)},toList:function(){return ur(i(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Jt(this,function(t,e){var n=i(t),o=[t].concat(e).map((function(t){return s(t)?n&&(t=c(t)):t=n?it(t):ot(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===o.length)return t;if(1===o.length){var u=o[0];if(u===t||n&&i(u)||r(t)&&r(u))return u}return new Lt(o)}(this,t))},includes:function(t){return this.some((function(e){return Zt(e,t)}))},entries:function(){return this.__iterator(l)},every:function(t,e){Ie(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!t.call(e,n,i,o))return r=!1,!1})),r},filter:function(t,e){return Jt(this,Tt(this,t,e,!0))},partition:function(t,e){return function(t,e,r){var n=i(t),o=[[],[]];t.__iterate((function(i,u){o[e.call(r,i,u,t)?1:0].push(n?[u,i]:i)}));var u=Ft(t);return o.map((function(e){return Jt(t,u(e))}))}(this,t,e)},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return Ie(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Ie(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate((function(n){r?r=!1:e+=t,e+=null!=n?n.toString():""})),e},keys:function(){return this.__iterator(p)},map:function(t,e){return Jt(this,Rt(this,t,e))},reduce:function(t,e,r){return kr(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return kr(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Jt(this,Ut(this,!0))},slice:function(t,e){return Jt(this,Bt(this,t,e,!0))},some:function(t,e){Ie(this.size);var r=!1;return this.__iterate((function(n,i,o){if(t.call(e,n,i,o))return r=!0,!1})),r},sort:function(t){return Jt(this,Nt(this,t))},values:function(){return this.__iterator(_)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return A(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,r){var n=Oe().asMutable();return t.__iterate((function(i,o){n.update(e.call(r,i,o,t),0,(function(t){return t+1}))})),n.asImmutable()}(this,t,e)},equals:function(t){return Lr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new $(t._cache);var e=t.toSeq().map(Ur).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Tr(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate((function(r,i,o){if(t.call(e,r,i,o))return n=[i,r],!1})),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(R,null,t)},flatMap:function(t,e){return Jt(this,function(t,e,r){var n=Ft(t);return t.toSeq().map((function(i,o){return n(e.call(r,i,o,t))})).flatten(!0)}(this,t,e))},flatten:function(t){return Jt(this,Ct(this,t,!0))},fromEntrySeq:function(){return new At(this)},get:function(t,e){return this.find((function(e,r){return Zt(r,t)}),void 0,e)},getIn:Gr,groupBy:function(t,e){return function(t,e,r){var n=i(t),o=(H(t)?zr():Oe()).asMutable();t.__iterate((function(i,u){o.update(e.call(r,i,u,t),(function(t){return(t=t||[]).push(n?[u,i]:i),t}))}));var u=Ft(t);return o.map((function(e){return Jt(t,u(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,q)!==q},hasIn:function(t){return Zr(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:a(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:a(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return Zt(e,t)}))},keySeq:function(){return this.toSeq().map(Rr).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Pt(this,t)},maxBy:function(t,e){return Pt(this,e,t)},min:function(t){return Pt(this,t?Br(t):Kr)},minBy:function(t,e){return Pt(this,e?Br(e):Kr,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Jt(this,Kt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Tr(t),e)},sortBy:function(t,e){return Jt(this,Nt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Jt(this,function(t,e,r){var n=Yt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate((function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)})),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(l,i),s=!0;return new g((function(){if(!s)return{value:void 0,done:!0};var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===l?t:w(n,a,c,t):(s=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Tr(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=en(this))}});var on=a.prototype;on[u]=!0,on[d]=on.values,on.toJSON=on.toArray,on.__toStringMapper=Qe,on.inspect=on.toSource=function(){return this.toString()},on.chain=on.flatMap,on.contains=on.includes,nn(c,{flip:function(){return Jt(this,kt(this))},mapEntries:function(t,e){var r=this,n=0;return Jt(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Jt(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var un=c.prototype;un[n]=!0,un[d]=on.entries,un.toJSON=$r,un.__toStringMapper=function(t,e){return Qe(e)+": "+Qe(t)},nn(f,{toKeyedSeq:function(){return new qt(this,!1)},filter:function(t,e){return Jt(this,Tt(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Jt(this,Ut(this,!1))},slice:function(t,e){return Jt(this,Bt(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=T(t,t<0?this.count():this.size);var n=this.slice(0,t);return Jt(this,1===r?n:n.concat(se(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Jt(this,Ct(this,t,!1))},get:function(t,e){return(t=k(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=k(this,t))>=0&&(void 0!==this.size?this.size===1/0||t2?[]:void 0,{"":t})},t.get=Ge,t.getIn=Xr,t.has=Xe,t.hasIn=Zr,t.hash=pt,t.is=Zt,t.isAssociative=o,t.isCollection=s,t.isImmutable=P,t.isIndexed=r,t.isKeyed=i,t.isList=or,t.isMap=ze,t.isOrdered=H,t.isOrderedMap=mr,t.isOrderedSet=fn,t.isPlainObject=ie,t.isRecord=N,t.isSeq=V,t.isSet=Wr,t.isStack=jr,t.isValueObject=Gt,t.merge=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(t,e)},t.mergeDeep=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return ce(t,e)},t.mergeDeepWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ce(e,r,t)},t.mergeWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return fe(e,r,t)},t.remove=Ze,t.removeIn=rr,t.set=$e,t.setIn=ve,t.update=$t,t.updateIn=tr,t.version="5.1.9"})); diff --git a/tools/ui/node_modules/immutable/package.json b/tools/ui/node_modules/immutable/package.json new file mode 100644 index 0000000000000000000000000000000000000000..44d6445627b662f1578464d42625d526af63558b --- /dev/null +++ b/tools/ui/node_modules/immutable/package.json @@ -0,0 +1,38 @@ +{ + "name": "immutable", + "version": "5.1.9", + "description": "Immutable Data Collections", + "license": "MIT", + "homepage": "https://immutable-js.com", + "author": { + "name": "Lee Byron", + "url": "https://github.com/leebyron" + }, + "repository": { + "type": "git", + "url": "git://github.com/immutable-js/immutable-js.git" + }, + "bugs": { + "url": "https://github.com/immutable-js/immutable-js/issues" + }, + "main": "dist/immutable.js", + "module": "dist/immutable.es.js", + "types": "dist/immutable.d.ts", + "files": [ + "dist", + "README.md", + "LICENSE" + ], + "keywords": [ + "immutable", + "persistent", + "lazy", + "data", + "datastructure", + "functional", + "collection", + "stateless", + "sequence", + "iteration" + ] +} \ No newline at end of file diff --git a/tools/ui/node_modules/import-fresh/index.d.ts b/tools/ui/node_modules/import-fresh/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..36d7e208bceaee9df97c360d14c7f42ca61c802e --- /dev/null +++ b/tools/ui/node_modules/import-fresh/index.d.ts @@ -0,0 +1,30 @@ +/** +Import a module while bypassing the cache. + +@example +``` +// foo.js +let i = 0; +module.exports = () => ++i; + +// index.js +import importFresh = require('import-fresh'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +importFresh('./foo')(); +//=> 1 + +importFresh('./foo')(); +//=> 1 + +const foo = importFresh('./foo'); +``` +*/ +declare function importFresh(moduleId: string): T; + +export = importFresh; diff --git a/tools/ui/node_modules/import-fresh/index.js b/tools/ui/node_modules/import-fresh/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1bed87651a1cc651c06e5ef2566c8753c6a1a7fa --- /dev/null +++ b/tools/ui/node_modules/import-fresh/index.js @@ -0,0 +1,34 @@ +'use strict'; +const path = require('path'); +const resolveFrom = require('resolve-from'); +const parentModule = require('parent-module'); + +module.exports = moduleId => { + if (typeof moduleId !== 'string') { + throw new TypeError('Expected a string'); + } + + const parentPath = parentModule(__filename); + + const cwd = parentPath ? path.dirname(parentPath) : __dirname; + const filePath = resolveFrom(cwd, moduleId); + + const oldModule = require.cache[filePath]; + // Delete itself from module parent + if (oldModule && oldModule.parent) { + let i = oldModule.parent.children.length; + + while (i--) { + if (oldModule.parent.children[i].id === filePath) { + oldModule.parent.children.splice(i, 1); + } + } + } + + delete require.cache[filePath]; // Delete module from cache + + const parent = require.cache[parentPath]; // If `filePath` and `parentPath` are the same, cache will already be deleted so we won't get a memory leak in next step + + // In case cache doesn't have parent, fall back to normal require + return parent === undefined || parent.require === undefined ? require(filePath) : parent.require(filePath); +}; diff --git a/tools/ui/node_modules/import-fresh/license b/tools/ui/node_modules/import-fresh/license new file mode 100644 index 0000000000000000000000000000000000000000..fa7ceba3eb4a9657a9db7f3ffca4e4e97a9019de --- /dev/null +++ b/tools/ui/node_modules/import-fresh/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/import-fresh/package.json b/tools/ui/node_modules/import-fresh/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4e8b841669e6aae5c62bae262e2a75f7113e6bda --- /dev/null +++ b/tools/ui/node_modules/import-fresh/package.json @@ -0,0 +1,48 @@ +{ + "name": "import-fresh", + "version": "3.3.1", + "description": "Import a module while bypassing the cache", + "license": "MIT", + "repository": "sindresorhus/import-fresh", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "sideEffects": false, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd", + "heapdump": "node heapdump.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "require", + "cache", + "uncache", + "uncached", + "module", + "fresh", + "bypass" + ], + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.0.1", + "heapdump": "^0.3.12", + "tsd": "^0.7.3", + "xo": "^0.23.0" + } +} diff --git a/tools/ui/node_modules/import-fresh/readme.md b/tools/ui/node_modules/import-fresh/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..a868bc627b67f8e07cadbb89edd8c1b711195029 --- /dev/null +++ b/tools/ui/node_modules/import-fresh/readme.md @@ -0,0 +1,54 @@ +# import-fresh + +> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching) + +Useful for testing purposes when you need to freshly import a module. + +## ESM + +For ESM, you can use this snippet: + +```js +const importFresh = moduleName => import(`${moduleName}?${Date.now()}`); + +const {default: foo} = await importFresh('foo'); +``` + +**This snippet causes a memory leak, so only use it for short-lived tests.** + +## Install + +```sh +npm install import-fresh +``` + +## Usage + +```js +// foo.js +let i = 0; +module.exports = () => ++i; +``` + +```js +const importFresh = require('import-fresh'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +importFresh('./foo')(); +//=> 1 + +importFresh('./foo')(); +//=> 1 +``` + +## Related + +- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily diff --git a/tools/ui/node_modules/import-meta-resolve/index.d.ts b/tools/ui/node_modules/import-meta-resolve/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5617b42cfb87c289bd20f9100051ed7bffc5c4cc --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/index.d.ts @@ -0,0 +1,19 @@ +/** + * Match `import.meta.resolve` except that `parent` is required (you can pass + * `import.meta.url`). + * + * @param {string} specifier + * The module specifier to resolve relative to parent + * (`/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, + * etc). + * @param {string} parent + * The absolute parent module URL to resolve from. + * You must pass `import.meta.url` or something else. + * @returns {string} + * Returns a string to a full `file:`, `data:`, or `node:` URL + * to the found thing. + */ +export function resolve(specifier: string, parent: string): string; +export { moduleResolve } from "./lib/resolve.js"; +export type ErrnoException = import("./lib/errors.js").ErrnoException; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/index.d.ts.map b/tools/ui/node_modules/import-meta-resolve/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ce1a49002559fed10ae9d5da0297e591e9f8b7d1 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;GAcG;AACH,mCAXW,MAAM,UAIN,MAAM,GAGJ,MAAM,CA2BlB;;6BA7CY,OAAO,iBAAiB,EAAE,cAAc"} \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/index.js b/tools/ui/node_modules/import-meta-resolve/index.js new file mode 100644 index 0000000000000000000000000000000000000000..afec4eb000d09d09dd15fa411c017ce212cb74c8 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/index.js @@ -0,0 +1,47 @@ +/** + * @typedef {import('./lib/errors.js').ErrnoException} ErrnoException + */ + +import {defaultResolve} from './lib/resolve.js' + +export {moduleResolve} from './lib/resolve.js' + +/** + * Match `import.meta.resolve` except that `parent` is required (you can pass + * `import.meta.url`). + * + * @param {string} specifier + * The module specifier to resolve relative to parent + * (`/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, + * etc). + * @param {string} parent + * The absolute parent module URL to resolve from. + * You must pass `import.meta.url` or something else. + * @returns {string} + * Returns a string to a full `file:`, `data:`, or `node:` URL + * to the found thing. + */ +export function resolve(specifier, parent) { + if (!parent) { + throw new Error( + 'Please pass `parent`: `import-meta-resolve` cannot ponyfill that' + ) + } + + try { + return defaultResolve(specifier, {parentURL: parent}).url + } catch (error) { + // See: + const exception = /** @type {ErrnoException} */ (error) + + if ( + (exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' || + exception.code === 'ERR_MODULE_NOT_FOUND') && + typeof exception.url === 'string' + ) { + return exception.url + } + + throw error + } +} diff --git a/tools/ui/node_modules/import-meta-resolve/lib/errors.d.ts b/tools/ui/node_modules/import-meta-resolve/lib/errors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2947dfb623727cbf74fe5ee6bd1960e30b8c1108 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/errors.d.ts @@ -0,0 +1,24 @@ +export namespace codes { + let ERR_INVALID_ARG_TYPE: new (...parameters: Array) => Error; + let ERR_INVALID_MODULE_SPECIFIER: new (...parameters: Array) => Error; + let ERR_INVALID_PACKAGE_CONFIG: new (...parameters: Array) => Error; + let ERR_INVALID_PACKAGE_TARGET: new (...parameters: Array) => Error; + let ERR_MODULE_NOT_FOUND: new (...parameters: Array) => Error; + let ERR_NETWORK_IMPORT_DISALLOWED: new (...parameters: Array) => Error; + let ERR_PACKAGE_IMPORT_NOT_DEFINED: new (...parameters: Array) => Error; + let ERR_PACKAGE_PATH_NOT_EXPORTED: new (...parameters: Array) => Error; + let ERR_UNSUPPORTED_DIR_IMPORT: new (...parameters: Array) => Error; + let ERR_UNSUPPORTED_RESOLVE_REQUEST: new (...parameters: Array) => Error; + let ERR_UNKNOWN_FILE_EXTENSION: new (...parameters: Array) => Error; + let ERR_INVALID_ARG_VALUE: new (...parameters: Array) => Error; +} +export type ErrnoExceptionFields = { + errnode?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + url?: string | undefined; +}; +export type ErrnoException = Error & ErrnoExceptionFields; +export type MessageFunction = (...parameters: Array) => string; +//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/errors.d.ts.map b/tools/ui/node_modules/import-meta-resolve/lib/errors.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..b6afb835cb9e39ec85a475a17ca4f73bf74916dd --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["errors.js"],"names":[],"mappings":";kDAwUiC,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;0DAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;wDAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;wDAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;kDAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;2DAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;4DAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;2DAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;wDAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;6DAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;wDAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;mDAApB,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK;;;cAtUvC,MAAM,GAAG,SAAS;WAClB,MAAM,GAAG,SAAS;WAClB,MAAM,GAAG,SAAS;cAClB,MAAM,GAAG,SAAS;UAClB,MAAM,GAAG,SAAS;;6BAEnB,KAAK,GAAG,oBAAoB;8BAI5B,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM"} \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/errors.js b/tools/ui/node_modules/import-meta-resolve/lib/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..58d03837a964a99f86c1cd08a1a223febbde03d3 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/errors.js @@ -0,0 +1,504 @@ +/** + * @typedef ErrnoExceptionFields + * @property {number | undefined} [errnode] + * @property {string | undefined} [code] + * @property {string | undefined} [path] + * @property {string | undefined} [syscall] + * @property {string | undefined} [url] + * + * @typedef {Error & ErrnoExceptionFields} ErrnoException + */ + +/** + * @typedef {(...parameters: Array) => string} MessageFunction + */ + +// Manually “tree shaken” from: +// +// Last checked on: Apr 29, 2024. +import v8 from 'node:v8' +import assert from 'node:assert' +import {format, inspect} from 'node:util' + +const own = {}.hasOwnProperty + +const classRegExp = /^([A-Z][a-z\d]*)+$/ +// Sorted by a rough estimate on most frequently used entries. +const kTypes = new Set([ + 'string', + 'function', + 'number', + 'object', + // Accept 'Function' and 'Object' as alternative to the lower cased version. + 'Function', + 'Object', + 'boolean', + 'bigint', + 'symbol' +]) + +export const codes = {} + +/** + * Create a list string in the form like 'A and B' or 'A, B, ..., and Z'. + * We cannot use Intl.ListFormat because it's not available in + * --without-intl builds. + * + * @param {Array} array + * An array of strings. + * @param {string} [type] + * The list type to be inserted before the last element. + * @returns {string} + */ +function formatList(array, type = 'and') { + return array.length < 3 + ? array.join(` ${type} `) + : `${array.slice(0, -1).join(', ')}, ${type} ${array[array.length - 1]}` +} + +/** @type {Map} */ +const messages = new Map() +const nodeInternalPrefix = '__node_internal_' +/** @type {number} */ +let userStackTraceLimit + +codes.ERR_INVALID_ARG_TYPE = createError( + 'ERR_INVALID_ARG_TYPE', + /** + * @param {string} name + * @param {Array | string} expected + * @param {unknown} actual + */ + (name, expected, actual) => { + assert.ok(typeof name === 'string', "'name' must be a string") + if (!Array.isArray(expected)) { + expected = [expected] + } + + let message = 'The ' + if (name.endsWith(' argument')) { + // For cases like 'first argument' + message += `${name} ` + } else { + const type = name.includes('.') ? 'property' : 'argument' + message += `"${name}" ${type} ` + } + + message += 'must be ' + + /** @type {Array} */ + const types = [] + /** @type {Array} */ + const instances = [] + /** @type {Array} */ + const other = [] + + for (const value of expected) { + assert.ok( + typeof value === 'string', + 'All expected entries have to be of type string' + ) + + if (kTypes.has(value)) { + types.push(value.toLowerCase()) + } else if (classRegExp.exec(value) === null) { + assert.ok( + value !== 'object', + 'The value "object" should be written as "Object"' + ) + other.push(value) + } else { + instances.push(value) + } + } + + // Special handle `object` in case other instances are allowed to outline + // the differences between each other. + if (instances.length > 0) { + const pos = types.indexOf('object') + if (pos !== -1) { + types.slice(pos, 1) + instances.push('Object') + } + } + + if (types.length > 0) { + message += `${types.length > 1 ? 'one of type' : 'of type'} ${formatList( + types, + 'or' + )}` + if (instances.length > 0 || other.length > 0) message += ' or ' + } + + if (instances.length > 0) { + message += `an instance of ${formatList(instances, 'or')}` + if (other.length > 0) message += ' or ' + } + + if (other.length > 0) { + if (other.length > 1) { + message += `one of ${formatList(other, 'or')}` + } else { + if (other[0].toLowerCase() !== other[0]) message += 'an ' + message += `${other[0]}` + } + } + + message += `. Received ${determineSpecificType(actual)}` + + return message + }, + TypeError +) + +codes.ERR_INVALID_MODULE_SPECIFIER = createError( + 'ERR_INVALID_MODULE_SPECIFIER', + /** + * @param {string} request + * @param {string} reason + * @param {string} [base] + */ + (request, reason, base = undefined) => { + return `Invalid module "${request}" ${reason}${ + base ? ` imported from ${base}` : '' + }` + }, + TypeError +) + +codes.ERR_INVALID_PACKAGE_CONFIG = createError( + 'ERR_INVALID_PACKAGE_CONFIG', + /** + * @param {string} path + * @param {string} [base] + * @param {string} [message] + */ + (path, base, message) => { + return `Invalid package config ${path}${ + base ? ` while importing ${base}` : '' + }${message ? `. ${message}` : ''}` + }, + Error +) + +codes.ERR_INVALID_PACKAGE_TARGET = createError( + 'ERR_INVALID_PACKAGE_TARGET', + /** + * @param {string} packagePath + * @param {string} key + * @param {unknown} target + * @param {boolean} [isImport=false] + * @param {string} [base] + */ + (packagePath, key, target, isImport = false, base = undefined) => { + const relatedError = + typeof target === 'string' && + !isImport && + target.length > 0 && + !target.startsWith('./') + if (key === '.') { + assert.ok(isImport === false) + return ( + `Invalid "exports" main target ${JSON.stringify(target)} defined ` + + `in the package config ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }${relatedError ? '; targets must start with "./"' : ''}` + ) + } + + return `Invalid "${ + isImport ? 'imports' : 'exports' + }" target ${JSON.stringify( + target + )} defined for '${key}' in the package config ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }${relatedError ? '; targets must start with "./"' : ''}` + }, + Error +) + +codes.ERR_MODULE_NOT_FOUND = createError( + 'ERR_MODULE_NOT_FOUND', + /** + * @param {string} path + * @param {string} base + * @param {boolean} [exactUrl] + */ + (path, base, exactUrl = false) => { + return `Cannot find ${ + exactUrl ? 'module' : 'package' + } '${path}' imported from ${base}` + }, + Error +) + +codes.ERR_NETWORK_IMPORT_DISALLOWED = createError( + 'ERR_NETWORK_IMPORT_DISALLOWED', + "import of '%s' by %s is not supported: %s", + Error +) + +codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( + 'ERR_PACKAGE_IMPORT_NOT_DEFINED', + /** + * @param {string} specifier + * @param {string} packagePath + * @param {string} base + */ + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${ + packagePath ? ` in package ${packagePath}package.json` : '' + } imported from ${base}` + }, + TypeError +) + +codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( + 'ERR_PACKAGE_PATH_NOT_EXPORTED', + /** + * @param {string} packagePath + * @param {string} subpath + * @param {string} [base] + */ + (packagePath, subpath, base = undefined) => { + if (subpath === '.') + return `No "exports" main defined in ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }` + return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }` + }, + Error +) + +codes.ERR_UNSUPPORTED_DIR_IMPORT = createError( + 'ERR_UNSUPPORTED_DIR_IMPORT', + "Directory import '%s' is not supported " + + 'resolving ES modules imported from %s', + Error +) + +codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError( + 'ERR_UNSUPPORTED_RESOLVE_REQUEST', + 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', + TypeError +) + +codes.ERR_UNKNOWN_FILE_EXTENSION = createError( + 'ERR_UNKNOWN_FILE_EXTENSION', + /** + * @param {string} extension + * @param {string} path + */ + (extension, path) => { + return `Unknown file extension "${extension}" for ${path}` + }, + TypeError +) + +codes.ERR_INVALID_ARG_VALUE = createError( + 'ERR_INVALID_ARG_VALUE', + /** + * @param {string} name + * @param {unknown} value + * @param {string} [reason='is invalid'] + */ + (name, value, reason = 'is invalid') => { + let inspected = inspect(value) + + if (inspected.length > 128) { + inspected = `${inspected.slice(0, 128)}...` + } + + const type = name.includes('.') ? 'property' : 'argument' + + return `The ${type} '${name}' ${reason}. Received ${inspected}` + }, + TypeError + // Note: extra classes have been shaken out. + // , RangeError +) + +/** + * Utility function for registering the error codes. Only used here. Exported + * *only* to allow for testing. + * @param {string} sym + * @param {MessageFunction | string} value + * @param {ErrorConstructor} constructor + * @returns {new (...parameters: Array) => Error} + */ +function createError(sym, value, constructor) { + // Special case for SystemError that formats the error message differently + // The SystemErrors only have SystemError as their base classes. + messages.set(sym, value) + + return makeNodeErrorWithCode(constructor, sym) +} + +/** + * @param {ErrorConstructor} Base + * @param {string} key + * @returns {ErrorConstructor} + */ +function makeNodeErrorWithCode(Base, key) { + // @ts-expect-error It’s a Node error. + return NodeError + /** + * @param {Array} parameters + */ + function NodeError(...parameters) { + const limit = Error.stackTraceLimit + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0 + const error = new Base() + // Reset the limit and setting the name property. + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit + const message = getMessage(key, parameters, error) + Object.defineProperties(error, { + // Note: no need to implement `kIsNodeError` symbol, would be hard, + // probably. + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + /** @this {Error} */ + value() { + return `${this.name} [${key}]: ${this.message}` + }, + enumerable: false, + writable: true, + configurable: true + } + }) + + captureLargerStackTrace(error) + // @ts-expect-error It’s a Node error. + error.code = key + return error + } +} + +/** + * @returns {boolean} + */ +function isErrorStackTraceLimitWritable() { + // Do no touch Error.stackTraceLimit as V8 would attempt to install + // it again during deserialization. + try { + if (v8.startupSnapshot.isBuildingSnapshot()) { + return false + } + } catch {} + + const desc = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit') + if (desc === undefined) { + return Object.isExtensible(Error) + } + + return own.call(desc, 'writable') && desc.writable !== undefined + ? desc.writable + : desc.set !== undefined +} + +/** + * This function removes unnecessary frames from Node.js core errors. + * @template {(...parameters: unknown[]) => unknown} T + * @param {T} wrappedFunction + * @returns {T} + */ +function hideStackFrames(wrappedFunction) { + // We rename the functions that will be hidden to cut off the stacktrace + // at the outermost one + const hidden = nodeInternalPrefix + wrappedFunction.name + Object.defineProperty(wrappedFunction, 'name', {value: hidden}) + return wrappedFunction +} + +const captureLargerStackTrace = hideStackFrames( + /** + * @param {Error} error + * @returns {Error} + */ + // @ts-expect-error: fine + function (error) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable() + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit + Error.stackTraceLimit = Number.POSITIVE_INFINITY + } + + Error.captureStackTrace(error) + + // Reset the limit + if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit + + return error + } +) + +/** + * @param {string} key + * @param {Array} parameters + * @param {Error} self + * @returns {string} + */ +function getMessage(key, parameters, self) { + const message = messages.get(key) + assert.ok(message !== undefined, 'expected `message` to be found') + + if (typeof message === 'function') { + assert.ok( + message.length <= parameters.length, // Default options do not count. + `Code: ${key}; The provided arguments length (${parameters.length}) does not ` + + `match the required ones (${message.length}).` + ) + return Reflect.apply(message, self, parameters) + } + + const regex = /%[dfijoOs]/g + let expectedLength = 0 + while (regex.exec(message) !== null) expectedLength++ + assert.ok( + expectedLength === parameters.length, + `Code: ${key}; The provided arguments length (${parameters.length}) does not ` + + `match the required ones (${expectedLength}).` + ) + if (parameters.length === 0) return message + + parameters.unshift(message) + return Reflect.apply(format, null, parameters) +} + +/** + * Determine the specific type of a value for type-mismatch errors. + * @param {unknown} value + * @returns {string} + */ +function determineSpecificType(value) { + if (value === null || value === undefined) { + return String(value) + } + + if (typeof value === 'function' && value.name) { + return `function ${value.name}` + } + + if (typeof value === 'object') { + if (value.constructor && value.constructor.name) { + return `an instance of ${value.constructor.name}` + } + + return `${inspect(value, {depth: -1})}` + } + + let inspected = inspect(value, {colors: false}) + + if (inspected.length > 28) { + inspected = `${inspected.slice(0, 25)}...` + } + + return `type ${typeof value} (${inspected})` +} diff --git a/tools/ui/node_modules/import-meta-resolve/lib/get-format.d.ts b/tools/ui/node_modules/import-meta-resolve/lib/get-format.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ff9cb54d10d0455cef98e8339080b2b5ff55dd3 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/get-format.d.ts @@ -0,0 +1,13 @@ +/** + * @param {URL} url + * @param {{parentURL: string}} context + * @returns {string | null} + */ +export function defaultGetFormatWithoutErrors(url: URL, context: { + parentURL: string; +}): string | null; +export type ProtocolHandler = (parsed: URL, context: { + parentURL: string; + source?: Buffer; +}, ignoreErrors: boolean) => string | null | void; +//# sourceMappingURL=get-format.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/get-format.d.ts.map b/tools/ui/node_modules/import-meta-resolve/lib/get-format.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..42731e38118d66e3c6ef2285fd4e4ff157a47412 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/get-format.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"get-format.d.ts","sourceRoot":"","sources":["get-format.js"],"names":[],"mappings":"AAiJA;;;;GAIG;AACH,mDAJW,GAAG,WACH;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,GACjB,MAAM,GAAG,IAAI,CAUzB;uCAxHU,GAAG,WACH;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,gBACpC,OAAO,KACL,MAAM,GAAG,IAAI,GAAG,IAAI"} \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/get-format.js b/tools/ui/node_modules/import-meta-resolve/lib/get-format.js new file mode 100644 index 0000000000000000000000000000000000000000..23c335bd8b208f48c7f32cf7f8d6c268f36f3f59 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/get-format.js @@ -0,0 +1,159 @@ +// Manually “tree shaken” from: +// +// Last checked on: Apr 29, 2024. + +import {fileURLToPath} from 'node:url' +import {getPackageType} from './package-json-reader.js' +import {codes} from './errors.js' + +const {ERR_UNKNOWN_FILE_EXTENSION} = codes + +const hasOwnProperty = {}.hasOwnProperty + +/** @type {Record} */ +const extensionFormatMap = { + // @ts-expect-error: hush. + __proto__: null, + '.cjs': 'commonjs', + '.js': 'module', + '.json': 'json', + '.mjs': 'module' +} + +/** + * @param {string | null} mime + * @returns {string | null} + */ +function mimeToFormat(mime) { + if ( + mime && + /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime) + ) + return 'module' + if (mime === 'application/json') return 'json' + return null +} + +/** + * @callback ProtocolHandler + * @param {URL} parsed + * @param {{parentURL: string, source?: Buffer}} context + * @param {boolean} ignoreErrors + * @returns {string | null | void} + */ + +/** + * @type {Record} + */ +const protocolHandlers = { + // @ts-expect-error: hush. + __proto__: null, + 'data:': getDataProtocolModuleFormat, + 'file:': getFileProtocolModuleFormat, + 'http:': getHttpProtocolModuleFormat, + 'https:': getHttpProtocolModuleFormat, + 'node:'() { + return 'builtin' + } +} + +/** + * @param {URL} parsed + */ +function getDataProtocolModuleFormat(parsed) { + const {1: mime} = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( + parsed.pathname + ) || [null, null, null] + return mimeToFormat(mime) +} + +/** + * Returns the file extension from a URL. + * + * Should give similar result to + * `require('node:path').extname(require('node:url').fileURLToPath(url))` + * when used with a `file:` URL. + * + * @param {URL} url + * @returns {string} + */ +function extname(url) { + const pathname = url.pathname + let index = pathname.length + + while (index--) { + const code = pathname.codePointAt(index) + + if (code === 47 /* `/` */) { + return '' + } + + if (code === 46 /* `.` */) { + return pathname.codePointAt(index - 1) === 47 /* `/` */ + ? '' + : pathname.slice(index) + } + } + + return '' +} + +/** + * @type {ProtocolHandler} + */ +function getFileProtocolModuleFormat(url, _context, ignoreErrors) { + const value = extname(url) + + if (value === '.js') { + const packageType = getPackageType(url) + + if (packageType !== 'none') { + return packageType + } + + return 'commonjs' + } + + if (value === '') { + const packageType = getPackageType(url) + + // Legacy behavior + if (packageType === 'none' || packageType === 'commonjs') { + return 'commonjs' + } + + // Note: we don’t implement WASM, so we don’t need + // `getFormatOfExtensionlessFile` from `formats`. + return 'module' + } + + const format = extensionFormatMap[value] + if (format) return format + + // Explicit undefined return indicates load hook should rerun format check + if (ignoreErrors) { + return undefined + } + + const filepath = fileURLToPath(url) + throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath) +} + +function getHttpProtocolModuleFormat() { + // To do: HTTPS imports. +} + +/** + * @param {URL} url + * @param {{parentURL: string}} context + * @returns {string | null} + */ +export function defaultGetFormatWithoutErrors(url, context) { + const protocol = url.protocol + + if (!hasOwnProperty.call(protocolHandlers, protocol)) { + return null + } + + return protocolHandlers[protocol](url, context, true) || null +} diff --git a/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.d.ts b/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9603bf244bf43d9c1795667884341c1572ed58d0 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.d.ts @@ -0,0 +1,31 @@ +/** + * @param {string} jsonPath + * @param {{specifier: URL | string, base?: URL}} options + * @returns {PackageConfig} + */ +export function read(jsonPath: string, { base, specifier }: { + specifier: URL | string; + base?: URL; +}): PackageConfig; +/** + * @param {URL | string} resolved + * @returns {PackageConfig} + */ +export function getPackageScopeConfig(resolved: URL | string): PackageConfig; +/** + * Returns the package type for a given URL. + * @param {URL} url - The URL to get the package type for. + * @returns {PackageType} + */ +export function getPackageType(url: URL): PackageType; +export type PackageType = "commonjs" | "module" | "none"; +export type PackageConfig = { + pjsonPath: string; + exists: boolean; + main?: string | undefined; + name?: string | undefined; + type: PackageType; + exports?: Record | undefined; + imports?: Record | undefined; +}; +//# sourceMappingURL=package-json-reader.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.d.ts.map b/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1b53c8cf28e999fefe6665266f5d75efffe479bb --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"package-json-reader.d.ts","sourceRoot":"","sources":["package-json-reader.js"],"names":[],"mappings":"AAiCA;;;;GAIG;AACH,+BAJW,MAAM,uBACN;IAAC,SAAS,EAAE,GAAG,GAAG,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAA;CAAC,GACnC,aAAa,CAwFzB;AAED;;;GAGG;AACH,gDAHW,GAAG,GAAG,MAAM,GACV,aAAa,CAsCzB;AAED;;;;GAIG;AACH,oCAHW,GAAG,GACD,WAAW,CAKvB;0BAvKY,UAAU,GAAG,QAAQ,GAAG,MAAM;;eAG7B,MAAM;YACN,OAAO;WACP,MAAM,GAAG,SAAS;WAClB,MAAM,GAAG,SAAS;UAClB,WAAW;cACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;cACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS"} \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.js b/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.js new file mode 100644 index 0000000000000000000000000000000000000000..3166cc414634ed305517ba5bee84cd21b94e0010 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/package-json-reader.js @@ -0,0 +1,177 @@ +// Manually “tree shaken” from: +// +// Last checked on: Apr 29, 2024. +// Removed the native dependency. +// Also: no need to cache, we do that in resolve already. + +/** + * @import {ErrnoException} from './errors.js' + * + * @typedef {'commonjs' | 'module' | 'none'} PackageType + * + * @typedef PackageConfig + * @property {string} pjsonPath + * @property {boolean} exists + * @property {string | undefined} [main] + * @property {string | undefined} [name] + * @property {PackageType} type + * @property {Record | undefined} [exports] + * @property {Record | undefined} [imports] + */ + +import fs from 'node:fs' +import path from 'node:path' +import {fileURLToPath} from 'node:url' +import {codes} from './errors.js' + +const hasOwnProperty = {}.hasOwnProperty + +const {ERR_INVALID_PACKAGE_CONFIG} = codes + +/** @type {Map} */ +const cache = new Map() + +/** + * @param {string} jsonPath + * @param {{specifier: URL | string, base?: URL}} options + * @returns {PackageConfig} + */ +export function read(jsonPath, {base, specifier}) { + const existing = cache.get(jsonPath) + + if (existing) { + return existing + } + + /** @type {string | undefined} */ + let string + + try { + string = fs.readFileSync(path.toNamespacedPath(jsonPath), 'utf8') + } catch (error) { + const exception = /** @type {ErrnoException} */ (error) + + if (exception.code !== 'ENOENT') { + throw exception + } + } + + /** @type {PackageConfig} */ + const result = { + exists: false, + pjsonPath: jsonPath, + main: undefined, + name: undefined, + type: 'none', // Ignore unknown types for forwards compatibility + exports: undefined, + imports: undefined + } + + if (string !== undefined) { + /** @type {Record} */ + let parsed + + try { + parsed = JSON.parse(string) + } catch (error_) { + const cause = /** @type {ErrnoException} */ (error_) + const error = new ERR_INVALID_PACKAGE_CONFIG( + jsonPath, + (base ? `"${specifier}" from ` : '') + fileURLToPath(base || specifier), + cause.message + ) + error.cause = cause + throw error + } + + result.exists = true + + if ( + hasOwnProperty.call(parsed, 'name') && + typeof parsed.name === 'string' + ) { + result.name = parsed.name + } + + if ( + hasOwnProperty.call(parsed, 'main') && + typeof parsed.main === 'string' + ) { + result.main = parsed.main + } + + if (hasOwnProperty.call(parsed, 'exports')) { + // @ts-expect-error: assume valid. + result.exports = parsed.exports + } + + if (hasOwnProperty.call(parsed, 'imports')) { + // @ts-expect-error: assume valid. + result.imports = parsed.imports + } + + // Ignore unknown types for forwards compatibility + if ( + hasOwnProperty.call(parsed, 'type') && + (parsed.type === 'commonjs' || parsed.type === 'module') + ) { + result.type = parsed.type + } + } + + cache.set(jsonPath, result) + + return result +} + +/** + * @param {URL | string} resolved + * @returns {PackageConfig} + */ +export function getPackageScopeConfig(resolved) { + // Note: in Node, this is now a native module. + let packageJSONUrl = new URL('package.json', resolved) + + while (true) { + const packageJSONPath = packageJSONUrl.pathname + if (packageJSONPath.endsWith('node_modules/package.json')) { + break + } + + const packageConfig = read(fileURLToPath(packageJSONUrl), { + specifier: resolved + }) + + if (packageConfig.exists) { + return packageConfig + } + + const lastPackageJSONUrl = packageJSONUrl + packageJSONUrl = new URL('../package.json', packageJSONUrl) + + // Terminates at root where ../package.json equals ../../package.json + // (can't just check "/package.json" for Windows support). + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break + } + } + + const packageJSONPath = fileURLToPath(packageJSONUrl) + // ^^ Note: in Node, this is now a native module. + + return { + pjsonPath: packageJSONPath, + exists: false, + type: 'none' + } +} + +/** + * Returns the package type for a given URL. + * @param {URL} url - The URL to get the package type for. + * @returns {PackageType} + */ +export function getPackageType(url) { + // To do @anonrig: Write a C++ function that returns only "type". + return getPackageScopeConfig(url).type +} diff --git a/tools/ui/node_modules/import-meta-resolve/lib/resolve.d.ts b/tools/ui/node_modules/import-meta-resolve/lib/resolve.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4d2f25a396f5f6a9eff59b695cde18be5a5aae9 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/resolve.d.ts @@ -0,0 +1,29 @@ +/** + * The “Resolver Algorithm Specification” as detailed in the Node docs (which is + * sync and slightly lower-level than `resolve`). + * + * @param {string} specifier + * `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc. + * @param {URL} base + * Full URL (to a file) that `specifier` is resolved relative from. + * @param {Set} [conditions] + * Conditions. + * @param {boolean} [preserveSymlinks] + * Keep symlinks instead of resolving them. + * @returns {URL} + * A URL object to the found thing. + */ +export function moduleResolve(specifier: string, base: URL, conditions?: Set, preserveSymlinks?: boolean): URL; +/** + * @param {string} specifier + * @param {{parentURL?: string, conditions?: Array}} context + * @returns {{url: string, format?: string | null}} + */ +export function defaultResolve(specifier: string, context?: { + parentURL?: string; + conditions?: Array; +}): { + url: string; + format?: string | null; +}; +//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/resolve.d.ts.map b/tools/ui/node_modules/import-meta-resolve/lib/resolve.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3879f57dc1726036fabebfbc5e40280e3e121096 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/resolve.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["resolve.js"],"names":[],"mappings":"AAyiCA;;;;;;;;;;;;;;GAcG;AACH,yCAXW,MAAM,QAEN,GAAG,eAEH,GAAG,CAAC,MAAM,CAAC,qBAEX,OAAO,GAEL,GAAG,CAkDf;AAoGD;;;;GAIG;AACH,0CAJW,MAAM,YACN;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAC,GAC9C;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,CAsEjD"} \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/resolve.js b/tools/ui/node_modules/import-meta-resolve/lib/resolve.js new file mode 100644 index 0000000000000000000000000000000000000000..c4b48deb6396846ba3f13716c617354f2a2d2af2 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/resolve.js @@ -0,0 +1,1301 @@ +// Manually “tree shaken” from: +// +// Last checked on: Apr 29, 2024. + +/** + * @import {Stats} from 'node:fs' + * @import {ErrnoException} from './errors.js' + * @import {PackageConfig} from './package-json-reader.js' + */ + +import assert from 'node:assert' +import {statSync, realpathSync} from 'node:fs' +import process from 'node:process' +import {fileURLToPath, pathToFileURL} from 'node:url' +import path from 'node:path' +import {builtinModules} from 'node:module' +import {defaultGetFormatWithoutErrors} from './get-format.js' +import {codes} from './errors.js' +import {getPackageScopeConfig, read} from './package-json-reader.js' +import {getConditionsSet} from './utils.js' + +const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace] + +const { + ERR_NETWORK_IMPORT_DISALLOWED, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG, + ERR_INVALID_PACKAGE_TARGET, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_RESOLVE_REQUEST +} = codes + +const own = {}.hasOwnProperty + +const invalidSegmentRegEx = + /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i +const deprecatedInvalidSegmentRegEx = + /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i +const invalidPackageNameRegEx = /^\.|%|\\/ +const patternRegEx = /\*/g +const encodedSeparatorRegEx = /%2f|%5c/i +/** @type {Set} */ +const emittedPackageWarnings = new Set() + +const doubleSlashRegEx = /[/\\]{2}/ + +/** + * + * @param {string} target + * @param {string} request + * @param {string} match + * @param {URL} packageJsonUrl + * @param {boolean} internal + * @param {URL} base + * @param {boolean} isTarget + */ +function emitInvalidSegmentDeprecation( + target, + request, + match, + packageJsonUrl, + internal, + base, + isTarget +) { + // @ts-expect-error: apparently it does exist, TS. + if (process.noDeprecation) { + return + } + + const pjsonPath = fileURLToPath(packageJsonUrl) + const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null + process.emitWarning( + `Use of deprecated ${ + double ? 'double slash' : 'leading or trailing slash matching' + } resolving "${target}" for module ` + + `request "${request}" ${ + request === match ? '' : `matched to "${match}" ` + }in the "${ + internal ? 'imports' : 'exports' + }" field module resolution of the package at ${pjsonPath}${ + base ? ` imported from ${fileURLToPath(base)}` : '' + }.`, + 'DeprecationWarning', + 'DEP0166' + ) +} + +/** + * @param {URL} url + * @param {URL} packageJsonUrl + * @param {URL} base + * @param {string} [main] + * @returns {void} + */ +function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) { + // @ts-expect-error: apparently it does exist, TS. + if (process.noDeprecation) { + return + } + + const format = defaultGetFormatWithoutErrors(url, {parentURL: base.href}) + if (format !== 'module') return + const urlPath = fileURLToPath(url.href) + const packagePath = fileURLToPath(new URL('.', packageJsonUrl)) + const basePath = fileURLToPath(base) + if (!main) { + process.emitWarning( + `No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice( + packagePath.length + )}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, + 'DeprecationWarning', + 'DEP0151' + ) + } else if (path.resolve(packagePath, main) !== urlPath) { + process.emitWarning( + `Package ${packagePath} has a "main" field set to "${main}", ` + + `excluding the full filename and extension to the resolved file at "${urlPath.slice( + packagePath.length + )}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is ` + + 'deprecated for ES modules.', + 'DeprecationWarning', + 'DEP0151' + ) + } +} + +/** + * @param {string} path + * @returns {Stats | undefined} + */ +function tryStatSync(path) { + // Note: from Node 15 onwards we can use `throwIfNoEntry: false` instead. + try { + return statSync(path) + } catch { + // Note: in Node code this returns `new Stats`, + // but in Node 22 that’s marked as a deprecated internal API. + // Which, well, we kinda are, but still to prevent that warning, + // just yield `undefined`. + } +} + +/** + * Legacy CommonJS main resolution: + * 1. let M = pkg_url + (json main field) + * 2. TRY(M, M.js, M.json, M.node) + * 3. TRY(M/index.js, M/index.json, M/index.node) + * 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node) + * 5. NOT_FOUND + * + * @param {URL} url + * @returns {boolean} + */ +function fileExists(url) { + const stats = statSync(url, {throwIfNoEntry: false}) + const isFile = stats ? stats.isFile() : undefined + return isFile === null || isFile === undefined ? false : isFile +} + +/** + * @param {URL} packageJsonUrl + * @param {PackageConfig} packageConfig + * @param {URL} base + * @returns {URL} + */ +function legacyMainResolve(packageJsonUrl, packageConfig, base) { + /** @type {URL | undefined} */ + let guess + if (packageConfig.main !== undefined) { + guess = new URL(packageConfig.main, packageJsonUrl) + // Note: fs check redundances will be handled by Descriptor cache here. + if (fileExists(guess)) return guess + + const tries = [ + `./${packageConfig.main}.js`, + `./${packageConfig.main}.json`, + `./${packageConfig.main}.node`, + `./${packageConfig.main}/index.js`, + `./${packageConfig.main}/index.json`, + `./${packageConfig.main}/index.node` + ] + let i = -1 + + while (++i < tries.length) { + guess = new URL(tries[i], packageJsonUrl) + if (fileExists(guess)) break + guess = undefined + } + + if (guess) { + emitLegacyIndexDeprecation( + guess, + packageJsonUrl, + base, + packageConfig.main + ) + return guess + } + // Fallthrough. + } + + const tries = ['./index.js', './index.json', './index.node'] + let i = -1 + + while (++i < tries.length) { + guess = new URL(tries[i], packageJsonUrl) + if (fileExists(guess)) break + guess = undefined + } + + if (guess) { + emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main) + return guess + } + + // Not found. + throw new ERR_MODULE_NOT_FOUND( + fileURLToPath(new URL('.', packageJsonUrl)), + fileURLToPath(base) + ) +} + +/** + * @param {URL} resolved + * @param {URL} base + * @param {boolean} [preserveSymlinks] + * @returns {URL} + */ +function finalizeResolution(resolved, base, preserveSymlinks) { + if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) { + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved.pathname, + 'must not include encoded "/" or "\\" characters', + fileURLToPath(base) + ) + } + + /** @type {string} */ + let filePath + + try { + filePath = fileURLToPath(resolved) + } catch (error) { + const cause = /** @type {ErrnoException} */ (error) + Object.defineProperty(cause, 'input', {value: String(resolved)}) + Object.defineProperty(cause, 'module', {value: String(base)}) + throw cause + } + + const stats = tryStatSync( + filePath.endsWith('/') ? filePath.slice(-1) : filePath + ) + + if (stats && stats.isDirectory()) { + const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath(base)) + // @ts-expect-error Add this for `import.meta.resolve`. + error.url = String(resolved) + throw error + } + + if (!stats || !stats.isFile()) { + const error = new ERR_MODULE_NOT_FOUND( + filePath || resolved.pathname, + base && fileURLToPath(base), + true + ) + // @ts-expect-error Add this for `import.meta.resolve`. + error.url = String(resolved) + throw error + } + + if (!preserveSymlinks) { + const real = realpathSync(filePath) + const {search, hash} = resolved + resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? '/' : '')) + resolved.search = search + resolved.hash = hash + } + + return resolved +} + +/** + * @param {string} specifier + * @param {URL | undefined} packageJsonUrl + * @param {URL} base + * @returns {Error} + */ +function importNotDefined(specifier, packageJsonUrl, base) { + return new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJsonUrl && fileURLToPath(new URL('.', packageJsonUrl)), + fileURLToPath(base) + ) +} + +/** + * @param {string} subpath + * @param {URL} packageJsonUrl + * @param {URL} base + * @returns {Error} + */ +function exportsNotFound(subpath, packageJsonUrl, base) { + return new ERR_PACKAGE_PATH_NOT_EXPORTED( + fileURLToPath(new URL('.', packageJsonUrl)), + subpath, + base && fileURLToPath(base) + ) +} + +/** + * @param {string} request + * @param {string} match + * @param {URL} packageJsonUrl + * @param {boolean} internal + * @param {URL} [base] + * @returns {never} + */ +function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) { + const reason = `request is not a valid match in pattern "${match}" for the "${ + internal ? 'imports' : 'exports' + }" resolution of ${fileURLToPath(packageJsonUrl)}` + throw new ERR_INVALID_MODULE_SPECIFIER( + request, + reason, + base && fileURLToPath(base) + ) +} + +/** + * @param {string} subpath + * @param {unknown} target + * @param {URL} packageJsonUrl + * @param {boolean} internal + * @param {URL} [base] + * @returns {Error} + */ +function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { + target = + typeof target === 'object' && target !== null + ? JSON.stringify(target, null, '') + : `${target}` + + return new ERR_INVALID_PACKAGE_TARGET( + fileURLToPath(new URL('.', packageJsonUrl)), + subpath, + target, + internal, + base && fileURLToPath(base) + ) +} + +/** + * @param {string} target + * @param {string} subpath + * @param {string} match + * @param {URL} packageJsonUrl + * @param {URL} base + * @param {boolean} pattern + * @param {boolean} internal + * @param {boolean} isPathMap + * @param {Set | undefined} conditions + * @returns {URL} + */ +function resolvePackageTargetString( + target, + subpath, + match, + packageJsonUrl, + base, + pattern, + internal, + isPathMap, + conditions +) { + if (subpath !== '' && !pattern && target[target.length - 1] !== '/') + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base) + + if (!target.startsWith('./')) { + if (internal && !target.startsWith('../') && !target.startsWith('/')) { + let isURL = false + + try { + new URL(target) + isURL = true + } catch { + // Continue regardless of error. + } + + if (!isURL) { + const exportTarget = pattern + ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) + : target + subpath + + return packageResolve(exportTarget, packageJsonUrl, conditions) + } + } + + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base) + } + + if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { + if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { + if (!isPathMap) { + const request = pattern + ? match.replace('*', () => subpath) + : match + subpath + const resolvedTarget = pattern + ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) + : target + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match, + packageJsonUrl, + internal, + base, + true + ) + } + } else { + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base) + } + } + + const resolved = new URL(target, packageJsonUrl) + const resolvedPath = resolved.pathname + const packagePath = new URL('.', packageJsonUrl).pathname + + if (!resolvedPath.startsWith(packagePath)) + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base) + + if (subpath === '') return resolved + + if (invalidSegmentRegEx.exec(subpath) !== null) { + const request = pattern + ? match.replace('*', () => subpath) + : match + subpath + if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { + if (!isPathMap) { + const resolvedTarget = pattern + ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) + : target + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match, + packageJsonUrl, + internal, + base, + false + ) + } + } else { + throwInvalidSubpath(request, match, packageJsonUrl, internal, base) + } + } + + if (pattern) { + return new URL( + RegExpPrototypeSymbolReplace.call( + patternRegEx, + resolved.href, + () => subpath + ) + ) + } + + return new URL(subpath, resolved) +} + +/** + * @param {string} key + * @returns {boolean} + */ +function isArrayIndex(key) { + const keyNumber = Number(key) + if (`${keyNumber}` !== key) return false + return keyNumber >= 0 && keyNumber < 0xff_ff_ff_ff +} + +/** + * @param {URL} packageJsonUrl + * @param {unknown} target + * @param {string} subpath + * @param {string} packageSubpath + * @param {URL} base + * @param {boolean} pattern + * @param {boolean} internal + * @param {boolean} isPathMap + * @param {Set | undefined} conditions + * @returns {URL | null} + */ +function resolvePackageTarget( + packageJsonUrl, + target, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions +) { + if (typeof target === 'string') { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJsonUrl, + base, + pattern, + internal, + isPathMap, + conditions + ) + } + + if (Array.isArray(target)) { + /** @type {Array} */ + const targetList = target + if (targetList.length === 0) return null + + /** @type {ErrnoException | null | undefined} */ + let lastException + let i = -1 + + while (++i < targetList.length) { + const targetItem = targetList[i] + /** @type {URL | null} */ + let resolveResult + try { + resolveResult = resolvePackageTarget( + packageJsonUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ) + } catch (error) { + const exception = /** @type {ErrnoException} */ (error) + lastException = exception + if (exception.code === 'ERR_INVALID_PACKAGE_TARGET') continue + throw error + } + + if (resolveResult === undefined) continue + + if (resolveResult === null) { + lastException = null + continue + } + + return resolveResult + } + + if (lastException === undefined || lastException === null) { + return null + } + + throw lastException + } + + if (typeof target === 'object' && target !== null) { + const keys = Object.getOwnPropertyNames(target) + let i = -1 + + while (++i < keys.length) { + const key = keys[i] + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG( + fileURLToPath(packageJsonUrl), + base, + '"exports" cannot contain numeric property keys.' + ) + } + } + + i = -1 + + while (++i < keys.length) { + const key = keys[i] + if (key === 'default' || (conditions && conditions.has(key))) { + // @ts-expect-error: indexable. + const conditionalTarget = /** @type {unknown} */ (target[key]) + const resolveResult = resolvePackageTarget( + packageJsonUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ) + if (resolveResult === undefined) continue + return resolveResult + } + } + + return null + } + + if (target === null) { + return null + } + + throw invalidPackageTarget( + packageSubpath, + target, + packageJsonUrl, + internal, + base + ) +} + +/** + * @param {unknown} exports + * @param {URL} packageJsonUrl + * @param {URL} base + * @returns {boolean} + */ +function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { + if (typeof exports === 'string' || Array.isArray(exports)) return true + if (typeof exports !== 'object' || exports === null) return false + + const keys = Object.getOwnPropertyNames(exports) + let isConditionalSugar = false + let i = 0 + let keyIndex = -1 + while (++keyIndex < keys.length) { + const key = keys[keyIndex] + const currentIsConditionalSugar = key === '' || key[0] !== '.' + if (i++ === 0) { + isConditionalSugar = currentIsConditionalSugar + } else if (isConditionalSugar !== currentIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG( + fileURLToPath(packageJsonUrl), + base, + '"exports" cannot contain some keys starting with \'.\' and some not.' + + ' The exports object must either be an object of package subpath keys' + + ' or an object of main entry condition name keys only.' + ) + } + } + + return isConditionalSugar +} + +/** + * @param {string} match + * @param {URL} pjsonUrl + * @param {URL} base + */ +function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { + // @ts-expect-error: apparently it does exist, TS. + if (process.noDeprecation) { + return + } + + const pjsonPath = fileURLToPath(pjsonUrl) + if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return + emittedPackageWarnings.add(pjsonPath + '|' + match) + process.emitWarning( + `Use of deprecated trailing slash pattern mapping "${match}" in the ` + + `"exports" field module resolution of the package at ${pjsonPath}${ + base ? ` imported from ${fileURLToPath(base)}` : '' + }. Mapping specifiers ending in "/" is no longer supported.`, + 'DeprecationWarning', + 'DEP0155' + ) +} + +/** + * @param {URL} packageJsonUrl + * @param {string} packageSubpath + * @param {Record} packageConfig + * @param {URL} base + * @param {Set | undefined} conditions + * @returns {URL} + */ +function packageExportsResolve( + packageJsonUrl, + packageSubpath, + packageConfig, + base, + conditions +) { + let exports = packageConfig.exports + + if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { + exports = {'.': exports} + } + + if ( + own.call(exports, packageSubpath) && + !packageSubpath.includes('*') && + !packageSubpath.endsWith('/') + ) { + // @ts-expect-error: indexable. + const target = exports[packageSubpath] + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + '', + packageSubpath, + base, + false, + false, + false, + conditions + ) + if (resolveResult === null || resolveResult === undefined) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base) + } + + return resolveResult + } + + let bestMatch = '' + let bestMatchSubpath = '' + const keys = Object.getOwnPropertyNames(exports) + let i = -1 + + while (++i < keys.length) { + const key = keys[i] + const patternIndex = key.indexOf('*') + + if ( + patternIndex !== -1 && + packageSubpath.startsWith(key.slice(0, patternIndex)) + ) { + // When this reaches EOL, this can throw at the top of the whole function: + // + // if (StringPrototypeEndsWith(packageSubpath, '/')) + // throwInvalidSubpath(packageSubpath) + // + // To match "imports" and the spec. + if (packageSubpath.endsWith('/')) { + emitTrailingSlashPatternDeprecation( + packageSubpath, + packageJsonUrl, + base + ) + } + + const patternTrailer = key.slice(patternIndex + 1) + + if ( + packageSubpath.length >= key.length && + packageSubpath.endsWith(patternTrailer) && + patternKeyCompare(bestMatch, key) === 1 && + key.lastIndexOf('*') === patternIndex + ) { + bestMatch = key + bestMatchSubpath = packageSubpath.slice( + patternIndex, + packageSubpath.length - patternTrailer.length + ) + } + } + } + + if (bestMatch) { + // @ts-expect-error: indexable. + const target = /** @type {unknown} */ (exports[bestMatch]) + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + false, + packageSubpath.endsWith('/'), + conditions + ) + + if (resolveResult === null || resolveResult === undefined) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base) + } + + return resolveResult + } + + throw exportsNotFound(packageSubpath, packageJsonUrl, base) +} + +/** + * @param {string} a + * @param {string} b + */ +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf('*') + const bPatternIndex = b.indexOf('*') + const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1 + const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1 + if (baseLengthA > baseLengthB) return -1 + if (baseLengthB > baseLengthA) return 1 + if (aPatternIndex === -1) return 1 + if (bPatternIndex === -1) return -1 + if (a.length > b.length) return -1 + if (b.length > a.length) return 1 + return 0 +} + +/** + * @param {string} name + * @param {URL} base + * @param {Set} [conditions] + * @returns {URL} + */ +function packageImportsResolve(name, base, conditions) { + if (name === '#' || name.startsWith('#/') || name.endsWith('/')) { + const reason = 'is not a valid internal imports specifier name' + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base)) + } + + /** @type {URL | undefined} */ + let packageJsonUrl + + const packageConfig = getPackageScopeConfig(base) + + if (packageConfig.exists) { + packageJsonUrl = pathToFileURL(packageConfig.pjsonPath) + const imports = packageConfig.imports + if (imports) { + if (own.call(imports, name) && !name.includes('*')) { + const resolveResult = resolvePackageTarget( + packageJsonUrl, + imports[name], + '', + name, + base, + false, + true, + false, + conditions + ) + if (resolveResult !== null && resolveResult !== undefined) { + return resolveResult + } + } else { + let bestMatch = '' + let bestMatchSubpath = '' + const keys = Object.getOwnPropertyNames(imports) + let i = -1 + + while (++i < keys.length) { + const key = keys[i] + const patternIndex = key.indexOf('*') + + if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) { + const patternTrailer = key.slice(patternIndex + 1) + if ( + name.length >= key.length && + name.endsWith(patternTrailer) && + patternKeyCompare(bestMatch, key) === 1 && + key.lastIndexOf('*') === patternIndex + ) { + bestMatch = key + bestMatchSubpath = name.slice( + patternIndex, + name.length - patternTrailer.length + ) + } + } + } + + if (bestMatch) { + const target = imports[bestMatch] + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + false, + conditions + ) + + if (resolveResult !== null && resolveResult !== undefined) { + return resolveResult + } + } + } + } + } + + throw importNotDefined(name, packageJsonUrl, base) +} + +/** + * @param {string} specifier + * @param {URL} base + */ +function parsePackageName(specifier, base) { + let separatorIndex = specifier.indexOf('/') + let validPackageName = true + let isScoped = false + if (specifier[0] === '@') { + isScoped = true + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false + } else { + separatorIndex = specifier.indexOf('/', separatorIndex + 1) + } + } + + const packageName = + separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex) + + // Package name cannot have leading . and cannot have percent-encoding or + // \\ separators. + if (invalidPackageNameRegEx.exec(packageName) !== null) { + validPackageName = false + } + + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER( + specifier, + 'is not a valid package name', + fileURLToPath(base) + ) + } + + const packageSubpath = + '.' + (separatorIndex === -1 ? '' : specifier.slice(separatorIndex)) + + return {packageName, packageSubpath, isScoped} +} + +/** + * @param {string} specifier + * @param {URL} base + * @param {Set | undefined} conditions + * @returns {URL} + */ +function packageResolve(specifier, base, conditions) { + if (builtinModules.includes(specifier)) { + return new URL('node:' + specifier) + } + + const {packageName, packageSubpath, isScoped} = parsePackageName( + specifier, + base + ) + + // ResolveSelf + const packageConfig = getPackageScopeConfig(base) + + // Can’t test. + /* c8 ignore next 16 */ + if (packageConfig.exists) { + const packageJsonUrl = pathToFileURL(packageConfig.pjsonPath) + if ( + packageConfig.name === packageName && + packageConfig.exports !== undefined && + packageConfig.exports !== null + ) { + return packageExportsResolve( + packageJsonUrl, + packageSubpath, + packageConfig, + base, + conditions + ) + } + } + + let packageJsonUrl = new URL( + './node_modules/' + packageName + '/package.json', + base + ) + let packageJsonPath = fileURLToPath(packageJsonUrl) + /** @type {string} */ + let lastPath + do { + const stat = tryStatSync(packageJsonPath.slice(0, -13)) + if (!stat || !stat.isDirectory()) { + lastPath = packageJsonPath + packageJsonUrl = new URL( + (isScoped ? '../../../../node_modules/' : '../../../node_modules/') + + packageName + + '/package.json', + packageJsonUrl + ) + packageJsonPath = fileURLToPath(packageJsonUrl) + continue + } + + // Package match. + const packageConfig = read(packageJsonPath, {base, specifier}) + if (packageConfig.exports !== undefined && packageConfig.exports !== null) { + return packageExportsResolve( + packageJsonUrl, + packageSubpath, + packageConfig, + base, + conditions + ) + } + + if (packageSubpath === '.') { + return legacyMainResolve(packageJsonUrl, packageConfig, base) + } + + return new URL(packageSubpath, packageJsonUrl) + // Cross-platform root check. + } while (packageJsonPath.length !== lastPath.length) + + throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), false) +} + +/** + * @param {string} specifier + * @returns {boolean} + */ +function isRelativeSpecifier(specifier) { + if (specifier[0] === '.') { + if (specifier.length === 1 || specifier[1] === '/') return true + if ( + specifier[1] === '.' && + (specifier.length === 2 || specifier[2] === '/') + ) { + return true + } + } + + return false +} + +/** + * @param {string} specifier + * @returns {boolean} + */ +function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === '') return false + if (specifier[0] === '/') return true + return isRelativeSpecifier(specifier) +} + +/** + * The “Resolver Algorithm Specification” as detailed in the Node docs (which is + * sync and slightly lower-level than `resolve`). + * + * @param {string} specifier + * `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc. + * @param {URL} base + * Full URL (to a file) that `specifier` is resolved relative from. + * @param {Set} [conditions] + * Conditions. + * @param {boolean} [preserveSymlinks] + * Keep symlinks instead of resolving them. + * @returns {URL} + * A URL object to the found thing. + */ +export function moduleResolve(specifier, base, conditions, preserveSymlinks) { + // Note: The Node code supports `base` as a string (in this internal API) too, + // we don’t. + if (conditions === undefined) { + conditions = getConditionsSet() + } + + const protocol = base.protocol + const isData = protocol === 'data:' + const isRemote = isData || protocol === 'http:' || protocol === 'https:' + // Order swapped from spec for minor perf gain. + // Ok since relative URLs cannot parse as URLs. + /** @type {URL | undefined} */ + let resolved + + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + try { + resolved = new URL(specifier, base) + } catch (error_) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base) + error.cause = error_ + throw error + } + } else if (protocol === 'file:' && specifier[0] === '#') { + resolved = packageImportsResolve(specifier, base, conditions) + } else { + try { + resolved = new URL(specifier) + } catch (error_) { + // Note: actual code uses `canBeRequiredWithoutScheme`. + if (isRemote && !builtinModules.includes(specifier)) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base) + error.cause = error_ + throw error + } + + resolved = packageResolve(specifier, base, conditions) + } + } + + assert.ok(resolved !== undefined, 'expected to be defined') + + if (resolved.protocol !== 'file:') { + return resolved + } + + return finalizeResolution(resolved, base, preserveSymlinks) +} + +/** + * @param {string} specifier + * @param {URL | undefined} parsed + * @param {URL | undefined} parsedParentURL + */ +function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { + if (parsedParentURL) { + // Avoid accessing the `protocol` property due to the lazy getters. + const parentProtocol = parsedParentURL.protocol + + if (parentProtocol === 'http:' || parentProtocol === 'https:') { + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + // Avoid accessing the `protocol` property due to the lazy getters. + const parsedProtocol = parsed?.protocol + + // `data:` and `blob:` disallowed due to allowing file: access via + // indirection + if ( + parsedProtocol && + parsedProtocol !== 'https:' && + parsedProtocol !== 'http:' + ) { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + 'remote imports cannot import from a local location.' + ) + } + + return {url: parsed?.href || ''} + } + + if (builtinModules.includes(specifier)) { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + 'remote imports cannot import from a local location.' + ) + } + + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + 'only relative and absolute specifiers are supported.' + ) + } + } +} + +// Note: this is from: +// +/** + * Checks if a value has the shape of a WHATWG URL object. + * + * Using a symbol or instanceof would not be able to recognize URL objects + * coming from other implementations (e.g. in Electron), so instead we are + * checking some well known properties for a lack of a better test. + * + * We use `href` and `protocol` as they are the only properties that are + * easy to retrieve and calculate due to the lazy nature of the getters. + * + * @template {unknown} Value + * @param {Value} self + * @returns {Value is URL} + */ +function isURL(self) { + return Boolean( + self && + typeof self === 'object' && + 'href' in self && + typeof self.href === 'string' && + 'protocol' in self && + typeof self.protocol === 'string' && + self.href && + self.protocol + ) +} + +/** + * Validate user-input in `context` supplied by a custom loader. + * + * @param {unknown} parentURL + * @returns {asserts parentURL is URL | string | undefined} + */ +function throwIfInvalidParentURL(parentURL) { + if (parentURL === undefined) { + return // Main entry point, so no parent + } + + if (typeof parentURL !== 'string' && !isURL(parentURL)) { + throw new codes.ERR_INVALID_ARG_TYPE( + 'parentURL', + ['string', 'URL'], + parentURL + ) + } +} + +/** + * @param {string} specifier + * @param {{parentURL?: string, conditions?: Array}} context + * @returns {{url: string, format?: string | null}} + */ +export function defaultResolve(specifier, context = {}) { + const {parentURL} = context + assert.ok(parentURL !== undefined, 'expected `parentURL` to be defined') + throwIfInvalidParentURL(parentURL) + + /** @type {URL | undefined} */ + let parsedParentURL + if (parentURL) { + try { + parsedParentURL = new URL(parentURL) + } catch { + // Ignore exception + } + } + + /** @type {URL | undefined} */ + let parsed + /** @type {string | undefined} */ + let protocol + + try { + parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) + ? new URL(specifier, parsedParentURL) + : new URL(specifier) + + // Avoid accessing the `protocol` property due to the lazy getters. + protocol = parsed.protocol + + if (protocol === 'data:') { + return {url: parsed.href, format: null} + } + } catch { + // Ignore exception + } + + // There are multiple deep branches that can either throw or return; instead + // of duplicating that deeply nested logic for the possible returns, DRY and + // check for a return. This seems the least gnarly. + const maybeReturn = checkIfDisallowedImport( + specifier, + parsed, + parsedParentURL + ) + + if (maybeReturn) return maybeReturn + + // This must come after checkIfDisallowedImport + if (protocol === undefined && parsed) { + protocol = parsed.protocol + } + + if (protocol === 'node:') { + return {url: specifier} + } + + // This must come after checkIfDisallowedImport + if (parsed && parsed.protocol === 'node:') return {url: specifier} + + const conditions = getConditionsSet(context.conditions) + + const url = moduleResolve(specifier, new URL(parentURL), conditions, false) + + return { + // Do NOT cast `url` to a string: that will work even when there are real + // problems, silencing them + url: url.href, + format: defaultGetFormatWithoutErrors(url, {parentURL}) + } +} diff --git a/tools/ui/node_modules/import-meta-resolve/lib/utils.d.ts b/tools/ui/node_modules/import-meta-resolve/lib/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7aaa6716bdb239725ae37d10fa063eadb796883 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/utils.d.ts @@ -0,0 +1,6 @@ +/** + * @param {Array} [conditions] + * @returns {Set} + */ +export function getConditionsSet(conditions?: Array): Set; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/utils.d.ts.map b/tools/ui/node_modules/import-meta-resolve/lib/utils.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4d416be8005de6358b0fabb87d9b35d8269e4680 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,8CAHW,KAAK,CAAC,MAAM,CAAC,GACX,GAAG,CAAC,MAAM,CAAC,CAgBvB"} \ No newline at end of file diff --git a/tools/ui/node_modules/import-meta-resolve/lib/utils.js b/tools/ui/node_modules/import-meta-resolve/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..1dc0e18c86d53e9690f90934d2712070d0a49b0e --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/lib/utils.js @@ -0,0 +1,47 @@ +// Manually “tree shaken” from: +// +// Last checked on: Apr 29, 2024. + +import {codes} from './errors.js' + +const {ERR_INVALID_ARG_VALUE} = codes + +// In Node itself these values are populated from CLI arguments, before any +// user code runs. +// Here we just define the defaults. +const DEFAULT_CONDITIONS = Object.freeze(['node', 'import']) +const DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS) + +/** + * Returns the default conditions for ES module loading. + */ +function getDefaultConditions() { + return DEFAULT_CONDITIONS +} + +/** + * Returns the default conditions for ES module loading, as a Set. + */ +function getDefaultConditionsSet() { + return DEFAULT_CONDITIONS_SET +} + +/** + * @param {Array} [conditions] + * @returns {Set} + */ +export function getConditionsSet(conditions) { + if (conditions !== undefined && conditions !== getDefaultConditions()) { + if (!Array.isArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE( + 'conditions', + conditions, + 'expected an array' + ) + } + + return new Set(conditions) + } + + return getDefaultConditionsSet() +} diff --git a/tools/ui/node_modules/import-meta-resolve/license b/tools/ui/node_modules/import-meta-resolve/license new file mode 100644 index 0000000000000000000000000000000000000000..ac5ee2364b902ddb4d5cc857df43dd0682e0587a --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/license @@ -0,0 +1,74 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +This is a derivative work based on: +. +Which is licensed: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/tools/ui/node_modules/import-meta-resolve/package.json b/tools/ui/node_modules/import-meta-resolve/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3fed8b458d46458422702f7edd77a61165b927b9 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/package.json @@ -0,0 +1,78 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/wooorm/import-meta-resolve/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "description": "Resolve things like Node.js — ponyfill for `import.meta.resolve`", + "devDependencies": { + "@types/node": "^24.0.0", + "@types/semver": "^7.0.0", + "c8": "^10.0.0", + "f-ck": "^2.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^11.0.0", + "semver": "^7.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^1.0.0" + }, + "files": [ + "index.d.ts.map", + "index.d.ts", + "index.js", + "lib/" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "keywords": [ + "esm", + "module", + "node", + "resolve" + ], + "license": "MIT", + "main": "index.js", + "name": "import-meta-resolve", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm", + [ + "remark-lint-maximum-heading-length", + false + ] + ] + }, + "repository": "wooorm/import-meta-resolve", + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark --frail --quiet --output -- . && prettier --write --log-level warn -- . && xo --fix", + "generate": "node --conditions development script.js", + "prepack": "npm run generate && npm run build && npm run format", + "test-api": "node --experimental-import-meta-resolve test/baseline.js && node --experimental-import-meta-resolve test/baseline-async.js && node test/index.js", + "test-coverage": "c8 --branches 75 --functions 75 --lines 75 --statements 75 --reporter lcov -- npm run test-api", + "test": "npm run generate && npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "strict": true, + "ignoreFiles": [ + "lib/errors.d.ts" + ] + }, + "types": "index.d.ts", + "type": "module", + "version": "4.2.0" +} diff --git a/tools/ui/node_modules/import-meta-resolve/readme.md b/tools/ui/node_modules/import-meta-resolve/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..749ee34268bb039e639e6dda42e23bb23540a730 --- /dev/null +++ b/tools/ui/node_modules/import-meta-resolve/readme.md @@ -0,0 +1,252 @@ +# import-meta-resolve + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] + +Resolve things like Node.js. + +## Contents + +* [What is this?](#what-is-this) +* [When to use this?](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`resolve(specifier, parent)`](#resolvespecifier-parent) + * [`moduleResolve(specifier, parent, conditions, preserveSymlinks)`](#moduleresolvespecifier-parent-conditions-preservesymlinks) + * [`ErrnoException`](#errnoexception) +* [Algorithm](#algorithm) +* [Differences to Node](#differences-to-node) +* [Types](#types) +* [Compatibility](#compatibility) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a ponyfill for [`import.meta.resolve`][native-resolve]. +It supports everything you need to resolve files just like modern Node does: +import maps, export maps, loading CJS and ESM projects, all of that! + +## When to use this? + +As of Node.js 20.0, `import.meta.resolve` is still behind an experimental flag. +This package can be used to do what it does in Node 16–20. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install import-meta-resolve +``` + +## Use + +```js +import {resolve} from 'import-meta-resolve' + +// A file: +console.log(resolve('./index.js', import.meta.url)) +//=> file:///Users/tilde/Projects/oss/import-meta-resolve/index.js + +// A CJS package: +console.log(resolve('builtins', import.meta.url)) +//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/builtins/index.js + +// A scoped CJS package: +console.log(resolve('@eslint/eslintrc', import.meta.url)) +//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/@eslint/eslintrc/lib/index.js + +// A package with an export map: +console.log(resolve('micromark/lib/parse', import.meta.url)) +//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/micromark/lib/parse.js + +// A node builtin: +console.log(resolve('fs', import.meta.url)) +//=> node:fs +``` + +## API + +This package exports the identifiers [`moduleResolve`][moduleresolve] and +[`resolve`][resolve]. +There is no default export. + +### `resolve(specifier, parent)` + +Match `import.meta.resolve` except that `parent` is required (you can pass +`import.meta.url`). + +###### Parameters + +* `specifier` (`string`) + — the module specifier to resolve relative to parent + (`/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc) +* `parent` (`string`, example: `import.meta.url`) + — the absolute parent module URL to resolve from; you must pass + `import.meta.url` or something else + +###### Returns + +Full `file:`, `data:`, or `node:` URL (`string`) to the found thing + +###### Throws + +Throws an [`ErrnoException`][errnoexception]. + +### `moduleResolve(specifier, parent, conditions, preserveSymlinks)` + +The [“Resolver Algorithm Specification”][algo] as detailed in the Node docs +(which is slightly lower-level than `resolve`). + +###### Parameters + +* `specifier` (`string`) + — `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc +* `parent` (`URL`, example: `import.meta.url`) + — full URL (to a file) that `specifier` is resolved relative from +* `conditions` (`Set`, default: `new Set(['node', 'import'])`) + — conditions +* `preserveSymlinks` (`boolean`, default: `false`) + — keep symlinks instead of resolving them + +###### Returns + +A URL object (`URL`) to the found thing. + +###### Throws + +Throws an [`ErrnoException`][errnoexception]. + +### `ErrnoException` + +One of many different errors that occur when resolving (TypeScript type). + +###### Type + +```ts +type ErrnoExceptionFields = Error & { + errnode?: number | undefined + code?: string | undefined + path?: string | undefined + syscall?: string | undefined + url?: string | undefined +} +``` + +The `code` field on errors is one of the following strings: + +* `'ERR_INVALID_MODULE_SPECIFIER'` + — when `specifier` is invalid (example: `'#'`) +* `'ERR_INVALID_PACKAGE_CONFIG'` + — when a `package.json` is invalid (example: invalid JSON) +* `'ERR_INVALID_PACKAGE_TARGET'` + — when a `package.json` `exports` or `imports` is invalid (example: when it + does not start with `'./'`) +* `'ERR_MODULE_NOT_FOUND'` + — when `specifier` cannot be found in `parent` (example: `'some-missing-package'`) +* `'ERR_NETWORK_IMPORT_DISALLOWED'` + — thrown when trying to resolve a local file or builtin from a remote file + (`node:fs` relative to `'https://example.com'`) +* `'ERR_PACKAGE_IMPORT_NOT_DEFINED'` + — when a local import is not defined in an import map (example: `'#local'` + when not defined) +* `'ERR_PACKAGE_PATH_NOT_EXPORTED'` + — when an export is not defined in an export map (example: `'tape/index.js'`, + which is not in its export map) +* `'ERR_UNSUPPORTED_DIR_IMPORT'` + — when attempting to import a directory (example: `'./lib/'`) +* `'ERR_UNKNOWN_FILE_EXTENSION'` + — when somehow reading a file that has an unexpected extensions (`'./readme.md'`) +* `'ERR_INVALID_ARG_VALUE'` + — when `conditions` is incorrect + +## Algorithm + +The algorithm for `resolve` matches how Node handles `import.meta.resolve`, with +a couple of differences. + +The algorithm for `moduleResolve` matches the [Resolver Algorithm +Specification][algo] as detailed in the Node docs (which is sync and slightly +lower-level than `resolve`). + +## Differences to Node + +* `parent` defaulting to `import.meta.url` cannot be ponyfilled: you have to + explicitly pass it +* no support for loaders (that would mean implementing all of loaders) +* no support for CLI flags: + `--conditions`, + `--experimental-default-type`, + `--experimental-json-modules`, + `--experimental-network-imports`, + `--experimental-policy`, + `--experimental-wasm-modules`, + `--input-type`, + `--no-addons`, + `--preserve-symlinks`, nor + `--preserve-symlinks-main` + work +* no support for `WATCH_REPORT_DEPENDENCIES` env variable +* no attempt is made to add a suggestion based on how things used to work in + CJS before to not-found errors +* prototypal methods are not guarded: Node protects for example `String#slice` + or so from being tampered with, whereas this doesn’t + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional type [`ErrnoException`][errnoexception]. + +## Compatibility + +This package is at least compatible with all maintained versions of Node.js. +As of now, that is Node.js 16 and later. + +## Contribute + +Yes please! +See [How to Contribute to Open Source][contribute]. + +## License + +[MIT][license] © [Titus Wormer][author] and Node.js contributors + + + +[algo]: https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm + +[author]: https://wooorm.com + +[build]: https://github.com/wooorm/import-meta-resolve/actions + +[build-badge]: https://github.com/wooorm/import-meta-resolve/workflows/main/badge.svg + +[contribute]: https://opensource.guide/how-to-contribute/ + +[coverage]: https://codecov.io/github/wooorm/import-meta-resolve + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/import-meta-resolve.svg + +[downloads]: https://www.npmjs.com/package/import-meta-resolve + +[downloads-badge]: https://img.shields.io/npm/dm/import-meta-resolve.svg + +[errnoexception]: #errnoexception + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[license]: license + +[moduleresolve]: #moduleResolvespecifier-parent-conditions-preserveSymlinks + +[native-resolve]: https://nodejs.org/api/esm.html#esm_import_meta_resolve_specifier_parent + +[npm]: https://docs.npmjs.com/cli/install + +[resolve]: #resolvespecifier-parent + +[typescript]: https://www.typescriptlang.org diff --git a/tools/ui/node_modules/imurmurhash/README.md b/tools/ui/node_modules/imurmurhash/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f35b20a0ef5bfeb5e8159dae696f8d5034bb3bf1 --- /dev/null +++ b/tools/ui/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/imurmurhash/imurmurhash.js b/tools/ui/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 0000000000000000000000000000000000000000..e63146a2b7e70b6e270fb277fb933b1657669ab8 --- /dev/null +++ b/tools/ui/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/tools/ui/node_modules/imurmurhash/imurmurhash.min.js b/tools/ui/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 0000000000000000000000000000000000000000..dc0ee88d6b69c97b7e2389a58fc09e675e6f415f --- /dev/null +++ b/tools/ui/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/tools/ui/node_modules/imurmurhash/package.json b/tools/ui/node_modules/imurmurhash/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8a93edb55a22452c643c85e6ad8e8a8bf0a3fad9 --- /dev/null +++ b/tools/ui/node_modules/imurmurhash/package.json @@ -0,0 +1,40 @@ +{ + "name": "imurmurhash", + "version": "0.1.4", + "description": "An incremental implementation of MurmurHash3", + "homepage": "https://github.com/jensyt/imurmurhash-js", + "main": "imurmurhash.js", + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "repository": { + "type": "git", + "url": "https://github.com/jensyt/imurmurhash-js" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "license": "MIT", + "dependencies": { + }, + "devDependencies": { + }, + "engines": { + "node": ">=0.8.19" + } +} diff --git a/tools/ui/node_modules/indent-string/index.d.ts b/tools/ui/node_modules/indent-string/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..118523115645a025b393592282d744b82e5b3159 --- /dev/null +++ b/tools/ui/node_modules/indent-string/index.d.ts @@ -0,0 +1,42 @@ +declare namespace indentString { + interface Options { + /** + The string to use for the indent. + + @default ' ' + */ + readonly indent?: string; + + /** + Also indent empty lines. + + @default false + */ + readonly includeEmptyLines?: boolean; + } +} + +/** +Indent each line in a string. + +@param string - The string to indent. +@param count - How many times you want `options.indent` repeated. Default: `1`. + +@example +``` +import indentString = require('indent-string'); + +indentString('Unicorns\nRainbows', 4); +//=> ' Unicorns\n Rainbows' + +indentString('Unicorns\nRainbows', 4, {indent: '♥'}); +//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows' +``` +*/ +declare function indentString( + string: string, + count?: number, + options?: indentString.Options +): string; + +export = indentString; diff --git a/tools/ui/node_modules/indent-string/index.js b/tools/ui/node_modules/indent-string/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e1ab804f2fd8a15f93c6556fed470aa87c5a37e3 --- /dev/null +++ b/tools/ui/node_modules/indent-string/index.js @@ -0,0 +1,35 @@ +'use strict'; + +module.exports = (string, count = 1, options) => { + options = { + indent: ' ', + includeEmptyLines: false, + ...options + }; + + if (typeof string !== 'string') { + throw new TypeError( + `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` + ); + } + + if (typeof count !== 'number') { + throw new TypeError( + `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` + ); + } + + if (typeof options.indent !== 'string') { + throw new TypeError( + `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` + ); + } + + if (count === 0) { + return string; + } + + const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + + return string.replace(regex, options.indent.repeat(count)); +}; diff --git a/tools/ui/node_modules/indent-string/license b/tools/ui/node_modules/indent-string/license new file mode 100644 index 0000000000000000000000000000000000000000..e7af2f77107d73046421ef56c4684cbfdd3c1e89 --- /dev/null +++ b/tools/ui/node_modules/indent-string/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/indent-string/package.json b/tools/ui/node_modules/indent-string/package.json new file mode 100644 index 0000000000000000000000000000000000000000..497bb83bbd9b7f468081d0f8ce69f0c8cd547454 --- /dev/null +++ b/tools/ui/node_modules/indent-string/package.json @@ -0,0 +1,37 @@ +{ + "name": "indent-string", + "version": "4.0.0", + "description": "Indent each line in a string", + "license": "MIT", + "repository": "sindresorhus/indent-string", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "indent", + "string", + "pad", + "align", + "line", + "text", + "each", + "every" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/tools/ui/node_modules/indent-string/readme.md b/tools/ui/node_modules/indent-string/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..49967de074f2fd109cdb550a468e83ed579a668b --- /dev/null +++ b/tools/ui/node_modules/indent-string/readme.md @@ -0,0 +1,70 @@ +# indent-string [![Build Status](https://travis-ci.org/sindresorhus/indent-string.svg?branch=master)](https://travis-ci.org/sindresorhus/indent-string) + +> Indent each line in a string + + +## Install + +``` +$ npm install indent-string +``` + + +## Usage + +```js +const indentString = require('indent-string'); + +indentString('Unicorns\nRainbows', 4); +//=> ' Unicorns\n Rainbows' + +indentString('Unicorns\nRainbows', 4, {indent: '♥'}); +//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows' +``` + + +## API + +### indentString(string, [count], [options]) + +#### string + +Type: `string` + +The string to indent. + +#### count + +Type: `number`
+Default: `1` + +How many times you want `options.indent` repeated. + +#### options + +Type: `object` + +##### indent + +Type: `string`
+Default: `' '` + +The string to use for the indent. + +##### includeEmptyLines + +Type: `boolean`
+Default: `false` + +Also indent empty lines. + + +## Related + +- [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - CLI for this module +- [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from every line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/ui/node_modules/inherits/LICENSE b/tools/ui/node_modules/inherits/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..dea3013d6710ee273f49ac606a65d5211d480c88 --- /dev/null +++ b/tools/ui/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/tools/ui/node_modules/inherits/README.md b/tools/ui/node_modules/inherits/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b1c56658557b8162aa9f5ba8610ed03a5e558d9d --- /dev/null +++ b/tools/ui/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/tools/ui/node_modules/inherits/inherits.js b/tools/ui/node_modules/inherits/inherits.js new file mode 100644 index 0000000000000000000000000000000000000000..f71f2d93294a67ad5d9300aae07973e259f26068 --- /dev/null +++ b/tools/ui/node_modules/inherits/inherits.js @@ -0,0 +1,9 @@ +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = require('./inherits_browser.js'); +} diff --git a/tools/ui/node_modules/inherits/inherits_browser.js b/tools/ui/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000000000000000000000000000000000000..86bbb3dc29e4847df14de2c2b4b168e065184643 --- /dev/null +++ b/tools/ui/node_modules/inherits/inherits_browser.js @@ -0,0 +1,27 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} diff --git a/tools/ui/node_modules/inherits/package.json b/tools/ui/node_modules/inherits/package.json new file mode 100644 index 0000000000000000000000000000000000000000..37b4366b83e63e037cd447090ec25b39fce27e01 --- /dev/null +++ b/tools/ui/node_modules/inherits/package.json @@ -0,0 +1,29 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.4", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": "git://github.com/isaacs/inherits", + "license": "ISC", + "scripts": { + "test": "tap" + }, + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ] +} diff --git a/tools/ui/node_modules/inline-style-parser/LICENSE b/tools/ui/node_modules/inline-style-parser/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0239d9c6c02d5b622a68103b2eaa44c7817ff936 --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/LICENSE @@ -0,0 +1,9 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/inline-style-parser/README.md b/tools/ui/node_modules/inline-style-parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fa69b0babb23ec74f9705271a5fd29b12977804f --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/README.md @@ -0,0 +1,229 @@ +# inline-style-parser + +[![NPM](https://nodei.co/npm/inline-style-parser.png)](https://nodei.co/npm/inline-style-parser/) + +[![NPM version](https://img.shields.io/npm/v/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser) +[![NPM bundle size](https://img.shields.io/bundlephobia/minzip/inline-style-parser)](https://bundlephobia.com/package/inline-style-parser) +[![build](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml) +[![codecov](https://codecov.io/gh/remarkablemark/inline-style-parser/branch/master/graph/badge.svg?token=B8EEK5709W)](https://codecov.io/gh/remarkablemark/inline-style-parser) +[![NPM downloads](https://img.shields.io/npm/dm/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser) + +Inline style parser copied from [`css/lib/parse/index.js`](https://github.com/reworkcss/css/blob/v2.2.4/lib/parse/index.js): + +``` +InlineStyleParser(string) +``` + +Example: + +```js +const parse = require('inline-style-parser'); + +parse('color: #BADA55;'); +``` + +Output: + +```js +[ { type: 'declaration', + property: 'color', + value: '#BADA55', + position: Position { start: [Object], end: [Object], source: undefined } } ] +``` + +[JSFiddle](https://jsfiddle.net/remarkablemark/hcxbpwq8/) | [Examples](https://github.com/remarkablemark/inline-style-parser/tree/master/examples) + +## Installation + +[NPM](https://www.npmjs.com/package/inline-style-parser): + +```sh +npm install inline-style-parser --save +``` + +[Yarn](https://yarnpkg.com/package/inline-style-parser): + +```sh +yarn add inline-style-parser +``` + +[CDN](https://unpkg.com/inline-style-parser/): + +```html + + +``` + +## Usage + +Import with ES Modules: + +```js +import parse from 'inline-style-parser'; +``` + +Or require with CommonJS: + +```js +const parse = require('inline-style-parser'); +``` + +Parse single declaration: + +```js +parse('left: 0'); +``` + +Output: + +```js +[ + { + type: 'declaration', + property: 'left', + value: '0', + position: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 8 }, + source: undefined + } + } +] +``` + +Parse multiple declarations: + +```js +parse('left: 0; right: 100px;'); +``` + +Output: + +```js +[ + { + type: 'declaration', + property: 'left', + value: '0', + position: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 8 }, + source: undefined + } + }, + { + type: 'declaration', + property: 'right', + value: '100px', + position: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 22 }, + source: undefined + } + } +] +``` + +Parse declaration with missing value: + +```js +parse('top:'); +``` + +Output: + +```js +[ + { + type: 'declaration', + property: 'top', + value: '', + position: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 5 }, + source: undefined + } + } +] +``` + +Parse unknown declaration: + +```js +parse('answer: 42;'); +``` + +Output: + +```js +[ + { + type: 'declaration', + property: 'answer', + value: '42', + position: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 11 }, + source: undefined + } + } +] +``` + +Invalid declarations: + +```js +parse(''); // [] +parse(); // throws TypeError +parse(1); // throws TypeError +parse('width'); // throws Error +parse('/*'); // throws Error +``` + +## Testing + +Run tests: + +```sh +npm test +``` + +Run tests in watch mode: + +```sh +npm run test:watch +``` + +Run tests with coverage: + +```sh +npm run test:coverage +``` + +Run tests in CI mode: + +```sh +npm run test:ci +``` + +Lint files: + +```sh +npm run lint +``` + +Fix lint errors: + +```sh +npm run lint:fix +``` + +## Release + +Release and publish are automated by [Release Please](https://github.com/googleapis/release-please). + +## License + +[MIT](https://github.com/remarkablemark/inline-style-parser/blob/master/LICENSE). See the [license](https://github.com/reworkcss/css/blob/v2.2.4/LICENSE) from the original project. diff --git a/tools/ui/node_modules/inline-style-parser/cjs/index.d.cts b/tools/ui/node_modules/inline-style-parser/cjs/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..5349435adeb4532229c5dde5cd7c062adf10e940 --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/cjs/index.d.cts @@ -0,0 +1,34 @@ +interface Position { + start: { + line: number; + column: number; + }; + end: { + line: number; + column: number; + }; + source?: string; +} + +export interface Declaration { + type: 'declaration'; + property: string; + value: string; + position: Position; +} + +export interface Comment { + type: 'comment'; + comment: string; + position: Position; +} + +interface Options { + source?: string; + silent?: boolean; +} + +export default function InlineStyleParser( + style: string, + options?: Options +): (Declaration | Comment)[]; diff --git a/tools/ui/node_modules/inline-style-parser/cjs/index.js b/tools/ui/node_modules/inline-style-parser/cjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d57cabd2b63cbbfcc5a0e0e94d3be61fc5b42f22 --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/cjs/index.js @@ -0,0 +1,262 @@ +'use strict'; + +// http://www.w3.org/TR/CSS21/grammar.html +// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027 +var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; + +var NEWLINE_REGEX = /\n/g; +var WHITESPACE_REGEX = /^\s*/; + +// declaration +var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; +var COLON_REGEX = /^:\s*/; +var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; +var SEMICOLON_REGEX = /^[;\s]*/; + +// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill +var TRIM_REGEX = /^\s+|\s+$/g; + +// strings +var NEWLINE = '\n'; +var FORWARD_SLASH = '/'; +var ASTERISK = '*'; +var EMPTY_STRING = ''; + +// types +var TYPE_COMMENT = 'comment'; +var TYPE_DECLARATION = 'declaration'; + +/** + * @param {String} style + * @param {Object} [options] + * @return {Object[]} + * @throws {TypeError} + * @throws {Error} + */ +function index (style, options) { + if (typeof style !== 'string') { + throw new TypeError('First argument must be a string'); + } + + if (!style) return []; + + options = options || {}; + + /** + * Positional. + */ + var lineno = 1; + var column = 1; + + /** + * Update lineno and column based on `str`. + * + * @param {String} str + */ + function updatePosition(str) { + var lines = str.match(NEWLINE_REGEX); + if (lines) lineno += lines.length; + var i = str.lastIndexOf(NEWLINE); + column = ~i ? str.length - i : column + str.length; + } + + /** + * Mark position and patch `node.position`. + * + * @return {Function} + */ + function position() { + var start = { line: lineno, column: column }; + return function (node) { + node.position = new Position(start); + whitespace(); + return node; + }; + } + + /** + * Store position information for a node. + * + * @constructor + * @property {Object} start + * @property {Object} end + * @property {undefined|String} source + */ + function Position(start) { + this.start = start; + this.end = { line: lineno, column: column }; + this.source = options.source; + } + + /** + * Non-enumerable source string. + */ + Position.prototype.content = style; + + /** + * Error `msg`. + * + * @param {String} msg + * @throws {Error} + */ + function error(msg) { + var err = new Error( + options.source + ':' + lineno + ':' + column + ': ' + msg + ); + err.reason = msg; + err.filename = options.source; + err.line = lineno; + err.column = column; + err.source = style; + + if (options.silent) ; else { + throw err; + } + } + + /** + * Match `re` and return captures. + * + * @param {RegExp} re + * @return {undefined|Array} + */ + function match(re) { + var m = re.exec(style); + if (!m) return; + var str = m[0]; + updatePosition(str); + style = style.slice(str.length); + return m; + } + + /** + * Parse whitespace. + */ + function whitespace() { + match(WHITESPACE_REGEX); + } + + /** + * Parse comments. + * + * @param {Object[]} [rules] + * @return {Object[]} + */ + function comments(rules) { + var c; + rules = rules || []; + while ((c = comment())) { + if (c !== false) { + rules.push(c); + } + } + return rules; + } + + /** + * Parse comment. + * + * @return {Object} + * @throws {Error} + */ + function comment() { + var pos = position(); + if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return; + + var i = 2; + while ( + EMPTY_STRING != style.charAt(i) && + (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1)) + ) { + ++i; + } + i += 2; + + if (EMPTY_STRING === style.charAt(i - 1)) { + return error('End of comment missing'); + } + + var str = style.slice(2, i - 2); + column += 2; + updatePosition(str); + style = style.slice(i); + column += 2; + + return pos({ + type: TYPE_COMMENT, + comment: str + }); + } + + /** + * Parse declaration. + * + * @return {Object} + * @throws {Error} + */ + function declaration() { + var pos = position(); + + // prop + var prop = match(PROPERTY_REGEX); + if (!prop) return; + comment(); + + // : + if (!match(COLON_REGEX)) return error("property missing ':'"); + + // val + var val = match(VALUE_REGEX); + + var ret = pos({ + type: TYPE_DECLARATION, + property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), + value: val + ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) + : EMPTY_STRING + }); + + // ; + match(SEMICOLON_REGEX); + + return ret; + } + + /** + * Parse declarations. + * + * @return {Object[]} + */ + function declarations() { + var decls = []; + + comments(decls); + + // declarations + var decl; + while ((decl = declaration())) { + if (decl !== false) { + decls.push(decl); + comments(decls); + } + } + + return decls; + } + + whitespace(); + return declarations(); +} + +/** + * Trim `str`. + * + * @param {String} str + * @return {String} + */ +function trim(str) { + return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; +} + +module.exports = index; +//# sourceMappingURL=index.js.map diff --git a/tools/ui/node_modules/inline-style-parser/cjs/index.js.map b/tools/ui/node_modules/inline-style-parser/cjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..4d532caf033390555fdcc64b309725771a6a7ed6 --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../index.js"],"sourcesContent":["// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nexport default function (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n}\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA,IAAI,aAAa,GAAG,iCAAiC;;AAErD,IAAI,aAAa,GAAG,KAAK;AACzB,IAAI,gBAAgB,GAAG,MAAM;;AAE7B;AACA,IAAI,cAAc,GAAG,wCAAwC;AAC7D,IAAI,WAAW,GAAG,OAAO;AACzB,IAAI,WAAW,GAAG,sDAAsD;AACxE,IAAI,eAAe,GAAG,SAAS;;AAE/B;AACA,IAAI,UAAU,GAAG,YAAY;;AAE7B;AACA,IAAI,OAAO,GAAG,IAAI;AAClB,IAAI,aAAa,GAAG,GAAG;AACvB,IAAI,QAAQ,GAAG,GAAG;AAClB,IAAI,YAAY,GAAG,EAAE;;AAErB;AACA,IAAI,YAAY,GAAG,SAAS;AAC5B,IAAI,gBAAgB,GAAG,aAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,cAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;AACzC,EAAE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjC,IAAI,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC;AAC1D,EAAE;;AAEF,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE;;AAEvB,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE;;AAEzB;AACA;AACA;AACA,EAAE,IAAI,MAAM,GAAG,CAAC;AAChB,EAAE,IAAI,MAAM,GAAG,CAAC;;AAEhB;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,cAAc,CAAC,GAAG,EAAE;AAC/B,IAAI,IAAI,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC;AACxC,IAAI,IAAI,KAAK,EAAE,MAAM,IAAI,KAAK,CAAC,MAAM;AACrC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC;AACpC,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,MAAM;AACtD,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,QAAQ,GAAG;AACtB,IAAI,IAAI,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AAChD,IAAI,OAAO,UAAU,IAAI,EAAE;AAC3B,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC;AACzC,MAAM,UAAU,EAAE;AAClB,MAAM,OAAO,IAAI;AACjB,IAAI,CAAC;AACL,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC3B,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK;AACtB,IAAI,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AAC/C,IAAI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;AAChC,EAAE;;AAEF;AACA;AACA;AACA,EAAE,QAAQ,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK;;AAIpC;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,KAAK,CAAC,GAAG,EAAE;AACtB,IAAI,IAAI,GAAG,GAAG,IAAI,KAAK;AACvB,MAAM,OAAO,CAAC,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG;AAC5D,KAAK;AACL,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG;AACpB,IAAI,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM;AACjC,IAAI,GAAG,CAAC,IAAI,GAAG,MAAM;AACrB,IAAI,GAAG,CAAC,MAAM,GAAG,MAAM;AACvB,IAAI,GAAG,CAAC,MAAM,GAAG,KAAK;;AAEtB,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAEnB,MAAM;AACX,MAAM,MAAM,GAAG;AACf,IAAI;AACJ,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,KAAK,CAAC,EAAE,EAAE;AACrB,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1B,IAAI,IAAI,CAAC,CAAC,EAAE;AACZ,IAAI,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAClB,IAAI,cAAc,CAAC,GAAG,CAAC;AACvB,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;AACnC,IAAI,OAAO,CAAC;AACZ,EAAE;;AAEF;AACA;AACA;AACA,EAAE,SAAS,UAAU,GAAG;AACxB,IAAI,KAAK,CAAC,gBAAgB,CAAC;AAC3B,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC3B,IAAI,IAAI,CAAC;AACT,IAAI,KAAK,GAAG,KAAK,IAAI,EAAE;AACvB,IAAI,QAAQ,CAAC,GAAG,OAAO,EAAE,GAAG;AAC5B,MAAM,IAAI,CAAC,KAAK,KAAK,EAAE;AACvB,QAAQ,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACrB,MAAM;AACN,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,OAAO,GAAG;AACrB,IAAI,IAAI,GAAG,GAAG,QAAQ,EAAE;AACxB,IAAI,IAAI,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;;AAEzE,IAAI,IAAI,CAAC,GAAG,CAAC;AACb,IAAI;AACJ,MAAM,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACrC,OAAO,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1E,MAAM;AACN,MAAM,EAAE,CAAC;AACT,IAAI;AACJ,IAAI,CAAC,IAAI,CAAC;;AAEV,IAAI,IAAI,YAAY,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;AAC9C,MAAM,OAAO,KAAK,CAAC,wBAAwB,CAAC;AAC5C,IAAI;;AAEJ,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AACnC,IAAI,MAAM,IAAI,CAAC;AACf,IAAI,cAAc,CAAC,GAAG,CAAC;AACvB,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1B,IAAI,MAAM,IAAI,CAAC;;AAEf,IAAI,OAAO,GAAG,CAAC;AACf,MAAM,IAAI,EAAE,YAAY;AACxB,MAAM,OAAO,EAAE;AACf,KAAK,CAAC;AACN,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,WAAW,GAAG;AACzB,IAAI,IAAI,GAAG,GAAG,QAAQ,EAAE;;AAExB;AACA,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC;AACpC,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,IAAI,OAAO,EAAE;;AAEb;AACA,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,KAAK,CAAC,sBAAsB,CAAC;;AAEjE;AACA,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC;;AAEhC,IAAI,IAAI,GAAG,GAAG,GAAG,CAAC;AAClB,MAAM,IAAI,EAAE,gBAAgB;AAC5B,MAAM,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;AAClE,MAAM,KAAK,EAAE;AACb,UAAU,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC;AAC1D,UAAU;AACV,KAAK,CAAC;;AAEN;AACA,IAAI,KAAK,CAAC,eAAe,CAAC;;AAE1B,IAAI,OAAO,GAAG;AACd,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,YAAY,GAAG;AAC1B,IAAI,IAAI,KAAK,GAAG,EAAE;;AAElB,IAAI,QAAQ,CAAC,KAAK,CAAC;;AAEnB;AACA,IAAI,IAAI,IAAI;AACZ,IAAI,QAAQ,IAAI,GAAG,WAAW,EAAE,GAAG;AACnC,MAAM,IAAI,IAAI,KAAK,KAAK,EAAE;AAC1B,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AACxB,QAAQ,QAAQ,CAAC,KAAK,CAAC;AACvB,MAAM;AACN,IAAI;;AAEJ,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,UAAU,EAAE;AACd,EAAE,OAAO,YAAY,EAAE;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,EAAE,OAAO,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,YAAY;AACnE;;;;"} \ No newline at end of file diff --git a/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.js b/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.js new file mode 100644 index 0000000000000000000000000000000000000000..bf0d441d2dc1ce581ce1517129a8be33459a9ff1 --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.js @@ -0,0 +1,268 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.InlineStyleParser = factory()); +})(this, (function () { 'use strict'; + + // http://www.w3.org/TR/CSS21/grammar.html + // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027 + var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; + + var NEWLINE_REGEX = /\n/g; + var WHITESPACE_REGEX = /^\s*/; + + // declaration + var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; + var COLON_REGEX = /^:\s*/; + var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; + var SEMICOLON_REGEX = /^[;\s]*/; + + // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill + var TRIM_REGEX = /^\s+|\s+$/g; + + // strings + var NEWLINE = '\n'; + var FORWARD_SLASH = '/'; + var ASTERISK = '*'; + var EMPTY_STRING = ''; + + // types + var TYPE_COMMENT = 'comment'; + var TYPE_DECLARATION = 'declaration'; + + /** + * @param {String} style + * @param {Object} [options] + * @return {Object[]} + * @throws {TypeError} + * @throws {Error} + */ + function index (style, options) { + if (typeof style !== 'string') { + throw new TypeError('First argument must be a string'); + } + + if (!style) return []; + + options = options || {}; + + /** + * Positional. + */ + var lineno = 1; + var column = 1; + + /** + * Update lineno and column based on `str`. + * + * @param {String} str + */ + function updatePosition(str) { + var lines = str.match(NEWLINE_REGEX); + if (lines) lineno += lines.length; + var i = str.lastIndexOf(NEWLINE); + column = ~i ? str.length - i : column + str.length; + } + + /** + * Mark position and patch `node.position`. + * + * @return {Function} + */ + function position() { + var start = { line: lineno, column: column }; + return function (node) { + node.position = new Position(start); + whitespace(); + return node; + }; + } + + /** + * Store position information for a node. + * + * @constructor + * @property {Object} start + * @property {Object} end + * @property {undefined|String} source + */ + function Position(start) { + this.start = start; + this.end = { line: lineno, column: column }; + this.source = options.source; + } + + /** + * Non-enumerable source string. + */ + Position.prototype.content = style; + + /** + * Error `msg`. + * + * @param {String} msg + * @throws {Error} + */ + function error(msg) { + var err = new Error( + options.source + ':' + lineno + ':' + column + ': ' + msg + ); + err.reason = msg; + err.filename = options.source; + err.line = lineno; + err.column = column; + err.source = style; + + if (options.silent) ; else { + throw err; + } + } + + /** + * Match `re` and return captures. + * + * @param {RegExp} re + * @return {undefined|Array} + */ + function match(re) { + var m = re.exec(style); + if (!m) return; + var str = m[0]; + updatePosition(str); + style = style.slice(str.length); + return m; + } + + /** + * Parse whitespace. + */ + function whitespace() { + match(WHITESPACE_REGEX); + } + + /** + * Parse comments. + * + * @param {Object[]} [rules] + * @return {Object[]} + */ + function comments(rules) { + var c; + rules = rules || []; + while ((c = comment())) { + if (c !== false) { + rules.push(c); + } + } + return rules; + } + + /** + * Parse comment. + * + * @return {Object} + * @throws {Error} + */ + function comment() { + var pos = position(); + if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return; + + var i = 2; + while ( + EMPTY_STRING != style.charAt(i) && + (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1)) + ) { + ++i; + } + i += 2; + + if (EMPTY_STRING === style.charAt(i - 1)) { + return error('End of comment missing'); + } + + var str = style.slice(2, i - 2); + column += 2; + updatePosition(str); + style = style.slice(i); + column += 2; + + return pos({ + type: TYPE_COMMENT, + comment: str + }); + } + + /** + * Parse declaration. + * + * @return {Object} + * @throws {Error} + */ + function declaration() { + var pos = position(); + + // prop + var prop = match(PROPERTY_REGEX); + if (!prop) return; + comment(); + + // : + if (!match(COLON_REGEX)) return error("property missing ':'"); + + // val + var val = match(VALUE_REGEX); + + var ret = pos({ + type: TYPE_DECLARATION, + property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), + value: val + ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) + : EMPTY_STRING + }); + + // ; + match(SEMICOLON_REGEX); + + return ret; + } + + /** + * Parse declarations. + * + * @return {Object[]} + */ + function declarations() { + var decls = []; + + comments(decls); + + // declarations + var decl; + while ((decl = declaration())) { + if (decl !== false) { + decls.push(decl); + comments(decls); + } + } + + return decls; + } + + whitespace(); + return declarations(); + } + + /** + * Trim `str`. + * + * @param {String} str + * @return {String} + */ + function trim(str) { + return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; + } + + return index; + +})); +//# sourceMappingURL=inline-style-parser.js.map diff --git a/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.js.map b/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5ce881d3f0773038612eb3fdb646cd624b3d3116 --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inline-style-parser.js","sources":["../index.js"],"sourcesContent":["// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nexport default function (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n}\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n"],"names":[],"mappings":";;;;;;EAAA;EACA;EACA,IAAI,aAAa,GAAG,iCAAiC;;EAErD,IAAI,aAAa,GAAG,KAAK;EACzB,IAAI,gBAAgB,GAAG,MAAM;;EAE7B;EACA,IAAI,cAAc,GAAG,wCAAwC;EAC7D,IAAI,WAAW,GAAG,OAAO;EACzB,IAAI,WAAW,GAAG,sDAAsD;EACxE,IAAI,eAAe,GAAG,SAAS;;EAE/B;EACA,IAAI,UAAU,GAAG,YAAY;;EAE7B;EACA,IAAI,OAAO,GAAG,IAAI;EAClB,IAAI,aAAa,GAAG,GAAG;EACvB,IAAI,QAAQ,GAAG,GAAG;EAClB,IAAI,YAAY,GAAG,EAAE;;EAErB;EACA,IAAI,YAAY,GAAG,SAAS;EAC5B,IAAI,gBAAgB,GAAG,aAAa;;EAEpC;EACA;EACA;EACA;EACA;EACA;EACA;EACe,cAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;EACzC,EAAE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;EACjC,IAAI,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC;EAC1D,EAAE;;EAEF,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE;;EAEvB,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE;;EAEzB;EACA;EACA;EACA,EAAE,IAAI,MAAM,GAAG,CAAC;EAChB,EAAE,IAAI,MAAM,GAAG,CAAC;;EAEhB;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,cAAc,CAAC,GAAG,EAAE;EAC/B,IAAI,IAAI,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC;EACxC,IAAI,IAAI,KAAK,EAAE,MAAM,IAAI,KAAK,CAAC,MAAM;EACrC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC;EACpC,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,MAAM;EACtD,EAAE;;EAEF;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,QAAQ,GAAG;EACtB,IAAI,IAAI,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;EAChD,IAAI,OAAO,UAAU,IAAI,EAAE;EAC3B,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC;EACzC,MAAM,UAAU,EAAE;EAClB,MAAM,OAAO,IAAI;EACjB,IAAI,CAAC;EACL,EAAE;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAE;EAC3B,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK;EACtB,IAAI,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;EAC/C,IAAI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;EAChC,EAAE;;EAEF;EACA;EACA;EACA,EAAE,QAAQ,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK;;EAIpC;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,KAAK,CAAC,GAAG,EAAE;EACtB,IAAI,IAAI,GAAG,GAAG,IAAI,KAAK;EACvB,MAAM,OAAO,CAAC,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG;EAC5D,KAAK;EACL,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG;EACpB,IAAI,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM;EACjC,IAAI,GAAG,CAAC,IAAI,GAAG,MAAM;EACrB,IAAI,GAAG,CAAC,MAAM,GAAG,MAAM;EACvB,IAAI,GAAG,CAAC,MAAM,GAAG,KAAK;;EAEtB,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAEnB,MAAM;EACX,MAAM,MAAM,GAAG;EACf,IAAI;EACJ,EAAE;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,KAAK,CAAC,EAAE,EAAE;EACrB,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;EAC1B,IAAI,IAAI,CAAC,CAAC,EAAE;EACZ,IAAI,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;EAClB,IAAI,cAAc,CAAC,GAAG,CAAC;EACvB,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;EACnC,IAAI,OAAO,CAAC;EACZ,EAAE;;EAEF;EACA;EACA;EACA,EAAE,SAAS,UAAU,GAAG;EACxB,IAAI,KAAK,CAAC,gBAAgB,CAAC;EAC3B,EAAE;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAE;EAC3B,IAAI,IAAI,CAAC;EACT,IAAI,KAAK,GAAG,KAAK,IAAI,EAAE;EACvB,IAAI,QAAQ,CAAC,GAAG,OAAO,EAAE,GAAG;EAC5B,MAAM,IAAI,CAAC,KAAK,KAAK,EAAE;EACvB,QAAQ,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;EACrB,MAAM;EACN,IAAI;EACJ,IAAI,OAAO,KAAK;EAChB,EAAE;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,OAAO,GAAG;EACrB,IAAI,IAAI,GAAG,GAAG,QAAQ,EAAE;EACxB,IAAI,IAAI,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;;EAEzE,IAAI,IAAI,CAAC,GAAG,CAAC;EACb,IAAI;EACJ,MAAM,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;EACrC,OAAO,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;EAC1E,MAAM;EACN,MAAM,EAAE,CAAC;EACT,IAAI;EACJ,IAAI,CAAC,IAAI,CAAC;;EAEV,IAAI,IAAI,YAAY,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;EAC9C,MAAM,OAAO,KAAK,CAAC,wBAAwB,CAAC;EAC5C,IAAI;;EAEJ,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;EACnC,IAAI,MAAM,IAAI,CAAC;EACf,IAAI,cAAc,CAAC,GAAG,CAAC;EACvB,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;EAC1B,IAAI,MAAM,IAAI,CAAC;;EAEf,IAAI,OAAO,GAAG,CAAC;EACf,MAAM,IAAI,EAAE,YAAY;EACxB,MAAM,OAAO,EAAE;EACf,KAAK,CAAC;EACN,EAAE;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,WAAW,GAAG;EACzB,IAAI,IAAI,GAAG,GAAG,QAAQ,EAAE;;EAExB;EACA,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC;EACpC,IAAI,IAAI,CAAC,IAAI,EAAE;EACf,IAAI,OAAO,EAAE;;EAEb;EACA,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,KAAK,CAAC,sBAAsB,CAAC;;EAEjE;EACA,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC;;EAEhC,IAAI,IAAI,GAAG,GAAG,GAAG,CAAC;EAClB,MAAM,IAAI,EAAE,gBAAgB;EAC5B,MAAM,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;EAClE,MAAM,KAAK,EAAE;EACb,UAAU,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC;EAC1D,UAAU;EACV,KAAK,CAAC;;EAEN;EACA,IAAI,KAAK,CAAC,eAAe,CAAC;;EAE1B,IAAI,OAAO,GAAG;EACd,EAAE;;EAEF;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,YAAY,GAAG;EAC1B,IAAI,IAAI,KAAK,GAAG,EAAE;;EAElB,IAAI,QAAQ,CAAC,KAAK,CAAC;;EAEnB;EACA,IAAI,IAAI,IAAI;EACZ,IAAI,QAAQ,IAAI,GAAG,WAAW,EAAE,GAAG;EACnC,MAAM,IAAI,IAAI,KAAK,KAAK,EAAE;EAC1B,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;EACxB,QAAQ,QAAQ,CAAC,KAAK,CAAC;EACvB,MAAM;EACN,IAAI;;EAEJ,IAAI,OAAO,KAAK;EAChB,EAAE;;EAEF,EAAE,UAAU,EAAE;EACd,EAAE,OAAO,YAAY,EAAE;EACvB;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,IAAI,CAAC,GAAG,EAAE;EACnB,EAAE,OAAO,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,YAAY;EACnE;;;;;;;;"} \ No newline at end of file diff --git a/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.min.js b/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.min.js new file mode 100644 index 0000000000000000000000000000000000000000..1ee27aa67231f243cf212fb7cb116b0c938f81ac --- /dev/null +++ b/tools/ui/node_modules/inline-style-parser/dist/inline-style-parser.min.js @@ -0,0 +1,2 @@ +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).InlineStyleParser=e()}(this,(function(){"use strict";var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,t=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,f="";function s(n){return n?n.replace(c,f):f}return function(c,a){if("string"!=typeof c)throw new TypeError("First argument must be a string");if(!c)return[];a=a||{};var l=1,p=1;function h(n){var r=n.match(e);r&&(l+=r.length);var t=n.lastIndexOf("\n");p=~t?n.length-t:p+n.length}function m(){var n={line:l,column:p};return function(e){return e.position=new v(n),y(),e}}function v(n){this.start=n,this.end={line:l,column:p},this.source=a.source}function d(n){var e=new Error(a.source+":"+l+":"+p+": "+n);if(e.reason=n,e.filename=a.source,e.line=l,e.column=p,e.source=c,!a.silent)throw e}function g(n){var e=n.exec(c);if(e){var r=e[0];return h(r),c=c.slice(r.length),e}}function y(){g(r)}function w(n){var e;for(n=n||[];e=A();)!1!==e&&n.push(e);return n}function A(){var n=m();if("/"==c.charAt(0)&&"*"==c.charAt(1)){for(var e=2;f!=c.charAt(e)&&("*"!=c.charAt(e)||"/"!=c.charAt(e+1));)++e;if(e+=2,f===c.charAt(e-1))return d("End of comment missing");var r=c.slice(2,e-2);return p+=2,h(r),c=c.slice(e),p+=2,n({type:"comment",comment:r})}}function b(){var e=m(),r=g(t);if(r){if(A(),!g(o))return d("property missing ':'");var c=g(i),a=e({type:"declaration",property:s(r[0].replace(n,f)),value:c?s(c[0].replace(n,f)):f});return g(u),a}}return v.prototype.content=c,y(),function(){var n,e=[];for(w(e);n=b();)!1!==n&&(e.push(n),w(e));return e}()}})); +//# sourceMappingURL=inline-style-parser.min.js.map