v-code-diff 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/v2/index.cjs.js +11 -9
- package/dist/v2/index.es.js +925 -889
- package/dist/v2.7/index.cjs.js +11 -9
- package/dist/v2.7/index.es.js +897 -881
- package/dist/v3/index.cjs.js +11 -9
- package/dist/v3/index.es.js +840 -812
- package/package.json +3 -1
- package/scripts/postinstall.js +2 -2
- package/src/CodeDiff.vue +13 -2
- package/src/split/SplitLine.vue +2 -2
- package/src/style.scss +36 -0
- package/src/types.ts +13 -2
- package/src/unified/UnifiedLine.vue +3 -3
- package/src/utils.ts +69 -42
package/dist/v3/index.es.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode(".code-diff-view{--color-canvas-default-transparent: rgba(255,255,255,0);--color-page-header-bg: #f6f8fa;--color-marketing-icon-primary: #218bff;--color-marketing-icon-secondary: #54aeff;--color-diff-blob-addition-num-text: #24292f;--color-diff-blob-addition-fg: #24292f;--color-diff-blob-addition-num-bg: #ccffd8;--color-diff-blob-addition-line-bg: #e6ffec;--color-diff-blob-addition-word-bg: #abf2bc;--color-diff-blob-deletion-num-text: #24292f;--color-diff-blob-deletion-fg: #24292f;--color-diff-blob-deletion-num-bg: #ffd7d5;--color-diff-blob-deletion-line-bg: #ffebe9;--color-diff-blob-deletion-word-bg: rgba(255,129,130,.4);--color-diff-blob-hunk-num-bg: rgba(84,174,255,.4);--color-diff-blob-expander-icon: #57606a;--color-diff-blob-selected-line-highlight-mix-blend-mode: multiply;--color-diffstat-deletion-border: rgba(27,31,36,.15);--color-diffstat-addition-border: rgba(27,31,36,.15);--color-diffstat-addition-bg: #2da44e;--color-search-keyword-hl: #fff8c5;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #8250df;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #ffebe9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-codemirror-text: #24292f;--color-codemirror-bg: #ffffff;--color-codemirror-gutters-bg: #ffffff;--color-codemirror-guttermarker-text: #ffffff;--color-codemirror-guttermarker-subtle-text: #6e7781;--color-codemirror-linenumber-text: #57606a;--color-codemirror-cursor: #24292f;--color-codemirror-selection-bg: rgba(84,174,255,.4);--color-codemirror-activeline-bg: rgba(234,238,242,.5);--color-codemirror-matchingbracket-text: #24292f;--color-codemirror-lines-bg: #ffffff;--color-codemirror-syntax-comment: #24292f;--color-codemirror-syntax-constant: #0550ae;--color-codemirror-syntax-entity: #8250df;--color-codemirror-syntax-keyword: #cf222e;--color-codemirror-syntax-storage: #cf222e;--color-codemirror-syntax-string: #0a3069;--color-codemirror-syntax-support: #0550ae;--color-codemirror-syntax-variable: #953800;--color-checks-bg: #24292f;--color-checks-run-border-width: 0px;--color-checks-container-border-width: 0px;--color-checks-text-primary: #f6f8fa;--color-checks-text-secondary: #8c959f;--color-checks-text-link: #54aeff;--color-checks-btn-icon: #afb8c1;--color-checks-btn-hover-icon: #f6f8fa;--color-checks-btn-hover-bg: rgba(255,255,255,.125);--color-checks-input-text: #eaeef2;--color-checks-input-placeholder-text: #8c959f;--color-checks-input-focus-text: #8c959f;--color-checks-input-bg: #32383f;--color-checks-input-shadow: none;--color-checks-donut-error: #fa4549;--color-checks-donut-pending: #bf8700;--color-checks-donut-success: #2da44e;--color-checks-donut-neutral: #afb8c1;--color-checks-dropdown-text: #afb8c1;--color-checks-dropdown-bg: #32383f;--color-checks-dropdown-border: #424a53;--color-checks-dropdown-shadow: rgba(27,31,36,.3);--color-checks-dropdown-hover-text: #f6f8fa;--color-checks-dropdown-hover-bg: #424a53;--color-checks-dropdown-btn-hover-text: #f6f8fa;--color-checks-dropdown-btn-hover-bg: #32383f;--color-checks-scrollbar-thumb-bg: #57606a;--color-checks-header-label-text: #d0d7de;--color-checks-header-label-open-text: #f6f8fa;--color-checks-header-border: #32383f;--color-checks-header-icon: #8c959f;--color-checks-line-text: #d0d7de;--color-checks-line-num-text: rgba(140,149,159,.75);--color-checks-line-timestamp-text: #8c959f;--color-checks-line-hover-bg: #32383f;--color-checks-line-selected-bg: rgba(33,139,255,.15);--color-checks-line-selected-num-text: #54aeff;--color-checks-line-dt-fm-text: #24292f;--color-checks-line-dt-fm-bg: #9a6700;--color-checks-gate-bg: rgba(125,78,0,.15);--color-checks-gate-text: #d0d7de;--color-checks-gate-waiting-text: #d4a72c;--color-checks-step-header-open-bg: #32383f;--color-checks-step-error-text: #ff8182;--color-checks-step-warning-text: #d4a72c;--color-checks-logline-text: #8c959f;--color-checks-logline-num-text: rgba(140,149,159,.75);--color-checks-logline-debug-text: #c297ff;--color-checks-logline-error-text: #d0d7de;--color-checks-logline-error-num-text: #ff8182;--color-checks-logline-error-bg: rgba(164,14,38,.15);--color-checks-logline-warning-text: #d0d7de;--color-checks-logline-warning-num-text: #d4a72c;--color-checks-logline-warning-bg: rgba(125,78,0,.15);--color-checks-logline-command-text: #54aeff;--color-checks-logline-section-text: #4ac26b;--color-checks-ansi-black: #24292f;--color-checks-ansi-black-bright: #32383f;--color-checks-ansi-white: #d0d7de;--color-checks-ansi-white-bright: #d0d7de;--color-checks-ansi-gray: #8c959f;--color-checks-ansi-red: #ff8182;--color-checks-ansi-red-bright: #ffaba8;--color-checks-ansi-green: #4ac26b;--color-checks-ansi-green-bright: #6fdd8b;--color-checks-ansi-yellow: #d4a72c;--color-checks-ansi-yellow-bright: #eac54f;--color-checks-ansi-blue: #54aeff;--color-checks-ansi-blue-bright: #80ccff;--color-checks-ansi-magenta: #c297ff;--color-checks-ansi-magenta-bright: #d8b9ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #24292f;--color-project-sidebar-bg: #ffffff;--color-project-gradient-in: #ffffff;--color-project-gradient-out: rgba(255,255,255,0);--color-mktg-btn-bg: #1b1f23;--color-mktg-btn-shadow-outline: rgb(0 0 0 / 15%) 0 0 0 1px inset;--color-mktg-btn-shadow-focus: rgb(0 0 0 / 15%) 0 0 0 4px;--color-mktg-btn-shadow-hover: 0 3px 2px rgba(0, 0, 0, .07), 0 7px 5px rgba(0, 0, 0, .04), 0 12px 10px rgba(0, 0, 0, .03), 0 22px 18px rgba(0, 0, 0, .03), 0 42px 33px rgba(0, 0, 0, .02), 0 100px 80px rgba(0, 0, 0, .02);--color-mktg-btn-shadow-hover-muted: rgb(0 0 0 / 70%) 0 0 0 2px inset;--color-avatar-bg: #ffffff;--color-avatar-border: rgba(27,31,36,.15);--color-avatar-stack-fade: #afb8c1;--color-avatar-stack-fade-more: #d0d7de;--color-avatar-child-shadow: -2px -2px 0 rgba(255,255,255,.8);--color-topic-tag-border: rgba(0,0,0,0);--color-counter-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: rgba(0,0,0,0);--color-select-menu-tap-highlight: rgba(175,184,193,.5);--color-select-menu-tap-focus-bg: #b6e3ff;--color-overlay-shadow: 0 1px 3px rgba(27,31,36,.12), 0 8px 24px rgba(66,74,83,.12);--color-header-text: rgba(255,255,255,.7);--color-header-bg: #24292f;--color-header-divider: #57606a;--color-header-logo: #ffffff;--color-header-search-bg: #24292f;--color-header-search-border: #57606a;--color-sidenav-selected-bg: #ffffff;--color-menu-bg-active: rgba(0,0,0,0);--color-input-disabled-bg: rgba(175,184,193,.2);--color-timeline-badge-bg: #eaeef2;--color-ansi-black: #24292f;--color-ansi-black-bright: #57606a;--color-ansi-white: #6e7781;--color-ansi-white-bright: #8c959f;--color-ansi-gray: #6e7781;--color-ansi-red: #cf222e;--color-ansi-red-bright: #a40e26;--color-ansi-green: #116329;--color-ansi-green-bright: #1a7f37;--color-ansi-yellow: #4d2d00;--color-ansi-yellow-bright: #633c01;--color-ansi-blue: #0969da;--color-ansi-blue-bright: #218bff;--color-ansi-magenta: #8250df;--color-ansi-magenta-bright: #a475f9;--color-ansi-cyan: #1b7c83;--color-ansi-cyan-bright: #3192aa;--color-btn-text: #24292f;--color-btn-bg: #f6f8fa;--color-btn-border: rgba(27,31,36,.15);--color-btn-shadow: 0 1px 0 rgba(27,31,36,.04);--color-btn-inset-shadow: inset 0 1px 0 rgba(255,255,255,.25);--color-btn-hover-bg: #f3f4f6;--color-btn-hover-border: rgba(27,31,36,.15);--color-btn-active-bg: hsla(220,14%,93%,1);--color-btn-active-border: rgba(27,31,36,.15);--color-btn-selected-bg: hsla(220,14%,94%,1);--color-btn-focus-bg: #f6f8fa;--color-btn-focus-border: rgba(27,31,36,.15);--color-btn-focus-shadow: 0 0 0 3px rgba(9,105,218,.3);--color-btn-shadow-active: inset 0 .15em .3em rgba(27,31,36,.15);--color-btn-shadow-input-focus: 0 0 0 .2em rgba(9,105,218,.3);--color-btn-counter-bg: rgba(27,31,36,.08);--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #2da44e;--color-btn-primary-border: rgba(27,31,36,.15);--color-btn-primary-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-primary-hover-bg: #2c974b;--color-btn-primary-hover-border: rgba(27,31,36,.15);--color-btn-primary-selected-bg: hsla(137,55%,36%,1);--color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0,45,17,.2);--color-btn-primary-disabled-text: rgba(255,255,255,.8);--color-btn-primary-disabled-bg: #94d3a2;--color-btn-primary-disabled-border: rgba(27,31,36,.15);--color-btn-primary-focus-bg: #2da44e;--color-btn-primary-focus-border: rgba(27,31,36,.15);--color-btn-primary-focus-shadow: 0 0 0 3px rgba(45,164,78,.4);--color-btn-primary-icon: rgba(255,255,255,.8);--color-btn-primary-counter-bg: rgba(255,255,255,.2);--color-btn-outline-text: #0969da;--color-btn-outline-hover-text: #ffffff;--color-btn-outline-hover-bg: #0969da;--color-btn-outline-hover-border: rgba(27,31,36,.15);--color-btn-outline-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-outline-hover-counter-bg: rgba(255,255,255,.2);--color-btn-outline-selected-text: #ffffff;--color-btn-outline-selected-bg: hsla(212,92%,42%,1);--color-btn-outline-selected-border: rgba(27,31,36,.15);--color-btn-outline-selected-shadow: inset 0 1px 0 rgba(0,33,85,.2);--color-btn-outline-disabled-text: rgba(9,105,218,.5);--color-btn-outline-disabled-bg: #f6f8fa;--color-btn-outline-disabled-counter-bg: rgba(9,105,218,.05);--color-btn-outline-focus-border: rgba(27,31,36,.15);--color-btn-outline-focus-shadow: 0 0 0 3px rgba(5,80,174,.4);--color-btn-outline-counter-bg: rgba(9,105,218,.1);--color-btn-danger-text: #cf222e;--color-btn-danger-hover-text: #ffffff;--color-btn-danger-hover-bg: #a40e26;--color-btn-danger-hover-border: rgba(27,31,36,.15);--color-btn-danger-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-danger-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: hsla(356,72%,44%,1);--color-btn-danger-selected-border: rgba(27,31,36,.15);--color-btn-danger-selected-shadow: inset 0 1px 0 rgba(76,0,20,.2);--color-btn-danger-disabled-text: rgba(207,34,46,.5);--color-btn-danger-disabled-bg: #f6f8fa;--color-btn-danger-disabled-counter-bg: rgba(207,34,46,.05);--color-btn-danger-focus-border: rgba(27,31,36,.15);--color-btn-danger-focus-shadow: 0 0 0 3px rgba(164,14,38,.4);--color-btn-danger-counter-bg: rgba(207,34,46,.1);--color-btn-danger-icon: #cf222e;--color-btn-danger-hover-icon: #ffffff;--color-underlinenav-icon: #6e7781;--color-underlinenav-border-hover: rgba(175,184,193,.2);--color-action-list-item-inline-divider: rgba(208,215,222,.48);--color-action-list-item-default-hover-bg: rgba(208,215,222,.32);--color-action-list-item-default-hover-border: rgba(0,0,0,0);--color-action-list-item-default-active-bg: rgba(208,215,222,.48);--color-action-list-item-default-active-border: rgba(0,0,0,0);--color-action-list-item-default-selected-bg: rgba(208,215,222,.24);--color-action-list-item-danger-hover-bg: rgba(255,235,233,.64);--color-action-list-item-danger-active-bg: #ffebe9;--color-action-list-item-danger-hover-text: #cf222e;--color-switch-track-bg: #eaeef2;--color-switch-track-border: #afb8c1;--color-switch-track-checked-bg: #ddf4ff;--color-switch-track-checked-hover-bg: #b6e3ff;--color-switch-track-checked-active-bg: #80ccff;--color-switch-track-checked-border: #54aeff;--color-switch-knob-checked-bg: #0969da;--color-switch-knob-checked-disabled-bg: #6e7781;--color-segmented-control-bg: #eaeef2;--color-segmented-control-button-hover-bg: rgba(175,184,193,.2);--color-segmented-control-button-active-bg: rgba(175,184,193,.4);--color-segmented-control-button-selected-border: #6e7781;--color-fg-default: #24292f;--color-fg-muted: #57606a;--color-fg-subtle: #6e7781;--color-fg-on-emphasis: #ffffff;--color-canvas-default: #ffffff;--color-canvas-overlay: #ffffff;--color-canvas-inset: #f6f8fa;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsla(210,18%,87%,1);--color-border-subtle: rgba(27,31,36,.15);--color-shadow-small: 0 1px 0 rgba(27,31,36,.04);--color-shadow-medium: 0 3px 6px rgba(140,149,159,.15);--color-shadow-large: 0 8px 24px rgba(140,149,159,.2);--color-shadow-extra-large: 0 12px 28px rgba(140,149,159,.3);--color-neutral-emphasis-plus: #24292f;--color-neutral-emphasis: #6e7781;--color-neutral-muted: rgba(175,184,193,.2);--color-neutral-subtle: rgba(234,238,242,.5);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-accent-muted: rgba(84,174,255,.4);--color-accent-subtle: #ddf4ff;--color-success-fg: #1a7f37;--color-success-emphasis: #2da44e;--color-success-muted: rgba(74,194,107,.4);--color-success-subtle: #dafbe1;--color-attention-fg: #9a6700;--color-attention-emphasis: #bf8700;--color-attention-muted: rgba(212,167,44,.4);--color-attention-subtle: #fff8c5;--color-severe-fg: #bc4c00;--color-severe-emphasis: #bc4c00;--color-severe-muted: rgba(251,143,68,.4);--color-severe-subtle: #fff1e5;--color-danger-fg: #cf222e;--color-danger-emphasis: #cf222e;--color-danger-muted: rgba(255,129,130,.4);--color-danger-subtle: #ffebe9;--color-open-fg: #1a7f37;--color-open-emphasis: #2da44e;--color-open-muted: rgba(74,194,107,.4);--color-open-subtle: #dafbe1;--color-closed-fg: #cf222e;--color-closed-emphasis: #cf222e;--color-closed-muted: rgba(255,129,130,.4);--color-closed-subtle: #ffebe9;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-done-muted: rgba(194,151,255,.4);--color-done-subtle: #fbefff;--color-sponsors-fg: #bf3989;--color-sponsors-emphasis: #bf3989;--color-sponsors-muted: rgba(255,128,200,.4);--color-sponsors-subtle: #ffeff7;--color-primer-fg-disabled: #8c959f;--color-primer-canvas-backdrop: rgba(27,31,36,.5);--color-primer-canvas-sticky: rgba(255,255,255,.95);--color-primer-border-active: #fd8c73;--color-primer-border-contrast: rgba(27,31,36,.1);--color-primer-shadow-highlight: inset 0 1px 0 rgba(255,255,255,.25);--color-primer-shadow-inset: inset 0 1px 0 rgba(208,215,222,.2);--color-primer-shadow-focus: 0 0 0 3px rgba(9,105,218,.3);--color-scale-black: #1b1f24;--color-scale-white: #ffffff;--color-scale-gray-0: #f6f8fa;--color-scale-gray-1: #eaeef2;--color-scale-gray-2: #d0d7de;--color-scale-gray-3: #afb8c1;--color-scale-gray-4: #8c959f;--color-scale-gray-5: #6e7781;--color-scale-gray-6: #57606a;--color-scale-gray-7: #424a53;--color-scale-gray-8: #32383f;--color-scale-gray-9: #24292f;--color-scale-blue-0: #ddf4ff;--color-scale-blue-1: #b6e3ff;--color-scale-blue-2: #80ccff;--color-scale-blue-3: #54aeff;--color-scale-blue-4: #218bff;--color-scale-blue-5: #0969da;--color-scale-blue-6: #0550ae;--color-scale-blue-7: #033d8b;--color-scale-blue-8: #0a3069;--color-scale-blue-9: #002155;--color-scale-green-0: #dafbe1;--color-scale-green-1: #aceebb;--color-scale-green-2: #6fdd8b;--color-scale-green-3: #4ac26b;--color-scale-green-4: #2da44e;--color-scale-green-5: #1a7f37;--color-scale-green-6: #116329;--color-scale-green-7: #044f1e;--color-scale-green-8: #003d16;--color-scale-green-9: #002d11;--color-scale-yellow-0: #fff8c5;--color-scale-yellow-1: #fae17d;--color-scale-yellow-2: #eac54f;--color-scale-yellow-3: #d4a72c;--color-scale-yellow-4: #bf8700;--color-scale-yellow-5: #9a6700;--color-scale-yellow-6: #7d4e00;--color-scale-yellow-7: #633c01;--color-scale-yellow-8: #4d2d00;--color-scale-yellow-9: #3b2300;--color-scale-orange-0: #fff1e5;--color-scale-orange-1: #ffd8b5;--color-scale-orange-2: #ffb77c;--color-scale-orange-3: #fb8f44;--color-scale-orange-4: #e16f24;--color-scale-orange-5: #bc4c00;--color-scale-orange-6: #953800;--color-scale-orange-7: #762c00;--color-scale-orange-8: #5c2200;--color-scale-orange-9: #471700;--color-scale-red-0: #ffebe9;--color-scale-red-1: #ffcecb;--color-scale-red-2: #ffaba8;--color-scale-red-3: #ff8182;--color-scale-red-4: #fa4549;--color-scale-red-5: #cf222e;--color-scale-red-6: #a40e26;--color-scale-red-7: #82071e;--color-scale-red-8: #660018;--color-scale-red-9: #4c0014;--color-scale-purple-0: #fbefff;--color-scale-purple-1: #ecd8ff;--color-scale-purple-2: #d8b9ff;--color-scale-purple-3: #c297ff;--color-scale-purple-4: #a475f9;--color-scale-purple-5: #8250df;--color-scale-purple-6: #6639ba;--color-scale-purple-7: #512a97;--color-scale-purple-8: #3e1f79;--color-scale-purple-9: #2e1461;--color-scale-pink-0: #ffeff7;--color-scale-pink-1: #ffd3eb;--color-scale-pink-2: #ffadda;--color-scale-pink-3: #ff80c8;--color-scale-pink-4: #e85aad;--color-scale-pink-5: #bf3989;--color-scale-pink-6: #99286e;--color-scale-pink-7: #772057;--color-scale-pink-8: #611347;--color-scale-pink-9: #4d0336;--color-scale-coral-0: #fff0eb;--color-scale-coral-1: #ffd6cc;--color-scale-coral-2: #ffb4a1;--color-scale-coral-3: #fd8c73;--color-scale-coral-4: #ec6547;--color-scale-coral-5: #c4432b;--color-scale-coral-6: #9e2f1c;--color-scale-coral-7: #801f0f;--color-scale-coral-8: #691105;--color-scale-coral-9: #510901}.code-diff-view{position:relative;margin-top:16px;margin-bottom:16px;border:1px solid var(--color-border-default, #ddd);border-radius:6px;overflow-y:auto}.code-diff-view *{position:static}.code-diff-view table{border-spacing:0}.code-diff-view .diff-table{width:100%}.code-diff-view .diff-table .blob-num{position:relative;width:1%;min-width:50px;padding-right:10px;padding-left:10px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;white-space:nowrap;vertical-align:top;cursor:pointer;-webkit-user-select:none;user-select:none}.code-diff-view .diff-table .blob-num-deletion{color:var(--color-diff-blob-deletion-num-text);background-color:var(--color-diff-blob-deletion-num-bg);border-color:var(--color-danger-emphasis)}.code-diff-view .diff-table .blob-num-addition{color:var(--color-diff-blob-addition-num-text);background-color:var(--color-diff-blob-addition-num-bg);border-color:var(--color-success-emphasis)}.code-diff-view .diff-table .blob-code{position:relative;padding-right:10px;padding-left:10px;line-height:20px;vertical-align:top}.code-diff-view .diff-table .blob-code .blob-code-inner{display:table-cell;overflow:visible;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;color:var(--color-fg-default);word-wrap:anywhere;white-space:pre-wrap}.code-diff-view .diff-table .blob-code-deletion{background-color:var(--color-diff-blob-deletion-line-bg);outline:1px dashed transparent}.code-diff-view .diff-table .blob-code-deletion .x{color:var(--color-diff-blob-deletion-fg);background-color:var(--color-diff-blob-deletion-word-bg)}.code-diff-view .diff-table .blob-code-addition{background-color:var(--color-diff-blob-addition-line-bg);outline:1px dotted transparent}.code-diff-view .diff-table .blob-code-addition .x{color:var(--color-diff-blob-addition-fg);background-color:var(--color-diff-blob-addition-word-bg)}.code-diff-view .diff-table .blob-code-context,.code-diff-view .diff-table .blob-code-addition,.code-diff-view .diff-table .blob-code-deletion{padding-left:22px!important}.code-diff-view .diff-table .blob-code-marker:before{position:absolute;top:1px;left:8px;padding-right:8px;content:attr(data-code-marker)}.code-diff-view .file-diff-split{table-layout:fixed}.code-diff-view .file-diff-split .blob-code+.blob-num{border-left:1px solid var(--color-border-muted)}.code-diff-view .empty-cell{cursor:default;background-color:var(--color-neutral-subtle);border-right-color:var(--color-border-muted)}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:gray}.hljs-attr{color:red}.hljs-bullet,.hljs-link,.hljs-symbol{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { defineComponent as
|
|
1
|
+
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode(".code-diff-view{--color-canvas-default-transparent: rgba(255,255,255,0);--color-page-header-bg: #f6f8fa;--color-marketing-icon-primary: #218bff;--color-marketing-icon-secondary: #54aeff;--color-diff-blob-addition-num-text: #24292f;--color-diff-blob-addition-fg: #24292f;--color-diff-blob-addition-num-bg: #ccffd8;--color-diff-blob-addition-line-bg: #e6ffec;--color-diff-blob-addition-word-bg: #abf2bc;--color-diff-blob-deletion-num-text: #24292f;--color-diff-blob-deletion-fg: #24292f;--color-diff-blob-deletion-num-bg: #ffd7d5;--color-diff-blob-deletion-line-bg: #ffebe9;--color-diff-blob-deletion-word-bg: rgba(255,129,130,.4);--color-diff-blob-hunk-num-bg: rgba(84,174,255,.4);--color-diff-blob-expander-icon: #57606a;--color-diff-blob-selected-line-highlight-mix-blend-mode: multiply;--color-diffstat-deletion-border: rgba(27,31,36,.15);--color-diffstat-addition-border: rgba(27,31,36,.15);--color-diffstat-addition-bg: #2da44e;--color-search-keyword-hl: #fff8c5;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #8250df;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #ffebe9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-codemirror-text: #24292f;--color-codemirror-bg: #ffffff;--color-codemirror-gutters-bg: #ffffff;--color-codemirror-guttermarker-text: #ffffff;--color-codemirror-guttermarker-subtle-text: #6e7781;--color-codemirror-linenumber-text: #57606a;--color-codemirror-cursor: #24292f;--color-codemirror-selection-bg: rgba(84,174,255,.4);--color-codemirror-activeline-bg: rgba(234,238,242,.5);--color-codemirror-matchingbracket-text: #24292f;--color-codemirror-lines-bg: #ffffff;--color-codemirror-syntax-comment: #24292f;--color-codemirror-syntax-constant: #0550ae;--color-codemirror-syntax-entity: #8250df;--color-codemirror-syntax-keyword: #cf222e;--color-codemirror-syntax-storage: #cf222e;--color-codemirror-syntax-string: #0a3069;--color-codemirror-syntax-support: #0550ae;--color-codemirror-syntax-variable: #953800;--color-checks-bg: #24292f;--color-checks-run-border-width: 0px;--color-checks-container-border-width: 0px;--color-checks-text-primary: #f6f8fa;--color-checks-text-secondary: #8c959f;--color-checks-text-link: #54aeff;--color-checks-btn-icon: #afb8c1;--color-checks-btn-hover-icon: #f6f8fa;--color-checks-btn-hover-bg: rgba(255,255,255,.125);--color-checks-input-text: #eaeef2;--color-checks-input-placeholder-text: #8c959f;--color-checks-input-focus-text: #8c959f;--color-checks-input-bg: #32383f;--color-checks-input-shadow: none;--color-checks-donut-error: #fa4549;--color-checks-donut-pending: #bf8700;--color-checks-donut-success: #2da44e;--color-checks-donut-neutral: #afb8c1;--color-checks-dropdown-text: #afb8c1;--color-checks-dropdown-bg: #32383f;--color-checks-dropdown-border: #424a53;--color-checks-dropdown-shadow: rgba(27,31,36,.3);--color-checks-dropdown-hover-text: #f6f8fa;--color-checks-dropdown-hover-bg: #424a53;--color-checks-dropdown-btn-hover-text: #f6f8fa;--color-checks-dropdown-btn-hover-bg: #32383f;--color-checks-scrollbar-thumb-bg: #57606a;--color-checks-header-label-text: #d0d7de;--color-checks-header-label-open-text: #f6f8fa;--color-checks-header-border: #32383f;--color-checks-header-icon: #8c959f;--color-checks-line-text: #d0d7de;--color-checks-line-num-text: rgba(140,149,159,.75);--color-checks-line-timestamp-text: #8c959f;--color-checks-line-hover-bg: #32383f;--color-checks-line-selected-bg: rgba(33,139,255,.15);--color-checks-line-selected-num-text: #54aeff;--color-checks-line-dt-fm-text: #24292f;--color-checks-line-dt-fm-bg: #9a6700;--color-checks-gate-bg: rgba(125,78,0,.15);--color-checks-gate-text: #d0d7de;--color-checks-gate-waiting-text: #d4a72c;--color-checks-step-header-open-bg: #32383f;--color-checks-step-error-text: #ff8182;--color-checks-step-warning-text: #d4a72c;--color-checks-logline-text: #8c959f;--color-checks-logline-num-text: rgba(140,149,159,.75);--color-checks-logline-debug-text: #c297ff;--color-checks-logline-error-text: #d0d7de;--color-checks-logline-error-num-text: #ff8182;--color-checks-logline-error-bg: rgba(164,14,38,.15);--color-checks-logline-warning-text: #d0d7de;--color-checks-logline-warning-num-text: #d4a72c;--color-checks-logline-warning-bg: rgba(125,78,0,.15);--color-checks-logline-command-text: #54aeff;--color-checks-logline-section-text: #4ac26b;--color-checks-ansi-black: #24292f;--color-checks-ansi-black-bright: #32383f;--color-checks-ansi-white: #d0d7de;--color-checks-ansi-white-bright: #d0d7de;--color-checks-ansi-gray: #8c959f;--color-checks-ansi-red: #ff8182;--color-checks-ansi-red-bright: #ffaba8;--color-checks-ansi-green: #4ac26b;--color-checks-ansi-green-bright: #6fdd8b;--color-checks-ansi-yellow: #d4a72c;--color-checks-ansi-yellow-bright: #eac54f;--color-checks-ansi-blue: #54aeff;--color-checks-ansi-blue-bright: #80ccff;--color-checks-ansi-magenta: #c297ff;--color-checks-ansi-magenta-bright: #d8b9ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #24292f;--color-project-sidebar-bg: #ffffff;--color-project-gradient-in: #ffffff;--color-project-gradient-out: rgba(255,255,255,0);--color-mktg-btn-bg: #1b1f23;--color-mktg-btn-shadow-outline: rgb(0 0 0 / 15%) 0 0 0 1px inset;--color-mktg-btn-shadow-focus: rgb(0 0 0 / 15%) 0 0 0 4px;--color-mktg-btn-shadow-hover: 0 3px 2px rgba(0, 0, 0, .07), 0 7px 5px rgba(0, 0, 0, .04), 0 12px 10px rgba(0, 0, 0, .03), 0 22px 18px rgba(0, 0, 0, .03), 0 42px 33px rgba(0, 0, 0, .02), 0 100px 80px rgba(0, 0, 0, .02);--color-mktg-btn-shadow-hover-muted: rgb(0 0 0 / 70%) 0 0 0 2px inset;--color-avatar-bg: #ffffff;--color-avatar-border: rgba(27,31,36,.15);--color-avatar-stack-fade: #afb8c1;--color-avatar-stack-fade-more: #d0d7de;--color-avatar-child-shadow: -2px -2px 0 rgba(255,255,255,.8);--color-topic-tag-border: rgba(0,0,0,0);--color-counter-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: rgba(0,0,0,0);--color-select-menu-tap-highlight: rgba(175,184,193,.5);--color-select-menu-tap-focus-bg: #b6e3ff;--color-overlay-shadow: 0 1px 3px rgba(27,31,36,.12), 0 8px 24px rgba(66,74,83,.12);--color-header-text: rgba(255,255,255,.7);--color-header-bg: #24292f;--color-header-divider: #57606a;--color-header-logo: #ffffff;--color-header-search-bg: #24292f;--color-header-search-border: #57606a;--color-sidenav-selected-bg: #ffffff;--color-menu-bg-active: rgba(0,0,0,0);--color-input-disabled-bg: rgba(175,184,193,.2);--color-timeline-badge-bg: #eaeef2;--color-ansi-black: #24292f;--color-ansi-black-bright: #57606a;--color-ansi-white: #6e7781;--color-ansi-white-bright: #8c959f;--color-ansi-gray: #6e7781;--color-ansi-red: #cf222e;--color-ansi-red-bright: #a40e26;--color-ansi-green: #116329;--color-ansi-green-bright: #1a7f37;--color-ansi-yellow: #4d2d00;--color-ansi-yellow-bright: #633c01;--color-ansi-blue: #0969da;--color-ansi-blue-bright: #218bff;--color-ansi-magenta: #8250df;--color-ansi-magenta-bright: #a475f9;--color-ansi-cyan: #1b7c83;--color-ansi-cyan-bright: #3192aa;--color-btn-text: #24292f;--color-btn-bg: #f6f8fa;--color-btn-border: rgba(27,31,36,.15);--color-btn-shadow: 0 1px 0 rgba(27,31,36,.04);--color-btn-inset-shadow: inset 0 1px 0 rgba(255,255,255,.25);--color-btn-hover-bg: #f3f4f6;--color-btn-hover-border: rgba(27,31,36,.15);--color-btn-active-bg: hsla(220,14%,93%,1);--color-btn-active-border: rgba(27,31,36,.15);--color-btn-selected-bg: hsla(220,14%,94%,1);--color-btn-focus-bg: #f6f8fa;--color-btn-focus-border: rgba(27,31,36,.15);--color-btn-focus-shadow: 0 0 0 3px rgba(9,105,218,.3);--color-btn-shadow-active: inset 0 .15em .3em rgba(27,31,36,.15);--color-btn-shadow-input-focus: 0 0 0 .2em rgba(9,105,218,.3);--color-btn-counter-bg: rgba(27,31,36,.08);--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #2da44e;--color-btn-primary-border: rgba(27,31,36,.15);--color-btn-primary-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-primary-hover-bg: #2c974b;--color-btn-primary-hover-border: rgba(27,31,36,.15);--color-btn-primary-selected-bg: hsla(137,55%,36%,1);--color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0,45,17,.2);--color-btn-primary-disabled-text: rgba(255,255,255,.8);--color-btn-primary-disabled-bg: #94d3a2;--color-btn-primary-disabled-border: rgba(27,31,36,.15);--color-btn-primary-focus-bg: #2da44e;--color-btn-primary-focus-border: rgba(27,31,36,.15);--color-btn-primary-focus-shadow: 0 0 0 3px rgba(45,164,78,.4);--color-btn-primary-icon: rgba(255,255,255,.8);--color-btn-primary-counter-bg: rgba(255,255,255,.2);--color-btn-outline-text: #0969da;--color-btn-outline-hover-text: #ffffff;--color-btn-outline-hover-bg: #0969da;--color-btn-outline-hover-border: rgba(27,31,36,.15);--color-btn-outline-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-outline-hover-counter-bg: rgba(255,255,255,.2);--color-btn-outline-selected-text: #ffffff;--color-btn-outline-selected-bg: hsla(212,92%,42%,1);--color-btn-outline-selected-border: rgba(27,31,36,.15);--color-btn-outline-selected-shadow: inset 0 1px 0 rgba(0,33,85,.2);--color-btn-outline-disabled-text: rgba(9,105,218,.5);--color-btn-outline-disabled-bg: #f6f8fa;--color-btn-outline-disabled-counter-bg: rgba(9,105,218,.05);--color-btn-outline-focus-border: rgba(27,31,36,.15);--color-btn-outline-focus-shadow: 0 0 0 3px rgba(5,80,174,.4);--color-btn-outline-counter-bg: rgba(9,105,218,.1);--color-btn-danger-text: #cf222e;--color-btn-danger-hover-text: #ffffff;--color-btn-danger-hover-bg: #a40e26;--color-btn-danger-hover-border: rgba(27,31,36,.15);--color-btn-danger-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-danger-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: hsla(356,72%,44%,1);--color-btn-danger-selected-border: rgba(27,31,36,.15);--color-btn-danger-selected-shadow: inset 0 1px 0 rgba(76,0,20,.2);--color-btn-danger-disabled-text: rgba(207,34,46,.5);--color-btn-danger-disabled-bg: #f6f8fa;--color-btn-danger-disabled-counter-bg: rgba(207,34,46,.05);--color-btn-danger-focus-border: rgba(27,31,36,.15);--color-btn-danger-focus-shadow: 0 0 0 3px rgba(164,14,38,.4);--color-btn-danger-counter-bg: rgba(207,34,46,.1);--color-btn-danger-icon: #cf222e;--color-btn-danger-hover-icon: #ffffff;--color-underlinenav-icon: #6e7781;--color-underlinenav-border-hover: rgba(175,184,193,.2);--color-action-list-item-inline-divider: rgba(208,215,222,.48);--color-action-list-item-default-hover-bg: rgba(208,215,222,.32);--color-action-list-item-default-hover-border: rgba(0,0,0,0);--color-action-list-item-default-active-bg: rgba(208,215,222,.48);--color-action-list-item-default-active-border: rgba(0,0,0,0);--color-action-list-item-default-selected-bg: rgba(208,215,222,.24);--color-action-list-item-danger-hover-bg: rgba(255,235,233,.64);--color-action-list-item-danger-active-bg: #ffebe9;--color-action-list-item-danger-hover-text: #cf222e;--color-switch-track-bg: #eaeef2;--color-switch-track-border: #afb8c1;--color-switch-track-checked-bg: #ddf4ff;--color-switch-track-checked-hover-bg: #b6e3ff;--color-switch-track-checked-active-bg: #80ccff;--color-switch-track-checked-border: #54aeff;--color-switch-knob-checked-bg: #0969da;--color-switch-knob-checked-disabled-bg: #6e7781;--color-segmented-control-bg: #eaeef2;--color-segmented-control-button-hover-bg: rgba(175,184,193,.2);--color-segmented-control-button-active-bg: rgba(175,184,193,.4);--color-segmented-control-button-selected-border: #6e7781;--color-fg-default: #24292f;--color-fg-muted: #57606a;--color-fg-subtle: #6e7781;--color-fg-on-emphasis: #ffffff;--color-canvas-default: #ffffff;--color-canvas-overlay: #ffffff;--color-canvas-inset: #f6f8fa;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsla(210,18%,87%,1);--color-border-subtle: rgba(27,31,36,.15);--color-shadow-small: 0 1px 0 rgba(27,31,36,.04);--color-shadow-medium: 0 3px 6px rgba(140,149,159,.15);--color-shadow-large: 0 8px 24px rgba(140,149,159,.2);--color-shadow-extra-large: 0 12px 28px rgba(140,149,159,.3);--color-neutral-emphasis-plus: #24292f;--color-neutral-emphasis: #6e7781;--color-neutral-muted: rgba(175,184,193,.2);--color-neutral-subtle: rgba(234,238,242,.5);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-accent-muted: rgba(84,174,255,.4);--color-accent-subtle: #ddf4ff;--color-success-fg: #1a7f37;--color-success-emphasis: #2da44e;--color-success-muted: rgba(74,194,107,.4);--color-success-subtle: #dafbe1;--color-attention-fg: #9a6700;--color-attention-emphasis: #bf8700;--color-attention-muted: rgba(212,167,44,.4);--color-attention-subtle: #fff8c5;--color-severe-fg: #bc4c00;--color-severe-emphasis: #bc4c00;--color-severe-muted: rgba(251,143,68,.4);--color-severe-subtle: #fff1e5;--color-danger-fg: #cf222e;--color-danger-emphasis: #cf222e;--color-danger-muted: rgba(255,129,130,.4);--color-danger-subtle: #ffebe9;--color-open-fg: #1a7f37;--color-open-emphasis: #2da44e;--color-open-muted: rgba(74,194,107,.4);--color-open-subtle: #dafbe1;--color-closed-fg: #cf222e;--color-closed-emphasis: #cf222e;--color-closed-muted: rgba(255,129,130,.4);--color-closed-subtle: #ffebe9;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-done-muted: rgba(194,151,255,.4);--color-done-subtle: #fbefff;--color-sponsors-fg: #bf3989;--color-sponsors-emphasis: #bf3989;--color-sponsors-muted: rgba(255,128,200,.4);--color-sponsors-subtle: #ffeff7;--color-primer-fg-disabled: #8c959f;--color-primer-canvas-backdrop: rgba(27,31,36,.5);--color-primer-canvas-sticky: rgba(255,255,255,.95);--color-primer-border-active: #fd8c73;--color-primer-border-contrast: rgba(27,31,36,.1);--color-primer-shadow-highlight: inset 0 1px 0 rgba(255,255,255,.25);--color-primer-shadow-inset: inset 0 1px 0 rgba(208,215,222,.2);--color-primer-shadow-focus: 0 0 0 3px rgba(9,105,218,.3);--color-scale-black: #1b1f24;--color-scale-white: #ffffff;--color-scale-gray-0: #f6f8fa;--color-scale-gray-1: #eaeef2;--color-scale-gray-2: #d0d7de;--color-scale-gray-3: #afb8c1;--color-scale-gray-4: #8c959f;--color-scale-gray-5: #6e7781;--color-scale-gray-6: #57606a;--color-scale-gray-7: #424a53;--color-scale-gray-8: #32383f;--color-scale-gray-9: #24292f;--color-scale-blue-0: #ddf4ff;--color-scale-blue-1: #b6e3ff;--color-scale-blue-2: #80ccff;--color-scale-blue-3: #54aeff;--color-scale-blue-4: #218bff;--color-scale-blue-5: #0969da;--color-scale-blue-6: #0550ae;--color-scale-blue-7: #033d8b;--color-scale-blue-8: #0a3069;--color-scale-blue-9: #002155;--color-scale-green-0: #dafbe1;--color-scale-green-1: #aceebb;--color-scale-green-2: #6fdd8b;--color-scale-green-3: #4ac26b;--color-scale-green-4: #2da44e;--color-scale-green-5: #1a7f37;--color-scale-green-6: #116329;--color-scale-green-7: #044f1e;--color-scale-green-8: #003d16;--color-scale-green-9: #002d11;--color-scale-yellow-0: #fff8c5;--color-scale-yellow-1: #fae17d;--color-scale-yellow-2: #eac54f;--color-scale-yellow-3: #d4a72c;--color-scale-yellow-4: #bf8700;--color-scale-yellow-5: #9a6700;--color-scale-yellow-6: #7d4e00;--color-scale-yellow-7: #633c01;--color-scale-yellow-8: #4d2d00;--color-scale-yellow-9: #3b2300;--color-scale-orange-0: #fff1e5;--color-scale-orange-1: #ffd8b5;--color-scale-orange-2: #ffb77c;--color-scale-orange-3: #fb8f44;--color-scale-orange-4: #e16f24;--color-scale-orange-5: #bc4c00;--color-scale-orange-6: #953800;--color-scale-orange-7: #762c00;--color-scale-orange-8: #5c2200;--color-scale-orange-9: #471700;--color-scale-red-0: #ffebe9;--color-scale-red-1: #ffcecb;--color-scale-red-2: #ffaba8;--color-scale-red-3: #ff8182;--color-scale-red-4: #fa4549;--color-scale-red-5: #cf222e;--color-scale-red-6: #a40e26;--color-scale-red-7: #82071e;--color-scale-red-8: #660018;--color-scale-red-9: #4c0014;--color-scale-purple-0: #fbefff;--color-scale-purple-1: #ecd8ff;--color-scale-purple-2: #d8b9ff;--color-scale-purple-3: #c297ff;--color-scale-purple-4: #a475f9;--color-scale-purple-5: #8250df;--color-scale-purple-6: #6639ba;--color-scale-purple-7: #512a97;--color-scale-purple-8: #3e1f79;--color-scale-purple-9: #2e1461;--color-scale-pink-0: #ffeff7;--color-scale-pink-1: #ffd3eb;--color-scale-pink-2: #ffadda;--color-scale-pink-3: #ff80c8;--color-scale-pink-4: #e85aad;--color-scale-pink-5: #bf3989;--color-scale-pink-6: #99286e;--color-scale-pink-7: #772057;--color-scale-pink-8: #611347;--color-scale-pink-9: #4d0336;--color-scale-coral-0: #fff0eb;--color-scale-coral-1: #ffd6cc;--color-scale-coral-2: #ffb4a1;--color-scale-coral-3: #fd8c73;--color-scale-coral-4: #ec6547;--color-scale-coral-5: #c4432b;--color-scale-coral-6: #9e2f1c;--color-scale-coral-7: #801f0f;--color-scale-coral-8: #691105;--color-scale-coral-9: #510901}.code-diff-view{position:relative;margin-top:16px;margin-bottom:16px;border:1px solid var(--color-border-default, #ddd);border-radius:6px;overflow-y:auto}.code-diff-view *{position:static}.code-diff-view .file-header{background-color:var(--color-canvas-subtle);border-bottom:1px solid var(--color-border-default);padding:8px 16px;font-size:12px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.code-diff-view .file-header .file-info{display:flex;justify-content:space-between;align-items:center;margin-left:8px;height:24px}.code-diff-view .file-header .file-info .filename{font-size:13px;color:var(--color-fg-default)}.code-diff-view .file-header .file-info .diff-stat .diff-stat-added{color:var(--color-diffstat-addition-bg)}.code-diff-view .file-header .file-info .diff-stat .diff-stat-deleted{color:var(--color-danger-emphasis)}.code-diff-view table{border-spacing:0}.code-diff-view .diff-table{width:100%}.code-diff-view .diff-table .blob-num{position:relative;width:1%;min-width:50px;padding-right:10px;padding-left:10px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;white-space:nowrap;vertical-align:top;cursor:pointer;-webkit-user-select:none;user-select:none}.code-diff-view .diff-table .blob-num-deletion{color:var(--color-diff-blob-deletion-num-text);background-color:var(--color-diff-blob-deletion-num-bg);border-color:var(--color-danger-emphasis)}.code-diff-view .diff-table .blob-num-addition{color:var(--color-diff-blob-addition-num-text);background-color:var(--color-diff-blob-addition-num-bg);border-color:var(--color-success-emphasis)}.code-diff-view .diff-table .blob-code{position:relative;padding-right:10px;padding-left:10px;line-height:20px;vertical-align:top}.code-diff-view .diff-table .blob-code .blob-code-inner{display:table-cell;overflow:visible;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;color:var(--color-fg-default);word-wrap:anywhere;white-space:pre-wrap}.code-diff-view .diff-table .blob-code-deletion{background-color:var(--color-diff-blob-deletion-line-bg);outline:1px dashed transparent}.code-diff-view .diff-table .blob-code-deletion .x{color:var(--color-diff-blob-deletion-fg);background-color:var(--color-diff-blob-deletion-word-bg)}.code-diff-view .diff-table .blob-code-addition{background-color:var(--color-diff-blob-addition-line-bg);outline:1px dotted transparent}.code-diff-view .diff-table .blob-code-addition .x{color:var(--color-diff-blob-addition-fg);background-color:var(--color-diff-blob-addition-word-bg)}.code-diff-view .diff-table .blob-code-context,.code-diff-view .diff-table .blob-code-addition,.code-diff-view .diff-table .blob-code-deletion{padding-left:22px!important}.code-diff-view .diff-table .blob-code-marker:before{position:absolute;top:1px;left:8px;padding-right:8px;content:attr(data-code-marker)}.code-diff-view .diff-table .blob-num-hunk{background-color:var(--color-diff-blob-hunk-num-bg)}.code-diff-view .diff-table .blob-code-hunk{background-color:var(--color-accent-subtle)}.code-diff-view .file-diff-split{table-layout:fixed}.code-diff-view .file-diff-split .blob-code+.blob-num{border-left:1px solid var(--color-border-muted)}.code-diff-view .empty-cell{cursor:default;background-color:var(--color-neutral-subtle);border-right-color:var(--color-border-muted)}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:gray}.hljs-attr{color:red}.hljs-bullet,.hljs-link,.hljs-symbol{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { defineComponent as ye, openBlock as H, createElementBlock as K, createElementVNode as C, normalizeClass as he, unref as B, toDisplayString as fe, Fragment as ue, renderList as He, createBlock as Oe, computed as we, normalizeStyle as In } from "vue";
|
|
3
3
|
function j() {
|
|
4
4
|
}
|
|
5
5
|
j.prototype = {
|
|
6
6
|
diff: function(n, t) {
|
|
7
|
-
var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
|
|
8
|
-
typeof s == "function" && (
|
|
7
|
+
var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = s.callback;
|
|
8
|
+
typeof s == "function" && (o = s, s = {}), this.options = s;
|
|
9
9
|
var l = this;
|
|
10
|
-
function i(
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
}, 0), !0) :
|
|
10
|
+
function i(g) {
|
|
11
|
+
return o ? (setTimeout(function() {
|
|
12
|
+
o(void 0, g);
|
|
13
|
+
}, 0), !0) : g;
|
|
14
14
|
}
|
|
15
15
|
n = this.castInput(n), t = this.castInput(t), n = this.removeEmpty(this.tokenize(n)), t = this.removeEmpty(this.tokenize(t));
|
|
16
|
-
var r = t.length, a = n.length,
|
|
16
|
+
var r = t.length, a = n.length, c = 1, b = r + a;
|
|
17
17
|
s.maxEditLength && (b = Math.min(b, s.maxEditLength));
|
|
18
|
-
var
|
|
18
|
+
var p = [{
|
|
19
19
|
newPos: -1,
|
|
20
20
|
components: []
|
|
21
|
-
}],
|
|
22
|
-
if (
|
|
21
|
+
}], y = this.extractCommon(p[0], t, n, 0);
|
|
22
|
+
if (p[0].newPos + 1 >= r && y + 1 >= a)
|
|
23
23
|
return i([{
|
|
24
24
|
value: this.join(t),
|
|
25
25
|
count: t.length
|
|
26
26
|
}]);
|
|
27
|
-
function
|
|
28
|
-
for (var
|
|
29
|
-
var
|
|
30
|
-
S && (
|
|
31
|
-
var
|
|
32
|
-
if (!
|
|
33
|
-
|
|
27
|
+
function m() {
|
|
28
|
+
for (var g = -1 * c; g <= c; g += 2) {
|
|
29
|
+
var _ = void 0, S = p[g - 1], M = p[g + 1], O = (M ? M.newPos : 0) - g;
|
|
30
|
+
S && (p[g - 1] = void 0);
|
|
31
|
+
var T = S && S.newPos + 1 < r, D = M && 0 <= O && O < a;
|
|
32
|
+
if (!T && !D) {
|
|
33
|
+
p[g] = void 0;
|
|
34
34
|
continue;
|
|
35
35
|
}
|
|
36
|
-
if (!
|
|
37
|
-
return i(
|
|
38
|
-
|
|
36
|
+
if (!T || D && S.newPos < M.newPos ? (_ = Bn(M), l.pushComponent(_.components, void 0, !0)) : (_ = S, _.newPos++, l.pushComponent(_.components, !0, void 0)), O = l.extractCommon(_, t, n, g), _.newPos + 1 >= r && O + 1 >= a)
|
|
37
|
+
return i(kn(l, _.components, t, n, l.useLongestToken));
|
|
38
|
+
p[g] = _;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
c++;
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
43
|
-
(function
|
|
42
|
+
if (o)
|
|
43
|
+
(function g() {
|
|
44
44
|
setTimeout(function() {
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
47
|
-
|
|
45
|
+
if (c > b)
|
|
46
|
+
return o();
|
|
47
|
+
m() || g();
|
|
48
48
|
}, 0);
|
|
49
49
|
})();
|
|
50
50
|
else
|
|
51
|
-
for (;
|
|
52
|
-
var
|
|
53
|
-
if (
|
|
54
|
-
return
|
|
51
|
+
for (; c <= b; ) {
|
|
52
|
+
var N = m();
|
|
53
|
+
if (N)
|
|
54
|
+
return N;
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
pushComponent: function(n, t, s) {
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
count:
|
|
58
|
+
var o = n[n.length - 1];
|
|
59
|
+
o && o.added === t && o.removed === s ? n[n.length - 1] = {
|
|
60
|
+
count: o.count + 1,
|
|
61
61
|
added: t,
|
|
62
62
|
removed: s
|
|
63
63
|
} : n.push({
|
|
@@ -66,11 +66,11 @@ j.prototype = {
|
|
|
66
66
|
removed: s
|
|
67
67
|
});
|
|
68
68
|
},
|
|
69
|
-
extractCommon: function(n, t, s,
|
|
70
|
-
for (var l = t.length, i = s.length, r = n.newPos, a = r -
|
|
71
|
-
r++, a++,
|
|
72
|
-
return
|
|
73
|
-
count:
|
|
69
|
+
extractCommon: function(n, t, s, o) {
|
|
70
|
+
for (var l = t.length, i = s.length, r = n.newPos, a = r - o, c = 0; r + 1 < l && a + 1 < i && this.equals(t[r + 1], s[a + 1]); )
|
|
71
|
+
r++, a++, c++;
|
|
72
|
+
return c && n.components.push({
|
|
73
|
+
count: c
|
|
74
74
|
}), n.newPos = r, a;
|
|
75
75
|
},
|
|
76
76
|
equals: function(n, t) {
|
|
@@ -91,40 +91,40 @@ j.prototype = {
|
|
|
91
91
|
return n.join("");
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
function
|
|
94
|
+
function kn(e, n, t, s, o) {
|
|
95
95
|
for (var l = 0, i = n.length, r = 0, a = 0; l < i; l++) {
|
|
96
|
-
var
|
|
97
|
-
if (
|
|
98
|
-
if (
|
|
99
|
-
var
|
|
100
|
-
n[l - 1] = n[l], n[l] =
|
|
96
|
+
var c = n[l];
|
|
97
|
+
if (c.removed) {
|
|
98
|
+
if (c.value = e.join(s.slice(a, a + c.count)), a += c.count, l && n[l - 1].added) {
|
|
99
|
+
var p = n[l - 1];
|
|
100
|
+
n[l - 1] = n[l], n[l] = p;
|
|
101
101
|
}
|
|
102
102
|
} else {
|
|
103
|
-
if (!
|
|
104
|
-
var b = t.slice(r, r +
|
|
105
|
-
b = b.map(function(
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
}),
|
|
103
|
+
if (!c.added && o) {
|
|
104
|
+
var b = t.slice(r, r + c.count);
|
|
105
|
+
b = b.map(function(m, N) {
|
|
106
|
+
var g = s[a + N];
|
|
107
|
+
return g.length > m.length ? g : m;
|
|
108
|
+
}), c.value = e.join(b);
|
|
109
109
|
} else
|
|
110
|
-
|
|
111
|
-
r +=
|
|
110
|
+
c.value = e.join(t.slice(r, r + c.count));
|
|
111
|
+
r += c.count, c.added || (a += c.count);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
var
|
|
115
|
-
return i > 1 && typeof
|
|
114
|
+
var y = n[i - 1];
|
|
115
|
+
return i > 1 && typeof y.value == "string" && (y.added || y.removed) && e.equals("", y.value) && (n[i - 2].value += y.value, n.pop()), n;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Bn(e) {
|
|
118
118
|
return {
|
|
119
119
|
newPos: e.newPos,
|
|
120
120
|
components: e.components.slice(0)
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
var
|
|
124
|
-
function
|
|
125
|
-
return
|
|
123
|
+
var $n = new j();
|
|
124
|
+
function Un(e, n, t) {
|
|
125
|
+
return $n.diff(e, n, t);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Pn(e, n) {
|
|
128
128
|
if (typeof e == "function")
|
|
129
129
|
n.callback = e;
|
|
130
130
|
else if (e)
|
|
@@ -141,8 +141,8 @@ ze.tokenize = function(e) {
|
|
|
141
141
|
!n[t + 1] && n[t + 2] && Je.test(n[t]) && Je.test(n[t + 2]) && (n[t] += n[t + 2], n.splice(t + 1, 2), t--);
|
|
142
142
|
return n;
|
|
143
143
|
};
|
|
144
|
-
function
|
|
145
|
-
return t =
|
|
144
|
+
function Hn(e, n, t) {
|
|
145
|
+
return t = Pn(t, {
|
|
146
146
|
ignoreWhitespace: !0
|
|
147
147
|
}), ze.diff(e, n, t);
|
|
148
148
|
}
|
|
@@ -151,54 +151,54 @@ Fe.tokenize = function(e) {
|
|
|
151
151
|
var n = [], t = e.split(/(\n|\r\n)/);
|
|
152
152
|
t[t.length - 1] || t.pop();
|
|
153
153
|
for (var s = 0; s < t.length; s++) {
|
|
154
|
-
var
|
|
155
|
-
s % 2 && !this.options.newlineIsToken ? n[n.length - 1] +=
|
|
154
|
+
var o = t[s];
|
|
155
|
+
s % 2 && !this.options.newlineIsToken ? n[n.length - 1] += o : (this.options.ignoreWhitespace && (o = o.trim()), n.push(o));
|
|
156
156
|
}
|
|
157
157
|
return n;
|
|
158
158
|
};
|
|
159
159
|
function fn(e, n, t) {
|
|
160
160
|
return Fe.diff(e, n, t);
|
|
161
161
|
}
|
|
162
|
-
var Hn = new j();
|
|
163
|
-
Hn.tokenize = function(e) {
|
|
164
|
-
return e.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
165
|
-
};
|
|
166
162
|
var zn = new j();
|
|
167
163
|
zn.tokenize = function(e) {
|
|
164
|
+
return e.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
165
|
+
};
|
|
166
|
+
var Fn = new j();
|
|
167
|
+
Fn.tokenize = function(e) {
|
|
168
168
|
return e.split(/([{}:;,]|\s+)/);
|
|
169
169
|
};
|
|
170
|
-
function
|
|
171
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
170
|
+
function xe(e) {
|
|
171
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? xe = function(n) {
|
|
172
172
|
return typeof n;
|
|
173
|
-
} :
|
|
173
|
+
} : xe = function(n) {
|
|
174
174
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
175
|
-
},
|
|
175
|
+
}, xe(e);
|
|
176
176
|
}
|
|
177
|
-
var
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
var n = this.options, t = n.undefinedReplacement, s = n.stringifyReplacer,
|
|
177
|
+
var Gn = Object.prototype.toString, be = new j();
|
|
178
|
+
be.useLongestToken = !0;
|
|
179
|
+
be.tokenize = Fe.tokenize;
|
|
180
|
+
be.castInput = function(e) {
|
|
181
|
+
var n = this.options, t = n.undefinedReplacement, s = n.stringifyReplacer, o = s === void 0 ? function(l, i) {
|
|
182
182
|
return typeof i > "u" ? t : i;
|
|
183
183
|
} : s;
|
|
184
|
-
return typeof e == "string" ? e : JSON.stringify(Ue(e, null, null,
|
|
184
|
+
return typeof e == "string" ? e : JSON.stringify(Ue(e, null, null, o), o, " ");
|
|
185
185
|
};
|
|
186
|
-
|
|
187
|
-
return j.prototype.equals.call(
|
|
186
|
+
be.equals = function(e, n) {
|
|
187
|
+
return j.prototype.equals.call(be, e.replace(/,([\r\n])/g, "$1"), n.replace(/,([\r\n])/g, "$1"));
|
|
188
188
|
};
|
|
189
|
-
function Ue(e, n, t, s,
|
|
190
|
-
n = n || [], t = t || [], s && (e = s(
|
|
189
|
+
function Ue(e, n, t, s, o) {
|
|
190
|
+
n = n || [], t = t || [], s && (e = s(o, e));
|
|
191
191
|
var l;
|
|
192
192
|
for (l = 0; l < n.length; l += 1)
|
|
193
193
|
if (n[l] === e)
|
|
194
194
|
return t[l];
|
|
195
195
|
var i;
|
|
196
|
-
if (
|
|
196
|
+
if (Gn.call(e) === "[object Array]") {
|
|
197
197
|
for (n.push(e), i = new Array(e.length), t.push(i), l = 0; l < e.length; l += 1)
|
|
198
|
-
i[l] = Ue(e[l], n, t, s,
|
|
198
|
+
i[l] = Ue(e[l], n, t, s, o);
|
|
199
199
|
return n.pop(), t.pop(), i;
|
|
200
200
|
}
|
|
201
|
-
if (e && e.toJSON && (e = e.toJSON()),
|
|
201
|
+
if (e && e.toJSON && (e = e.toJSON()), xe(e) === "object" && e !== null) {
|
|
202
202
|
n.push(e), i = {}, t.push(i);
|
|
203
203
|
var r = [], a;
|
|
204
204
|
for (a in e)
|
|
@@ -249,22 +249,22 @@ function ne(e, ...n) {
|
|
|
249
249
|
for (const s in e)
|
|
250
250
|
t[s] = e[s];
|
|
251
251
|
return n.forEach(function(s) {
|
|
252
|
-
for (const
|
|
253
|
-
t[
|
|
252
|
+
for (const o in s)
|
|
253
|
+
t[o] = s[o];
|
|
254
254
|
}), /** @type {T} */
|
|
255
255
|
t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const Kn = "</span>", tn = (e) => !!e.scope || e.sublanguage && e.language, Wn = (e, { prefix: n }) => {
|
|
258
258
|
if (e.includes(".")) {
|
|
259
259
|
const t = e.split(".");
|
|
260
260
|
return [
|
|
261
261
|
`${n}${t.shift()}`,
|
|
262
|
-
...t.map((s,
|
|
262
|
+
...t.map((s, o) => `${s}${"_".repeat(o + 1)}`)
|
|
263
263
|
].join(" ");
|
|
264
264
|
}
|
|
265
265
|
return `${n}${e}`;
|
|
266
266
|
};
|
|
267
|
-
class
|
|
267
|
+
class Yn {
|
|
268
268
|
/**
|
|
269
269
|
* Creates a new HTMLRenderer
|
|
270
270
|
*
|
|
@@ -289,14 +289,14 @@ class Wn {
|
|
|
289
289
|
if (!tn(n))
|
|
290
290
|
return;
|
|
291
291
|
let t = "";
|
|
292
|
-
n.sublanguage ? t = `language-${n.language}` : t =
|
|
292
|
+
n.sublanguage ? t = `language-${n.language}` : t = Wn(n.scope, { prefix: this.classPrefix }), this.span(t);
|
|
293
293
|
}
|
|
294
294
|
/**
|
|
295
295
|
* Adds a node close to the output stream (if needed)
|
|
296
296
|
*
|
|
297
297
|
* @param {Node} node */
|
|
298
298
|
closeNode(n) {
|
|
299
|
-
tn(n) && (this.buffer +=
|
|
299
|
+
tn(n) && (this.buffer += Kn);
|
|
300
300
|
}
|
|
301
301
|
/**
|
|
302
302
|
* returns the accumulated buffer
|
|
@@ -370,7 +370,7 @@ class We {
|
|
|
370
370
|
}));
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
class
|
|
373
|
+
class Zn extends We {
|
|
374
374
|
/**
|
|
375
375
|
* @param {*} options
|
|
376
376
|
*/
|
|
@@ -399,60 +399,60 @@ class Yn extends We {
|
|
|
399
399
|
s.sublanguage = !0, s.language = t, this.add(s);
|
|
400
400
|
}
|
|
401
401
|
toHTML() {
|
|
402
|
-
return new
|
|
402
|
+
return new Yn(this, this.options).value();
|
|
403
403
|
}
|
|
404
404
|
finalize() {
|
|
405
405
|
return !0;
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Ee(e) {
|
|
409
409
|
return e ? typeof e == "string" ? e : e.source : null;
|
|
410
410
|
}
|
|
411
411
|
function gn(e) {
|
|
412
412
|
return ie("(?=", e, ")");
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function Qn(e) {
|
|
415
415
|
return ie("(?:", e, ")*");
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function qn(e) {
|
|
418
418
|
return ie("(?:", e, ")?");
|
|
419
419
|
}
|
|
420
420
|
function ie(...e) {
|
|
421
|
-
return e.map((t) =>
|
|
421
|
+
return e.map((t) => Ee(t)).join("");
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function Xn(e) {
|
|
424
424
|
const n = e[e.length - 1];
|
|
425
425
|
return typeof n == "object" && n.constructor === Object ? (e.splice(e.length - 1, 1), n) : {};
|
|
426
426
|
}
|
|
427
427
|
function Ye(...e) {
|
|
428
|
-
return "(" + (
|
|
428
|
+
return "(" + (Xn(e).capture ? "" : "?:") + e.map((s) => Ee(s)).join("|") + ")";
|
|
429
429
|
}
|
|
430
430
|
function pn(e) {
|
|
431
431
|
return new RegExp(e.toString() + "|").exec("").length - 1;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function Vn(e, n) {
|
|
434
434
|
const t = e && e.exec(n);
|
|
435
435
|
return t && t.index === 0;
|
|
436
436
|
}
|
|
437
|
-
const
|
|
437
|
+
const jn = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
438
438
|
function Ze(e, { joinWith: n }) {
|
|
439
439
|
let t = 0;
|
|
440
440
|
return e.map((s) => {
|
|
441
441
|
t += 1;
|
|
442
|
-
const
|
|
443
|
-
let l =
|
|
442
|
+
const o = t;
|
|
443
|
+
let l = Ee(s), i = "";
|
|
444
444
|
for (; l.length > 0; ) {
|
|
445
|
-
const r =
|
|
445
|
+
const r = jn.exec(l);
|
|
446
446
|
if (!r) {
|
|
447
447
|
i += l;
|
|
448
448
|
break;
|
|
449
449
|
}
|
|
450
|
-
i += l.substring(0, r.index), l = l.substring(r.index + r[0].length), r[0][0] === "\\" && r[1] ? i += "\\" + String(Number(r[1]) +
|
|
450
|
+
i += l.substring(0, r.index), l = l.substring(r.index + r[0].length), r[0][0] === "\\" && r[1] ? i += "\\" + String(Number(r[1]) + o) : (i += r[0], r[0] === "(" && t++);
|
|
451
451
|
}
|
|
452
452
|
return i;
|
|
453
453
|
}).map((s) => `(${s})`).join(n);
|
|
454
454
|
}
|
|
455
|
-
const
|
|
455
|
+
const Jn = /\b\B/, hn = "[a-zA-Z]\\w*", Qe = "[a-zA-Z_]\\w*", bn = "\\b\\d+(\\.\\d+)?", En = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", _n = "\\b(0b[01]+)", et = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", nt = (e = {}) => {
|
|
456
456
|
const n = /^#![ ]*\//;
|
|
457
457
|
return e.binary && (e.begin = ie(
|
|
458
458
|
n,
|
|
@@ -469,24 +469,24 @@ const jn = /\b\B/, bn = "[a-zA-Z]\\w*", Qe = "[a-zA-Z_]\\w*", hn = "\\b\\d+(\\.\
|
|
|
469
469
|
t.index !== 0 && s.ignoreMatch();
|
|
470
470
|
}
|
|
471
471
|
}, e);
|
|
472
|
-
},
|
|
472
|
+
}, _e = {
|
|
473
473
|
begin: "\\\\[\\s\\S]",
|
|
474
474
|
relevance: 0
|
|
475
|
-
},
|
|
475
|
+
}, tt = {
|
|
476
476
|
scope: "string",
|
|
477
477
|
begin: "'",
|
|
478
478
|
end: "'",
|
|
479
479
|
illegal: "\\n",
|
|
480
|
-
contains: [
|
|
481
|
-
},
|
|
480
|
+
contains: [_e]
|
|
481
|
+
}, st = {
|
|
482
482
|
scope: "string",
|
|
483
483
|
begin: '"',
|
|
484
484
|
end: '"',
|
|
485
485
|
illegal: "\\n",
|
|
486
|
-
contains: [
|
|
487
|
-
},
|
|
486
|
+
contains: [_e]
|
|
487
|
+
}, it = {
|
|
488
488
|
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
|
|
489
|
-
},
|
|
489
|
+
}, Ce = function(e, n, t = {}) {
|
|
490
490
|
const s = ne(
|
|
491
491
|
{
|
|
492
492
|
scope: "comment",
|
|
@@ -505,7 +505,7 @@ const jn = /\b\B/, bn = "[a-zA-Z]\\w*", Qe = "[a-zA-Z_]\\w*", hn = "\\b\\d+(\\.\
|
|
|
505
505
|
excludeBegin: !0,
|
|
506
506
|
relevance: 0
|
|
507
507
|
});
|
|
508
|
-
const
|
|
508
|
+
const o = Ye(
|
|
509
509
|
// list of common 1 and 2 letter words in English
|
|
510
510
|
"I",
|
|
511
511
|
"a",
|
|
@@ -545,26 +545,26 @@ const jn = /\b\B/, bn = "[a-zA-Z]\\w*", Qe = "[a-zA-Z_]\\w*", hn = "\\b\\d+(\\.\
|
|
|
545
545
|
/[ ]+/,
|
|
546
546
|
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
547
547
|
"(",
|
|
548
|
-
|
|
548
|
+
o,
|
|
549
549
|
/[.]?[:]?([.][ ]|[ ])/,
|
|
550
550
|
"){3}"
|
|
551
551
|
)
|
|
552
552
|
// look for 3 words in a row
|
|
553
553
|
}
|
|
554
554
|
), s;
|
|
555
|
-
},
|
|
555
|
+
}, rt = Ce("//", "$"), at = Ce("/\\*", "\\*/"), ot = Ce("#", "$"), ct = {
|
|
556
556
|
scope: "number",
|
|
557
|
-
begin:
|
|
557
|
+
begin: bn,
|
|
558
558
|
relevance: 0
|
|
559
|
-
},
|
|
559
|
+
}, lt = {
|
|
560
560
|
scope: "number",
|
|
561
561
|
begin: En,
|
|
562
562
|
relevance: 0
|
|
563
|
-
},
|
|
563
|
+
}, ut = {
|
|
564
564
|
scope: "number",
|
|
565
565
|
begin: _n,
|
|
566
566
|
relevance: 0
|
|
567
|
-
},
|
|
567
|
+
}, ft = {
|
|
568
568
|
// this outer rule makes sure we actually have a WHOLE regex and not simply
|
|
569
569
|
// an expression such as:
|
|
570
570
|
//
|
|
@@ -578,28 +578,28 @@ const jn = /\b\B/, bn = "[a-zA-Z]\\w*", Qe = "[a-zA-Z_]\\w*", hn = "\\b\\d+(\\.\
|
|
|
578
578
|
end: /\/[gimuy]*/,
|
|
579
579
|
illegal: /\n/,
|
|
580
580
|
contains: [
|
|
581
|
-
|
|
581
|
+
_e,
|
|
582
582
|
{
|
|
583
583
|
begin: /\[/,
|
|
584
584
|
end: /\]/,
|
|
585
585
|
relevance: 0,
|
|
586
|
-
contains: [
|
|
586
|
+
contains: [_e]
|
|
587
587
|
}
|
|
588
588
|
]
|
|
589
589
|
}]
|
|
590
|
-
},
|
|
590
|
+
}, dt = {
|
|
591
591
|
scope: "title",
|
|
592
|
-
begin:
|
|
592
|
+
begin: hn,
|
|
593
593
|
relevance: 0
|
|
594
|
-
},
|
|
594
|
+
}, gt = {
|
|
595
595
|
scope: "title",
|
|
596
596
|
begin: Qe,
|
|
597
597
|
relevance: 0
|
|
598
|
-
},
|
|
598
|
+
}, pt = {
|
|
599
599
|
// excludes method names from keyword processing
|
|
600
600
|
begin: "\\.\\s*" + Qe,
|
|
601
601
|
relevance: 0
|
|
602
|
-
},
|
|
602
|
+
}, ht = function(e) {
|
|
603
603
|
return Object.assign(
|
|
604
604
|
e,
|
|
605
605
|
{
|
|
@@ -614,56 +614,56 @@ const jn = /\b\B/, bn = "[a-zA-Z]\\w*", Qe = "[a-zA-Z_]\\w*", hn = "\\b\\d+(\\.\
|
|
|
614
614
|
}
|
|
615
615
|
);
|
|
616
616
|
};
|
|
617
|
-
var
|
|
617
|
+
var Se = /* @__PURE__ */ Object.freeze({
|
|
618
618
|
__proto__: null,
|
|
619
|
-
MATCH_NOTHING_RE:
|
|
620
|
-
IDENT_RE:
|
|
619
|
+
MATCH_NOTHING_RE: Jn,
|
|
620
|
+
IDENT_RE: hn,
|
|
621
621
|
UNDERSCORE_IDENT_RE: Qe,
|
|
622
|
-
NUMBER_RE:
|
|
622
|
+
NUMBER_RE: bn,
|
|
623
623
|
C_NUMBER_RE: En,
|
|
624
624
|
BINARY_NUMBER_RE: _n,
|
|
625
|
-
RE_STARTERS_RE:
|
|
626
|
-
SHEBANG:
|
|
627
|
-
BACKSLASH_ESCAPE:
|
|
628
|
-
APOS_STRING_MODE:
|
|
629
|
-
QUOTE_STRING_MODE:
|
|
630
|
-
PHRASAL_WORDS_MODE:
|
|
631
|
-
COMMENT:
|
|
632
|
-
C_LINE_COMMENT_MODE:
|
|
633
|
-
C_BLOCK_COMMENT_MODE:
|
|
634
|
-
HASH_COMMENT_MODE:
|
|
635
|
-
NUMBER_MODE:
|
|
636
|
-
C_NUMBER_MODE:
|
|
637
|
-
BINARY_NUMBER_MODE:
|
|
638
|
-
REGEXP_MODE:
|
|
639
|
-
TITLE_MODE:
|
|
640
|
-
UNDERSCORE_TITLE_MODE:
|
|
641
|
-
METHOD_GUARD:
|
|
642
|
-
END_SAME_AS_BEGIN:
|
|
625
|
+
RE_STARTERS_RE: et,
|
|
626
|
+
SHEBANG: nt,
|
|
627
|
+
BACKSLASH_ESCAPE: _e,
|
|
628
|
+
APOS_STRING_MODE: tt,
|
|
629
|
+
QUOTE_STRING_MODE: st,
|
|
630
|
+
PHRASAL_WORDS_MODE: it,
|
|
631
|
+
COMMENT: Ce,
|
|
632
|
+
C_LINE_COMMENT_MODE: rt,
|
|
633
|
+
C_BLOCK_COMMENT_MODE: at,
|
|
634
|
+
HASH_COMMENT_MODE: ot,
|
|
635
|
+
NUMBER_MODE: ct,
|
|
636
|
+
C_NUMBER_MODE: lt,
|
|
637
|
+
BINARY_NUMBER_MODE: ut,
|
|
638
|
+
REGEXP_MODE: ft,
|
|
639
|
+
TITLE_MODE: dt,
|
|
640
|
+
UNDERSCORE_TITLE_MODE: gt,
|
|
641
|
+
METHOD_GUARD: pt,
|
|
642
|
+
END_SAME_AS_BEGIN: ht
|
|
643
643
|
});
|
|
644
644
|
function bt(e, n) {
|
|
645
645
|
e.input[e.index - 1] === "." && n.ignoreMatch();
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function Et(e, n) {
|
|
648
648
|
e.className !== void 0 && (e.scope = e.className, delete e.className);
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function _t(e, n) {
|
|
651
651
|
n && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = bt, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function mt(e, n) {
|
|
654
654
|
Array.isArray(e.illegal) && (e.illegal = Ye(...e.illegal));
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function yt(e, n) {
|
|
657
657
|
if (e.match) {
|
|
658
658
|
if (e.begin || e.end)
|
|
659
659
|
throw new Error("begin & end are not supported with match");
|
|
660
660
|
e.begin = e.match, delete e.match;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Nt(e, n) {
|
|
664
664
|
e.relevance === void 0 && (e.relevance = 1);
|
|
665
665
|
}
|
|
666
|
-
const
|
|
666
|
+
const At = (e, n) => {
|
|
667
667
|
if (!e.beforeMatch)
|
|
668
668
|
return;
|
|
669
669
|
if (e.starts)
|
|
@@ -677,7 +677,7 @@ const Nt = (e, n) => {
|
|
|
677
677
|
Object.assign(t, { endsParent: !0 })
|
|
678
678
|
]
|
|
679
679
|
}, e.relevance = 0, delete t.beforeMatch;
|
|
680
|
-
},
|
|
680
|
+
}, vt = [
|
|
681
681
|
"of",
|
|
682
682
|
"and",
|
|
683
683
|
"for",
|
|
@@ -692,27 +692,27 @@ const Nt = (e, n) => {
|
|
|
692
692
|
// common variable name
|
|
693
693
|
"value"
|
|
694
694
|
// common variable name
|
|
695
|
-
],
|
|
696
|
-
function mn(e, n, t =
|
|
695
|
+
], Tt = "keyword";
|
|
696
|
+
function mn(e, n, t = Tt) {
|
|
697
697
|
const s = /* @__PURE__ */ Object.create(null);
|
|
698
|
-
return typeof e == "string" ?
|
|
698
|
+
return typeof e == "string" ? o(t, e.split(" ")) : Array.isArray(e) ? o(t, e) : Object.keys(e).forEach(function(l) {
|
|
699
699
|
Object.assign(
|
|
700
700
|
s,
|
|
701
701
|
mn(e[l], n, l)
|
|
702
702
|
);
|
|
703
703
|
}), s;
|
|
704
|
-
function
|
|
704
|
+
function o(l, i) {
|
|
705
705
|
n && (i = i.map((r) => r.toLowerCase())), i.forEach(function(r) {
|
|
706
706
|
const a = r.split("|");
|
|
707
|
-
s[a[0]] = [l,
|
|
707
|
+
s[a[0]] = [l, wt(a[0], a[1])];
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
return n ? Number(n) :
|
|
711
|
+
function wt(e, n) {
|
|
712
|
+
return n ? Number(n) : St(e) ? 0 : 1;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return
|
|
714
|
+
function St(e) {
|
|
715
|
+
return vt.includes(e.toLowerCase());
|
|
716
716
|
}
|
|
717
717
|
const rn = {}, se = (e) => {
|
|
718
718
|
console.error(e);
|
|
@@ -720,42 +720,42 @@ const rn = {}, se = (e) => {
|
|
|
720
720
|
console.log(`WARN: ${e}`, ...n);
|
|
721
721
|
}, ce = (e, n) => {
|
|
722
722
|
rn[`${e}/${n}`] || (console.log(`Deprecated as of ${e}. ${n}`), rn[`${e}/${n}`] = !0);
|
|
723
|
-
},
|
|
723
|
+
}, Le = new Error();
|
|
724
724
|
function yn(e, n, { key: t }) {
|
|
725
725
|
let s = 0;
|
|
726
|
-
const
|
|
726
|
+
const o = e[t], l = {}, i = {};
|
|
727
727
|
for (let r = 1; r <= n.length; r++)
|
|
728
|
-
i[r + s] =
|
|
728
|
+
i[r + s] = o[r], l[r + s] = !0, s += pn(n[r - 1]);
|
|
729
729
|
e[t] = i, e[t]._emit = l, e[t]._multi = !0;
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Mt(e) {
|
|
732
732
|
if (Array.isArray(e.begin)) {
|
|
733
733
|
if (e.skip || e.excludeBegin || e.returnBegin)
|
|
734
|
-
throw se("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),
|
|
734
|
+
throw se("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), Le;
|
|
735
735
|
if (typeof e.beginScope != "object" || e.beginScope === null)
|
|
736
|
-
throw se("beginScope must be object"),
|
|
736
|
+
throw se("beginScope must be object"), Le;
|
|
737
737
|
yn(e, e.begin, { key: "beginScope" }), e.begin = Ze(e.begin, { joinWith: "" });
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function Rt(e) {
|
|
741
741
|
if (Array.isArray(e.end)) {
|
|
742
742
|
if (e.skip || e.excludeEnd || e.returnEnd)
|
|
743
|
-
throw se("skip, excludeEnd, returnEnd not compatible with endScope: {}"),
|
|
743
|
+
throw se("skip, excludeEnd, returnEnd not compatible with endScope: {}"), Le;
|
|
744
744
|
if (typeof e.endScope != "object" || e.endScope === null)
|
|
745
|
-
throw se("endScope must be object"),
|
|
745
|
+
throw se("endScope must be object"), Le;
|
|
746
746
|
yn(e, e.end, { key: "endScope" }), e.end = Ze(e.end, { joinWith: "" });
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function xt(e) {
|
|
750
750
|
e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
|
|
751
751
|
}
|
|
752
752
|
function Ot(e) {
|
|
753
|
-
|
|
753
|
+
xt(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), Mt(e), Rt(e);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function Lt(e) {
|
|
756
756
|
function n(i, r) {
|
|
757
757
|
return new RegExp(
|
|
758
|
-
|
|
758
|
+
Ee(i),
|
|
759
759
|
"m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (r ? "g" : "")
|
|
760
760
|
);
|
|
761
761
|
}
|
|
@@ -778,8 +778,8 @@ function xt(e) {
|
|
|
778
778
|
const a = this.matcherRe.exec(r);
|
|
779
779
|
if (!a)
|
|
780
780
|
return null;
|
|
781
|
-
const
|
|
782
|
-
return a.splice(0,
|
|
781
|
+
const c = a.findIndex((p, y) => y > 0 && p !== void 0), b = this.matchIndexes[c];
|
|
782
|
+
return a.splice(0, c), Object.assign(a, b);
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
class s {
|
|
@@ -791,7 +791,7 @@ function xt(e) {
|
|
|
791
791
|
if (this.multiRegexes[r])
|
|
792
792
|
return this.multiRegexes[r];
|
|
793
793
|
const a = new t();
|
|
794
|
-
return this.rules.slice(r).forEach(([
|
|
794
|
+
return this.rules.slice(r).forEach(([c, b]) => a.addRule(c, b)), a.compile(), this.multiRegexes[r] = a, a;
|
|
795
795
|
}
|
|
796
796
|
resumingScanAtSamePosition() {
|
|
797
797
|
return this.regexIndex !== 0;
|
|
@@ -807,15 +807,15 @@ function xt(e) {
|
|
|
807
807
|
exec(r) {
|
|
808
808
|
const a = this.getMatcher(this.regexIndex);
|
|
809
809
|
a.lastIndex = this.lastIndex;
|
|
810
|
-
let
|
|
811
|
-
if (this.resumingScanAtSamePosition() && !(
|
|
810
|
+
let c = a.exec(r);
|
|
811
|
+
if (this.resumingScanAtSamePosition() && !(c && c.index === this.lastIndex)) {
|
|
812
812
|
const b = this.getMatcher(0);
|
|
813
|
-
b.lastIndex = this.lastIndex + 1,
|
|
813
|
+
b.lastIndex = this.lastIndex + 1, c = b.exec(r);
|
|
814
814
|
}
|
|
815
|
-
return
|
|
815
|
+
return c && (this.regexIndex += c.position + 1, this.regexIndex === this.count && this.considerAll()), c;
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function o(i) {
|
|
819
819
|
const r = new s();
|
|
820
820
|
return i.contains.forEach((a) => r.addRule(a.begin, { rule: a, type: "begin" })), i.terminatorEnd && r.addRule(i.terminatorEnd, { type: "end" }), i.illegal && r.addRule(i.illegal, { type: "illegal" }), r;
|
|
821
821
|
}
|
|
@@ -827,33 +827,33 @@ function xt(e) {
|
|
|
827
827
|
if (i.isCompiled)
|
|
828
828
|
return a;
|
|
829
829
|
[
|
|
830
|
-
|
|
830
|
+
Et,
|
|
831
831
|
// do this early so compiler extensions generally don't have to worry about
|
|
832
832
|
// the distinction between match/begin
|
|
833
|
-
|
|
833
|
+
yt,
|
|
834
834
|
Ot,
|
|
835
|
-
|
|
835
|
+
At
|
|
836
836
|
].forEach((b) => b(i, r)), e.compilerExtensions.forEach((b) => b(i, r)), i.__beforeBegin = null, [
|
|
837
|
-
|
|
837
|
+
_t,
|
|
838
838
|
// do this later so compiler extensions that come earlier have access to the
|
|
839
839
|
// raw array if they wanted to perhaps manipulate it, etc.
|
|
840
|
-
|
|
840
|
+
mt,
|
|
841
841
|
// default to 1 relevance if not specified
|
|
842
|
-
|
|
842
|
+
Nt
|
|
843
843
|
].forEach((b) => b(i, r)), i.isCompiled = !0;
|
|
844
|
-
let
|
|
845
|
-
return typeof i.keywords == "object" && i.keywords.$pattern && (i.keywords = Object.assign({}, i.keywords),
|
|
844
|
+
let c = null;
|
|
845
|
+
return typeof i.keywords == "object" && i.keywords.$pattern && (i.keywords = Object.assign({}, i.keywords), c = i.keywords.$pattern, delete i.keywords.$pattern), c = c || /\w+/, i.keywords && (i.keywords = mn(i.keywords, e.case_insensitive)), a.keywordPatternRe = n(c, !0), r && (i.begin || (i.begin = /\B|\b/), a.beginRe = n(a.begin), !i.end && !i.endsWithParent && (i.end = /\B|\b/), i.end && (a.endRe = n(a.end)), a.terminatorEnd = Ee(a.end) || "", i.endsWithParent && r.terminatorEnd && (a.terminatorEnd += (i.end ? "|" : "") + r.terminatorEnd)), i.illegal && (a.illegalRe = n(
|
|
846
846
|
/** @type {RegExp | string} */
|
|
847
847
|
i.illegal
|
|
848
848
|
)), i.contains || (i.contains = []), i.contains = [].concat(...i.contains.map(function(b) {
|
|
849
|
-
return
|
|
849
|
+
return Dt(b === "self" ? i : b);
|
|
850
850
|
})), i.contains.forEach(function(b) {
|
|
851
851
|
l(
|
|
852
852
|
/** @type Mode */
|
|
853
853
|
b,
|
|
854
854
|
a
|
|
855
855
|
);
|
|
856
|
-
}), i.starts && l(i.starts, r), a.matcher =
|
|
856
|
+
}), i.starts && l(i.starts, r), a.matcher = o(a), a;
|
|
857
857
|
}
|
|
858
858
|
if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self"))
|
|
859
859
|
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
@@ -865,20 +865,20 @@ function xt(e) {
|
|
|
865
865
|
function Nn(e) {
|
|
866
866
|
return e ? e.endsWithParent || Nn(e.starts) : !1;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function Dt(e) {
|
|
869
869
|
return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(n) {
|
|
870
870
|
return ne(e, { variants: null }, n);
|
|
871
871
|
})), e.cachedVariants ? e.cachedVariants : Nn(e) ? ne(e, { starts: e.starts ? ne(e.starts) : null }) : Object.isFrozen(e) ? ne(e) : e;
|
|
872
872
|
}
|
|
873
|
-
var
|
|
874
|
-
class
|
|
873
|
+
var Ct = "11.7.0";
|
|
874
|
+
class It extends Error {
|
|
875
875
|
constructor(n, t) {
|
|
876
876
|
super(n), this.name = "HTMLInjectionError", this.html = t;
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
|
-
const
|
|
879
|
+
const $e = dn, on = ne, cn = Symbol("nomatch"), kt = 7, Bt = function(e) {
|
|
880
880
|
const n = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), s = [];
|
|
881
|
-
let
|
|
881
|
+
let o = !0;
|
|
882
882
|
const l = "Could not find the language '{}', did you forget to load/include a language module?", i = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
883
883
|
let r = {
|
|
884
884
|
ignoreUnescapedHTML: !1,
|
|
@@ -890,197 +890,197 @@ const Be = dn, on = ne, cn = Symbol("nomatch"), It = 7, kt = function(e) {
|
|
|
890
890
|
languages: null,
|
|
891
891
|
// beta configuration options, subject to change, welcome to discuss
|
|
892
892
|
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
893
|
-
__emitter:
|
|
893
|
+
__emitter: Zn
|
|
894
894
|
};
|
|
895
895
|
function a(u) {
|
|
896
896
|
return r.noHighlightRe.test(u);
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function c(u) {
|
|
899
899
|
let h = u.className + " ";
|
|
900
900
|
h += u.parentNode ? u.parentNode.className : "";
|
|
901
|
-
const
|
|
902
|
-
if (
|
|
903
|
-
const
|
|
904
|
-
return
|
|
901
|
+
const v = r.languageDetectRe.exec(h);
|
|
902
|
+
if (v) {
|
|
903
|
+
const x = U(v[1]);
|
|
904
|
+
return x || (an(l.replace("{}", v[1])), an("Falling back to no-highlight mode for this block.", u)), x ? v[1] : "no-highlight";
|
|
905
905
|
}
|
|
906
|
-
return h.split(/\s+/).find((
|
|
906
|
+
return h.split(/\s+/).find((x) => a(x) || U(x));
|
|
907
907
|
}
|
|
908
|
-
function b(u, h,
|
|
909
|
-
let
|
|
910
|
-
typeof h == "object" ? (
|
|
911
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
912
|
-
const
|
|
913
|
-
code:
|
|
914
|
-
language:
|
|
908
|
+
function b(u, h, v) {
|
|
909
|
+
let x = "", k = "";
|
|
910
|
+
typeof h == "object" ? (x = u, v = h.ignoreIllegals, k = h.language) : (ce("10.7.0", "highlight(lang, code, ...args) has been deprecated."), ce("10.7.0", `Please use highlight(code, options) instead.
|
|
911
|
+
https://github.com/highlightjs/highlight.js/issues/2277`), k = u, x = h), v === void 0 && (v = !0);
|
|
912
|
+
const F = {
|
|
913
|
+
code: x,
|
|
914
|
+
language: k
|
|
915
915
|
};
|
|
916
|
-
oe("before:highlight",
|
|
917
|
-
const Q =
|
|
918
|
-
return Q.code =
|
|
916
|
+
oe("before:highlight", F);
|
|
917
|
+
const Q = F.result ? F.result : p(F.language, F.code, v);
|
|
918
|
+
return Q.code = F.code, oe("after:highlight", Q), Q;
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
const
|
|
922
|
-
function
|
|
923
|
-
return f.keywords[
|
|
920
|
+
function p(u, h, v, x) {
|
|
921
|
+
const k = /* @__PURE__ */ Object.create(null);
|
|
922
|
+
function F(f, E) {
|
|
923
|
+
return f.keywords[E];
|
|
924
924
|
}
|
|
925
925
|
function Q() {
|
|
926
|
-
if (!
|
|
927
|
-
|
|
926
|
+
if (!A.keywords) {
|
|
927
|
+
P.addText(I);
|
|
928
928
|
return;
|
|
929
929
|
}
|
|
930
930
|
let f = 0;
|
|
931
|
-
|
|
932
|
-
let
|
|
933
|
-
for (;
|
|
934
|
-
w +=
|
|
935
|
-
const
|
|
936
|
-
if (
|
|
937
|
-
const [q,
|
|
938
|
-
if (
|
|
939
|
-
w +=
|
|
931
|
+
A.keywordPatternRe.lastIndex = 0;
|
|
932
|
+
let E = A.keywordPatternRe.exec(I), w = "";
|
|
933
|
+
for (; E; ) {
|
|
934
|
+
w += I.substring(f, E.index);
|
|
935
|
+
const L = ee.case_insensitive ? E[0].toLowerCase() : E[0], z = F(A, L);
|
|
936
|
+
if (z) {
|
|
937
|
+
const [q, Dn] = z;
|
|
938
|
+
if (P.addText(w), w = "", k[L] = (k[L] || 0) + 1, k[L] <= kt && (Te += Dn), q.startsWith("_"))
|
|
939
|
+
w += E[0];
|
|
940
940
|
else {
|
|
941
|
-
const
|
|
942
|
-
|
|
941
|
+
const Cn = ee.classNameAliases[q] || q;
|
|
942
|
+
P.addKeyword(E[0], Cn);
|
|
943
943
|
}
|
|
944
944
|
} else
|
|
945
|
-
w +=
|
|
946
|
-
f =
|
|
945
|
+
w += E[0];
|
|
946
|
+
f = A.keywordPatternRe.lastIndex, E = A.keywordPatternRe.exec(I);
|
|
947
947
|
}
|
|
948
|
-
w +=
|
|
948
|
+
w += I.substring(f), P.addText(w);
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
if (
|
|
950
|
+
function Ae() {
|
|
951
|
+
if (I === "")
|
|
952
952
|
return;
|
|
953
953
|
let f = null;
|
|
954
|
-
if (typeof
|
|
955
|
-
if (!n[
|
|
956
|
-
|
|
954
|
+
if (typeof A.subLanguage == "string") {
|
|
955
|
+
if (!n[A.subLanguage]) {
|
|
956
|
+
P.addText(I);
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
|
-
f =
|
|
959
|
+
f = p(A.subLanguage, I, !0, je[A.subLanguage]), je[A.subLanguage] = /** @type {CompiledMode} */
|
|
960
960
|
f._top;
|
|
961
961
|
} else
|
|
962
|
-
f =
|
|
963
|
-
|
|
962
|
+
f = m(I, A.subLanguage.length ? A.subLanguage : null);
|
|
963
|
+
A.relevance > 0 && (Te += f.relevance), P.addSublanguage(f._emitter, f.language);
|
|
964
964
|
}
|
|
965
|
-
function
|
|
966
|
-
|
|
965
|
+
function G() {
|
|
966
|
+
A.subLanguage != null ? Ae() : Q(), I = "";
|
|
967
967
|
}
|
|
968
|
-
function J(f,
|
|
968
|
+
function J(f, E) {
|
|
969
969
|
let w = 1;
|
|
970
|
-
const
|
|
971
|
-
for (; w <=
|
|
970
|
+
const L = E.length - 1;
|
|
971
|
+
for (; w <= L; ) {
|
|
972
972
|
if (!f._emit[w]) {
|
|
973
973
|
w++;
|
|
974
974
|
continue;
|
|
975
975
|
}
|
|
976
|
-
const
|
|
977
|
-
|
|
976
|
+
const z = ee.classNameAliases[f[w]] || f[w], q = E[w];
|
|
977
|
+
z ? P.addKeyword(q, z) : (I = q, Q(), I = ""), w++;
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
|
-
function qe(f,
|
|
981
|
-
return f.scope && typeof f.scope == "string" &&
|
|
980
|
+
function qe(f, E) {
|
|
981
|
+
return f.scope && typeof f.scope == "string" && P.openNode(ee.classNameAliases[f.scope] || f.scope), f.beginScope && (f.beginScope._wrap ? (P.addKeyword(I, ee.classNameAliases[f.beginScope._wrap] || f.beginScope._wrap), I = "") : f.beginScope._multi && (J(f.beginScope, E), I = "")), A = Object.create(f, { parent: { value: A } }), A;
|
|
982
982
|
}
|
|
983
|
-
function Xe(f,
|
|
984
|
-
let
|
|
985
|
-
if (
|
|
983
|
+
function Xe(f, E, w) {
|
|
984
|
+
let L = Vn(f.endRe, w);
|
|
985
|
+
if (L) {
|
|
986
986
|
if (f["on:end"]) {
|
|
987
|
-
const
|
|
988
|
-
f["on:end"](
|
|
987
|
+
const z = new nn(f);
|
|
988
|
+
f["on:end"](E, z), z.isMatchIgnored && (L = !1);
|
|
989
989
|
}
|
|
990
|
-
if (
|
|
990
|
+
if (L) {
|
|
991
991
|
for (; f.endsParent && f.parent; )
|
|
992
992
|
f = f.parent;
|
|
993
993
|
return f;
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
if (f.endsWithParent)
|
|
997
|
-
return Xe(f.parent,
|
|
998
|
-
}
|
|
999
|
-
function Sn(f) {
|
|
1000
|
-
return N.matcher.regexIndex === 0 ? (C += f[0], 1) : (ke = !0, 0);
|
|
997
|
+
return Xe(f.parent, E, w);
|
|
1001
998
|
}
|
|
1002
999
|
function Mn(f) {
|
|
1003
|
-
|
|
1004
|
-
for (const q of H)
|
|
1005
|
-
if (q && (q(f, O), O.isMatchIgnored))
|
|
1006
|
-
return Sn(_);
|
|
1007
|
-
return w.skip ? C += _ : (w.excludeBegin && (C += _), F(), !w.returnBegin && !w.excludeBegin && (C = _)), qe(w, f), w.returnBegin ? 0 : _.length;
|
|
1000
|
+
return A.matcher.regexIndex === 0 ? (I += f[0], 1) : (Be = !0, 0);
|
|
1008
1001
|
}
|
|
1009
1002
|
function Rn(f) {
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1003
|
+
const E = f[0], w = f.rule, L = new nn(w), z = [w.__beforeBegin, w["on:begin"]];
|
|
1004
|
+
for (const q of z)
|
|
1005
|
+
if (q && (q(f, L), L.isMatchIgnored))
|
|
1006
|
+
return Mn(E);
|
|
1007
|
+
return w.skip ? I += E : (w.excludeBegin && (I += E), G(), !w.returnBegin && !w.excludeBegin && (I = E)), qe(w, f), w.returnBegin ? 0 : E.length;
|
|
1008
|
+
}
|
|
1009
|
+
function xn(f) {
|
|
1010
|
+
const E = f[0], w = h.substring(f.index), L = Xe(A, f, w);
|
|
1011
|
+
if (!L)
|
|
1012
1012
|
return cn;
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1013
|
+
const z = A;
|
|
1014
|
+
A.endScope && A.endScope._wrap ? (G(), P.addKeyword(E, A.endScope._wrap)) : A.endScope && A.endScope._multi ? (G(), J(A.endScope, f)) : z.skip ? I += E : (z.returnEnd || z.excludeEnd || (I += E), G(), z.excludeEnd && (I = E));
|
|
1015
1015
|
do
|
|
1016
|
-
|
|
1017
|
-
while (
|
|
1018
|
-
return
|
|
1016
|
+
A.scope && P.closeNode(), !A.skip && !A.subLanguage && (Te += A.relevance), A = A.parent;
|
|
1017
|
+
while (A !== L.parent);
|
|
1018
|
+
return L.starts && qe(L.starts, f), z.returnEnd ? 0 : E.length;
|
|
1019
1019
|
}
|
|
1020
1020
|
function On() {
|
|
1021
1021
|
const f = [];
|
|
1022
|
-
for (let
|
|
1023
|
-
|
|
1024
|
-
f.forEach((
|
|
1022
|
+
for (let E = A; E !== ee; E = E.parent)
|
|
1023
|
+
E.scope && f.unshift(E.scope);
|
|
1024
|
+
f.forEach((E) => P.openNode(E));
|
|
1025
1025
|
}
|
|
1026
|
-
let
|
|
1027
|
-
function Ve(f,
|
|
1028
|
-
const w =
|
|
1029
|
-
if (
|
|
1030
|
-
return
|
|
1031
|
-
if (
|
|
1032
|
-
if (
|
|
1033
|
-
const
|
|
1034
|
-
throw
|
|
1026
|
+
let ve = {};
|
|
1027
|
+
function Ve(f, E) {
|
|
1028
|
+
const w = E && E[0];
|
|
1029
|
+
if (I += f, w == null)
|
|
1030
|
+
return G(), 0;
|
|
1031
|
+
if (ve.type === "begin" && E.type === "end" && ve.index === E.index && w === "") {
|
|
1032
|
+
if (I += h.slice(E.index, E.index + 1), !o) {
|
|
1033
|
+
const L = new Error(`0 width match regex (${u})`);
|
|
1034
|
+
throw L.languageName = u, L.badRule = ve.rule, L;
|
|
1035
1035
|
}
|
|
1036
1036
|
return 1;
|
|
1037
1037
|
}
|
|
1038
|
-
if (
|
|
1039
|
-
return
|
|
1040
|
-
if (
|
|
1041
|
-
const
|
|
1042
|
-
throw
|
|
1043
|
-
} else if (
|
|
1044
|
-
const
|
|
1045
|
-
if (
|
|
1046
|
-
return
|
|
1038
|
+
if (ve = E, E.type === "begin")
|
|
1039
|
+
return Rn(E);
|
|
1040
|
+
if (E.type === "illegal" && !v) {
|
|
1041
|
+
const L = new Error('Illegal lexeme "' + w + '" for mode "' + (A.scope || "<unnamed>") + '"');
|
|
1042
|
+
throw L.mode = A, L;
|
|
1043
|
+
} else if (E.type === "end") {
|
|
1044
|
+
const L = xn(E);
|
|
1045
|
+
if (L !== cn)
|
|
1046
|
+
return L;
|
|
1047
1047
|
}
|
|
1048
|
-
if (
|
|
1048
|
+
if (E.type === "illegal" && w === "")
|
|
1049
1049
|
return 1;
|
|
1050
|
-
if (
|
|
1050
|
+
if (ke > 1e5 && ke > E.index * 3)
|
|
1051
1051
|
throw new Error("potential infinite loop, way more iterations than matches");
|
|
1052
|
-
return
|
|
1052
|
+
return I += w, w.length;
|
|
1053
1053
|
}
|
|
1054
|
-
const ee =
|
|
1054
|
+
const ee = U(u);
|
|
1055
1055
|
if (!ee)
|
|
1056
1056
|
throw se(l.replace("{}", u)), new Error('Unknown language: "' + u + '"');
|
|
1057
|
-
const
|
|
1058
|
-
let
|
|
1059
|
-
const je = {},
|
|
1057
|
+
const Ln = Lt(ee);
|
|
1058
|
+
let Ie = "", A = x || Ln;
|
|
1059
|
+
const je = {}, P = new r.__emitter(r);
|
|
1060
1060
|
On();
|
|
1061
|
-
let
|
|
1061
|
+
let I = "", Te = 0, te = 0, ke = 0, Be = !1;
|
|
1062
1062
|
try {
|
|
1063
|
-
for (
|
|
1064
|
-
|
|
1065
|
-
const f =
|
|
1063
|
+
for (A.matcher.considerAll(); ; ) {
|
|
1064
|
+
ke++, Be ? Be = !1 : A.matcher.considerAll(), A.matcher.lastIndex = te;
|
|
1065
|
+
const f = A.matcher.exec(h);
|
|
1066
1066
|
if (!f)
|
|
1067
1067
|
break;
|
|
1068
|
-
const
|
|
1068
|
+
const E = h.substring(te, f.index), w = Ve(E, f);
|
|
1069
1069
|
te = f.index + w;
|
|
1070
1070
|
}
|
|
1071
|
-
return Ve(h.substring(te)),
|
|
1071
|
+
return Ve(h.substring(te)), P.closeAllNodes(), P.finalize(), Ie = P.toHTML(), {
|
|
1072
1072
|
language: u,
|
|
1073
|
-
value:
|
|
1074
|
-
relevance:
|
|
1073
|
+
value: Ie,
|
|
1074
|
+
relevance: Te,
|
|
1075
1075
|
illegal: !1,
|
|
1076
|
-
_emitter:
|
|
1077
|
-
_top:
|
|
1076
|
+
_emitter: P,
|
|
1077
|
+
_top: A
|
|
1078
1078
|
};
|
|
1079
1079
|
} catch (f) {
|
|
1080
1080
|
if (f.message && f.message.includes("Illegal"))
|
|
1081
1081
|
return {
|
|
1082
1082
|
language: u,
|
|
1083
|
-
value:
|
|
1083
|
+
value: $e(h),
|
|
1084
1084
|
illegal: !0,
|
|
1085
1085
|
relevance: 0,
|
|
1086
1086
|
_illegalBy: {
|
|
@@ -1088,26 +1088,26 @@ https://github.com/highlightjs/highlight.js/issues/2277`), I = u, M = h), A ===
|
|
|
1088
1088
|
index: te,
|
|
1089
1089
|
context: h.slice(te - 100, te + 100),
|
|
1090
1090
|
mode: f.mode,
|
|
1091
|
-
resultSoFar:
|
|
1091
|
+
resultSoFar: Ie
|
|
1092
1092
|
},
|
|
1093
|
-
_emitter:
|
|
1093
|
+
_emitter: P
|
|
1094
1094
|
};
|
|
1095
|
-
if (
|
|
1095
|
+
if (o)
|
|
1096
1096
|
return {
|
|
1097
1097
|
language: u,
|
|
1098
|
-
value:
|
|
1098
|
+
value: $e(h),
|
|
1099
1099
|
illegal: !1,
|
|
1100
1100
|
relevance: 0,
|
|
1101
1101
|
errorRaised: f,
|
|
1102
|
-
_emitter:
|
|
1103
|
-
_top:
|
|
1102
|
+
_emitter: P,
|
|
1103
|
+
_top: A
|
|
1104
1104
|
};
|
|
1105
1105
|
throw f;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function y(u) {
|
|
1109
1109
|
const h = {
|
|
1110
|
-
value:
|
|
1110
|
+
value: $e(u),
|
|
1111
1111
|
illegal: !1,
|
|
1112
1112
|
relevance: 0,
|
|
1113
1113
|
_top: i,
|
|
@@ -1115,109 +1115,109 @@ https://github.com/highlightjs/highlight.js/issues/2277`), I = u, M = h), A ===
|
|
|
1115
1115
|
};
|
|
1116
1116
|
return h._emitter.addText(u), h;
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function m(u, h) {
|
|
1119
1119
|
h = h || r.languages || Object.keys(n);
|
|
1120
|
-
const
|
|
1121
|
-
(
|
|
1120
|
+
const v = y(u), x = h.filter(U).filter(ae).map(
|
|
1121
|
+
(G) => p(G, u, !1)
|
|
1122
1122
|
);
|
|
1123
|
-
|
|
1124
|
-
const
|
|
1125
|
-
if (
|
|
1126
|
-
return J.relevance -
|
|
1127
|
-
if (
|
|
1128
|
-
if (
|
|
1123
|
+
x.unshift(v);
|
|
1124
|
+
const k = x.sort((G, J) => {
|
|
1125
|
+
if (G.relevance !== J.relevance)
|
|
1126
|
+
return J.relevance - G.relevance;
|
|
1127
|
+
if (G.language && J.language) {
|
|
1128
|
+
if (U(G.language).supersetOf === J.language)
|
|
1129
1129
|
return 1;
|
|
1130
|
-
if (
|
|
1130
|
+
if (U(J.language).supersetOf === G.language)
|
|
1131
1131
|
return -1;
|
|
1132
1132
|
}
|
|
1133
1133
|
return 0;
|
|
1134
|
-
}), [
|
|
1135
|
-
return
|
|
1134
|
+
}), [F, Q] = k, Ae = F;
|
|
1135
|
+
return Ae.secondBest = Q, Ae;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
const
|
|
1139
|
-
u.classList.add("hljs"), u.classList.add(`language-${
|
|
1137
|
+
function N(u, h, v) {
|
|
1138
|
+
const x = h && t[h] || v;
|
|
1139
|
+
u.classList.add("hljs"), u.classList.add(`language-${x}`);
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function g(u) {
|
|
1142
1142
|
let h = null;
|
|
1143
|
-
const
|
|
1144
|
-
if (a(
|
|
1143
|
+
const v = c(u);
|
|
1144
|
+
if (a(v))
|
|
1145
1145
|
return;
|
|
1146
1146
|
if (oe(
|
|
1147
1147
|
"before:highlightElement",
|
|
1148
|
-
{ el: u, language:
|
|
1148
|
+
{ el: u, language: v }
|
|
1149
1149
|
), u.children.length > 0 && (r.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(u)), r.throwUnescapedHTML))
|
|
1150
|
-
throw new
|
|
1150
|
+
throw new It(
|
|
1151
1151
|
"One of your code blocks includes unescaped HTML.",
|
|
1152
1152
|
u.innerHTML
|
|
1153
1153
|
);
|
|
1154
1154
|
h = u;
|
|
1155
|
-
const
|
|
1156
|
-
u.innerHTML =
|
|
1157
|
-
language:
|
|
1155
|
+
const x = h.textContent, k = v ? b(x, { language: v, ignoreIllegals: !0 }) : m(x);
|
|
1156
|
+
u.innerHTML = k.value, N(u, v, k.language), u.result = {
|
|
1157
|
+
language: k.language,
|
|
1158
1158
|
// TODO: remove with version 11.0
|
|
1159
|
-
re:
|
|
1160
|
-
relevance:
|
|
1161
|
-
},
|
|
1162
|
-
language:
|
|
1163
|
-
relevance:
|
|
1164
|
-
}), oe("after:highlightElement", { el: u, result:
|
|
1159
|
+
re: k.relevance,
|
|
1160
|
+
relevance: k.relevance
|
|
1161
|
+
}, k.secondBest && (u.secondBest = {
|
|
1162
|
+
language: k.secondBest.language,
|
|
1163
|
+
relevance: k.secondBest.relevance
|
|
1164
|
+
}), oe("after:highlightElement", { el: u, result: k, text: x });
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1166
|
+
function _(u) {
|
|
1167
1167
|
r = on(r, u);
|
|
1168
1168
|
}
|
|
1169
1169
|
const S = () => {
|
|
1170
|
-
|
|
1170
|
+
T(), ce("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
1171
1171
|
};
|
|
1172
|
-
function
|
|
1173
|
-
|
|
1172
|
+
function M() {
|
|
1173
|
+
T(), ce("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
1174
1174
|
}
|
|
1175
|
-
let
|
|
1176
|
-
function
|
|
1175
|
+
let O = !1;
|
|
1176
|
+
function T() {
|
|
1177
1177
|
if (document.readyState === "loading") {
|
|
1178
|
-
|
|
1178
|
+
O = !0;
|
|
1179
1179
|
return;
|
|
1180
1180
|
}
|
|
1181
|
-
document.querySelectorAll(r.cssSelector).forEach(
|
|
1181
|
+
document.querySelectorAll(r.cssSelector).forEach(g);
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1184
|
-
|
|
1183
|
+
function D() {
|
|
1184
|
+
O && T();
|
|
1185
1185
|
}
|
|
1186
|
-
typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded",
|
|
1187
|
-
function
|
|
1188
|
-
let
|
|
1186
|
+
typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", D, !1);
|
|
1187
|
+
function $(u, h) {
|
|
1188
|
+
let v = null;
|
|
1189
1189
|
try {
|
|
1190
|
-
|
|
1191
|
-
} catch (
|
|
1192
|
-
if (se("Language definition for '{}' could not be registered.".replace("{}", u)),
|
|
1193
|
-
se(
|
|
1190
|
+
v = h(e);
|
|
1191
|
+
} catch (x) {
|
|
1192
|
+
if (se("Language definition for '{}' could not be registered.".replace("{}", u)), o)
|
|
1193
|
+
se(x);
|
|
1194
1194
|
else
|
|
1195
|
-
throw
|
|
1196
|
-
|
|
1195
|
+
throw x;
|
|
1196
|
+
v = i;
|
|
1197
1197
|
}
|
|
1198
|
-
|
|
1198
|
+
v.name || (v.name = u), n[u] = v, v.rawDefinition = h.bind(null, e), v.aliases && re(v.aliases, { languageName: u });
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function R(u) {
|
|
1201
1201
|
delete n[u];
|
|
1202
1202
|
for (const h of Object.keys(t))
|
|
1203
1203
|
t[h] === u && delete t[h];
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function W() {
|
|
1206
1206
|
return Object.keys(n);
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function U(u) {
|
|
1209
1209
|
return u = (u || "").toLowerCase(), n[u] || n[t[u]];
|
|
1210
1210
|
}
|
|
1211
1211
|
function re(u, { languageName: h }) {
|
|
1212
|
-
typeof u == "string" && (u = [u]), u.forEach((
|
|
1213
|
-
t[
|
|
1212
|
+
typeof u == "string" && (u = [u]), u.forEach((v) => {
|
|
1213
|
+
t[v.toLowerCase()] = h;
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
1216
|
function ae(u) {
|
|
1217
|
-
const h =
|
|
1217
|
+
const h = U(u);
|
|
1218
1218
|
return h && !h.disableAutodetect;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function ge(u) {
|
|
1221
1221
|
u["before:highlightBlock"] && !u["before:highlightElement"] && (u["before:highlightElement"] = (h) => {
|
|
1222
1222
|
u["before:highlightBlock"](
|
|
1223
1223
|
Object.assign({ block: h.el }, h)
|
|
@@ -1228,57 +1228,57 @@ https://github.com/highlightjs/highlight.js/issues/2277`), I = u, M = h), A ===
|
|
|
1228
1228
|
);
|
|
1229
1229
|
});
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1232
|
-
|
|
1231
|
+
function pe(u) {
|
|
1232
|
+
ge(u), s.push(u);
|
|
1233
1233
|
}
|
|
1234
1234
|
function oe(u, h) {
|
|
1235
|
-
const
|
|
1236
|
-
s.forEach(function(
|
|
1237
|
-
|
|
1235
|
+
const v = u;
|
|
1236
|
+
s.forEach(function(x) {
|
|
1237
|
+
x[v] && x[v](h);
|
|
1238
1238
|
});
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1241
|
-
return ce("10.7.0", "highlightBlock will be removed entirely in v12.0"), ce("10.7.0", "Please use highlightElement now."),
|
|
1240
|
+
function Ne(u) {
|
|
1241
|
+
return ce("10.7.0", "highlightBlock will be removed entirely in v12.0"), ce("10.7.0", "Please use highlightElement now."), g(u);
|
|
1242
1242
|
}
|
|
1243
1243
|
Object.assign(e, {
|
|
1244
1244
|
highlight: b,
|
|
1245
|
-
highlightAuto:
|
|
1246
|
-
highlightAll:
|
|
1247
|
-
highlightElement:
|
|
1245
|
+
highlightAuto: m,
|
|
1246
|
+
highlightAll: T,
|
|
1247
|
+
highlightElement: g,
|
|
1248
1248
|
// TODO: Remove with v12 API
|
|
1249
|
-
highlightBlock:
|
|
1250
|
-
configure:
|
|
1249
|
+
highlightBlock: Ne,
|
|
1250
|
+
configure: _,
|
|
1251
1251
|
initHighlighting: S,
|
|
1252
|
-
initHighlightingOnLoad:
|
|
1253
|
-
registerLanguage:
|
|
1254
|
-
unregisterLanguage:
|
|
1255
|
-
listLanguages:
|
|
1256
|
-
getLanguage:
|
|
1252
|
+
initHighlightingOnLoad: M,
|
|
1253
|
+
registerLanguage: $,
|
|
1254
|
+
unregisterLanguage: R,
|
|
1255
|
+
listLanguages: W,
|
|
1256
|
+
getLanguage: U,
|
|
1257
1257
|
registerAliases: re,
|
|
1258
1258
|
autoDetection: ae,
|
|
1259
1259
|
inherit: on,
|
|
1260
|
-
addPlugin:
|
|
1260
|
+
addPlugin: pe
|
|
1261
1261
|
}), e.debugMode = function() {
|
|
1262
|
-
|
|
1262
|
+
o = !1;
|
|
1263
1263
|
}, e.safeMode = function() {
|
|
1264
|
-
|
|
1265
|
-
}, e.versionString =
|
|
1264
|
+
o = !0;
|
|
1265
|
+
}, e.versionString = Ct, e.regex = {
|
|
1266
1266
|
concat: ie,
|
|
1267
1267
|
lookahead: gn,
|
|
1268
1268
|
either: Ye,
|
|
1269
|
-
optional:
|
|
1270
|
-
anyNumberOfTimes:
|
|
1269
|
+
optional: qn,
|
|
1270
|
+
anyNumberOfTimes: Qn
|
|
1271
1271
|
};
|
|
1272
|
-
for (const u in
|
|
1273
|
-
typeof
|
|
1274
|
-
return Object.assign(e,
|
|
1272
|
+
for (const u in Se)
|
|
1273
|
+
typeof Se[u] == "object" && Ge.exports(Se[u]);
|
|
1274
|
+
return Object.assign(e, Se), e;
|
|
1275
1275
|
};
|
|
1276
|
-
var
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
const Z =
|
|
1280
|
-
function
|
|
1281
|
-
const n = e.regex, t = n.concat(/[\p{L}_]/u, n.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), s = /[\p{L}0-9._:-]+/u,
|
|
1276
|
+
var me = Bt({}), $t = me;
|
|
1277
|
+
me.HighlightJS = me;
|
|
1278
|
+
me.default = me;
|
|
1279
|
+
const Z = $t;
|
|
1280
|
+
function Ut(e) {
|
|
1281
|
+
const n = e.regex, t = n.concat(/[\p{L}_]/u, n.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), s = /[\p{L}0-9._:-]+/u, o = {
|
|
1282
1282
|
className: "symbol",
|
|
1283
1283
|
begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
|
|
1284
1284
|
}, l = {
|
|
@@ -1293,7 +1293,7 @@ function $t(e) {
|
|
|
1293
1293
|
}, i = e.inherit(l, {
|
|
1294
1294
|
begin: /\(/,
|
|
1295
1295
|
end: /\)/
|
|
1296
|
-
}), r = e.inherit(e.APOS_STRING_MODE, { className: "string" }), a = e.inherit(e.QUOTE_STRING_MODE, { className: "string" }),
|
|
1296
|
+
}), r = e.inherit(e.APOS_STRING_MODE, { className: "string" }), a = e.inherit(e.QUOTE_STRING_MODE, { className: "string" }), c = {
|
|
1297
1297
|
endsWithParent: !0,
|
|
1298
1298
|
illegal: /</,
|
|
1299
1299
|
relevance: 0,
|
|
@@ -1314,12 +1314,12 @@ function $t(e) {
|
|
|
1314
1314
|
{
|
|
1315
1315
|
begin: /"/,
|
|
1316
1316
|
end: /"/,
|
|
1317
|
-
contains: [
|
|
1317
|
+
contains: [o]
|
|
1318
1318
|
},
|
|
1319
1319
|
{
|
|
1320
1320
|
begin: /'/,
|
|
1321
1321
|
end: /'/,
|
|
1322
|
-
contains: [
|
|
1322
|
+
contains: [o]
|
|
1323
1323
|
},
|
|
1324
1324
|
{ begin: /[^\s"'=<>`]+/ }
|
|
1325
1325
|
]
|
|
@@ -1384,7 +1384,7 @@ function $t(e) {
|
|
|
1384
1384
|
end: /\]\]>/,
|
|
1385
1385
|
relevance: 10
|
|
1386
1386
|
},
|
|
1387
|
-
|
|
1387
|
+
o,
|
|
1388
1388
|
// xml processing instructions
|
|
1389
1389
|
{
|
|
1390
1390
|
className: "meta",
|
|
@@ -1412,7 +1412,7 @@ function $t(e) {
|
|
|
1412
1412
|
begin: /<style(?=\s|>)/,
|
|
1413
1413
|
end: />/,
|
|
1414
1414
|
keywords: { name: "style" },
|
|
1415
|
-
contains: [
|
|
1415
|
+
contains: [c],
|
|
1416
1416
|
starts: {
|
|
1417
1417
|
end: /<\/style>/,
|
|
1418
1418
|
returnEnd: !0,
|
|
@@ -1428,7 +1428,7 @@ function $t(e) {
|
|
|
1428
1428
|
begin: /<script(?=\s|>)/,
|
|
1429
1429
|
end: />/,
|
|
1430
1430
|
keywords: { name: "script" },
|
|
1431
|
-
contains: [
|
|
1431
|
+
contains: [c],
|
|
1432
1432
|
starts: {
|
|
1433
1433
|
end: /<\/script>/,
|
|
1434
1434
|
returnEnd: !0,
|
|
@@ -1463,7 +1463,7 @@ function $t(e) {
|
|
|
1463
1463
|
className: "name",
|
|
1464
1464
|
begin: t,
|
|
1465
1465
|
relevance: 0,
|
|
1466
|
-
starts:
|
|
1466
|
+
starts: c
|
|
1467
1467
|
}
|
|
1468
1468
|
]
|
|
1469
1469
|
},
|
|
@@ -1493,7 +1493,7 @@ function $t(e) {
|
|
|
1493
1493
|
]
|
|
1494
1494
|
};
|
|
1495
1495
|
}
|
|
1496
|
-
const ln = "[A-Za-z$_][0-9A-Za-z$_]*",
|
|
1496
|
+
const ln = "[A-Za-z$_][0-9A-Za-z$_]*", Pt = [
|
|
1497
1497
|
"as",
|
|
1498
1498
|
// for exports
|
|
1499
1499
|
"in",
|
|
@@ -1536,7 +1536,7 @@ const ln = "[A-Za-z$_][0-9A-Za-z$_]*", Ut = [
|
|
|
1536
1536
|
"from",
|
|
1537
1537
|
"export",
|
|
1538
1538
|
"extends"
|
|
1539
|
-
],
|
|
1539
|
+
], Ht = [
|
|
1540
1540
|
"true",
|
|
1541
1541
|
"false",
|
|
1542
1542
|
"null",
|
|
@@ -1620,7 +1620,7 @@ const ln = "[A-Za-z$_][0-9A-Za-z$_]*", Ut = [
|
|
|
1620
1620
|
"encodeURIComponent",
|
|
1621
1621
|
"escape",
|
|
1622
1622
|
"unescape"
|
|
1623
|
-
],
|
|
1623
|
+
], zt = [
|
|
1624
1624
|
"arguments",
|
|
1625
1625
|
"this",
|
|
1626
1626
|
"super",
|
|
@@ -1631,16 +1631,16 @@ const ln = "[A-Za-z$_][0-9A-Za-z$_]*", Ut = [
|
|
|
1631
1631
|
"module",
|
|
1632
1632
|
"global"
|
|
1633
1633
|
// Node.js
|
|
1634
|
-
],
|
|
1634
|
+
], Ft = [].concat(
|
|
1635
1635
|
Tn,
|
|
1636
1636
|
An,
|
|
1637
1637
|
vn
|
|
1638
1638
|
);
|
|
1639
|
-
function
|
|
1640
|
-
const n = e.regex, t = (h, { after:
|
|
1641
|
-
const
|
|
1642
|
-
return h.input.indexOf(
|
|
1643
|
-
}, s = ln,
|
|
1639
|
+
function Gt(e) {
|
|
1640
|
+
const n = e.regex, t = (h, { after: v }) => {
|
|
1641
|
+
const x = "</" + h[0].slice(1);
|
|
1642
|
+
return h.input.indexOf(x, v) !== -1;
|
|
1643
|
+
}, s = ln, o = {
|
|
1644
1644
|
begin: "<>",
|
|
1645
1645
|
end: "</>"
|
|
1646
1646
|
}, l = /<[A-Za-z0-9\\._:-]+\s*\/>/, i = {
|
|
@@ -1650,43 +1650,43 @@ function Ft(e) {
|
|
|
1650
1650
|
* @param {RegExpMatchArray} match
|
|
1651
1651
|
* @param {CallbackResponse} response
|
|
1652
1652
|
*/
|
|
1653
|
-
isTrulyOpeningTag: (h,
|
|
1654
|
-
const
|
|
1653
|
+
isTrulyOpeningTag: (h, v) => {
|
|
1654
|
+
const x = h[0].length + h.index, k = h.input[x];
|
|
1655
1655
|
if (
|
|
1656
1656
|
// HTML should not include another raw `<` inside a tag
|
|
1657
1657
|
// nested type?
|
|
1658
1658
|
// `<Array<Array<number>>`, etc.
|
|
1659
|
-
|
|
1659
|
+
k === "<" || // the , gives away that this is not HTML
|
|
1660
1660
|
// `<T, A extends keyof T, V>`
|
|
1661
|
-
|
|
1661
|
+
k === ","
|
|
1662
1662
|
) {
|
|
1663
|
-
|
|
1663
|
+
v.ignoreMatch();
|
|
1664
1664
|
return;
|
|
1665
1665
|
}
|
|
1666
|
-
|
|
1667
|
-
let
|
|
1668
|
-
const Q = h.input.substring(
|
|
1669
|
-
if (
|
|
1670
|
-
|
|
1666
|
+
k === ">" && (t(h, { after: x }) || v.ignoreMatch());
|
|
1667
|
+
let F;
|
|
1668
|
+
const Q = h.input.substring(x);
|
|
1669
|
+
if (F = Q.match(/^\s*=/)) {
|
|
1670
|
+
v.ignoreMatch();
|
|
1671
1671
|
return;
|
|
1672
1672
|
}
|
|
1673
|
-
if ((
|
|
1674
|
-
|
|
1673
|
+
if ((F = Q.match(/^\s+extends\s+/)) && F.index === 0) {
|
|
1674
|
+
v.ignoreMatch();
|
|
1675
1675
|
return;
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
1678
1678
|
}, r = {
|
|
1679
1679
|
$pattern: ln,
|
|
1680
|
-
keyword:
|
|
1681
|
-
literal:
|
|
1682
|
-
built_in:
|
|
1683
|
-
"variable.language":
|
|
1684
|
-
}, a = "[0-9](_?[0-9])*",
|
|
1680
|
+
keyword: Pt,
|
|
1681
|
+
literal: Ht,
|
|
1682
|
+
built_in: Ft,
|
|
1683
|
+
"variable.language": zt
|
|
1684
|
+
}, a = "[0-9](_?[0-9])*", c = `\\.(${a})`, b = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", p = {
|
|
1685
1685
|
className: "number",
|
|
1686
1686
|
variants: [
|
|
1687
1687
|
// DecimalLiteral
|
|
1688
|
-
{ begin: `(\\b(${b})((${
|
|
1689
|
-
{ begin: `\\b(${b})\\b((${
|
|
1688
|
+
{ begin: `(\\b(${b})((${c})|\\.)?|(${c}))[eE][+-]?(${a})\\b` },
|
|
1689
|
+
{ begin: `\\b(${b})\\b((${c})\\b|\\.)?|(${c})\\b` },
|
|
1690
1690
|
// DecimalBigIntegerLiteral
|
|
1691
1691
|
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
|
|
1692
1692
|
// NonDecimalIntegerLiteral
|
|
@@ -1698,14 +1698,14 @@ function Ft(e) {
|
|
|
1698
1698
|
{ begin: "\\b0[0-7]+n?\\b" }
|
|
1699
1699
|
],
|
|
1700
1700
|
relevance: 0
|
|
1701
|
-
},
|
|
1701
|
+
}, y = {
|
|
1702
1702
|
className: "subst",
|
|
1703
1703
|
begin: "\\$\\{",
|
|
1704
1704
|
end: "\\}",
|
|
1705
1705
|
keywords: r,
|
|
1706
1706
|
contains: []
|
|
1707
1707
|
// defined later
|
|
1708
|
-
},
|
|
1708
|
+
}, m = {
|
|
1709
1709
|
begin: "html`",
|
|
1710
1710
|
end: "",
|
|
1711
1711
|
starts: {
|
|
@@ -1713,11 +1713,11 @@ function Ft(e) {
|
|
|
1713
1713
|
returnEnd: !1,
|
|
1714
1714
|
contains: [
|
|
1715
1715
|
e.BACKSLASH_ESCAPE,
|
|
1716
|
-
|
|
1716
|
+
y
|
|
1717
1717
|
],
|
|
1718
1718
|
subLanguage: "xml"
|
|
1719
1719
|
}
|
|
1720
|
-
},
|
|
1720
|
+
}, N = {
|
|
1721
1721
|
begin: "css`",
|
|
1722
1722
|
end: "",
|
|
1723
1723
|
starts: {
|
|
@@ -1725,17 +1725,17 @@ function Ft(e) {
|
|
|
1725
1725
|
returnEnd: !1,
|
|
1726
1726
|
contains: [
|
|
1727
1727
|
e.BACKSLASH_ESCAPE,
|
|
1728
|
-
|
|
1728
|
+
y
|
|
1729
1729
|
],
|
|
1730
1730
|
subLanguage: "css"
|
|
1731
1731
|
}
|
|
1732
|
-
},
|
|
1732
|
+
}, g = {
|
|
1733
1733
|
className: "string",
|
|
1734
1734
|
begin: "`",
|
|
1735
1735
|
end: "`",
|
|
1736
1736
|
contains: [
|
|
1737
1737
|
e.BACKSLASH_ESCAPE,
|
|
1738
|
-
|
|
1738
|
+
y
|
|
1739
1739
|
]
|
|
1740
1740
|
}, S = {
|
|
1741
1741
|
className: "comment",
|
|
@@ -1782,20 +1782,20 @@ function Ft(e) {
|
|
|
1782
1782
|
e.C_BLOCK_COMMENT_MODE,
|
|
1783
1783
|
e.C_LINE_COMMENT_MODE
|
|
1784
1784
|
]
|
|
1785
|
-
},
|
|
1785
|
+
}, M = [
|
|
1786
1786
|
e.APOS_STRING_MODE,
|
|
1787
1787
|
e.QUOTE_STRING_MODE,
|
|
1788
|
-
v,
|
|
1789
1788
|
m,
|
|
1790
|
-
|
|
1789
|
+
N,
|
|
1790
|
+
g,
|
|
1791
1791
|
// Skip numbers when they are part of a variable name
|
|
1792
1792
|
{ match: /\$\d+/ },
|
|
1793
|
-
|
|
1793
|
+
p
|
|
1794
1794
|
// This is intentional:
|
|
1795
1795
|
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
1796
1796
|
// hljs.REGEXP_MODE
|
|
1797
1797
|
];
|
|
1798
|
-
|
|
1798
|
+
y.contains = M.concat({
|
|
1799
1799
|
// we need to pair up {} inside our subst to prevent
|
|
1800
1800
|
// it from ending too early by matching another }
|
|
1801
1801
|
begin: /\{/,
|
|
@@ -1803,25 +1803,25 @@ function Ft(e) {
|
|
|
1803
1803
|
keywords: r,
|
|
1804
1804
|
contains: [
|
|
1805
1805
|
"self"
|
|
1806
|
-
].concat(
|
|
1806
|
+
].concat(M)
|
|
1807
1807
|
});
|
|
1808
|
-
const
|
|
1808
|
+
const O = [].concat(S, y.contains), T = O.concat([
|
|
1809
1809
|
// eat recursive parens in sub expressions
|
|
1810
1810
|
{
|
|
1811
1811
|
begin: /\(/,
|
|
1812
1812
|
end: /\)/,
|
|
1813
1813
|
keywords: r,
|
|
1814
|
-
contains: ["self"].concat(
|
|
1814
|
+
contains: ["self"].concat(O)
|
|
1815
1815
|
}
|
|
1816
|
-
]),
|
|
1816
|
+
]), D = {
|
|
1817
1817
|
className: "params",
|
|
1818
1818
|
begin: /\(/,
|
|
1819
1819
|
end: /\)/,
|
|
1820
1820
|
excludeBegin: !0,
|
|
1821
1821
|
excludeEnd: !0,
|
|
1822
1822
|
keywords: r,
|
|
1823
|
-
contains:
|
|
1824
|
-
},
|
|
1823
|
+
contains: T
|
|
1824
|
+
}, $ = {
|
|
1825
1825
|
variants: [
|
|
1826
1826
|
// class Car extends vehicle
|
|
1827
1827
|
{
|
|
@@ -1854,7 +1854,7 @@ function Ft(e) {
|
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
]
|
|
1857
|
-
},
|
|
1857
|
+
}, R = {
|
|
1858
1858
|
relevance: 0,
|
|
1859
1859
|
match: n.either(
|
|
1860
1860
|
// Hard coded exceptions
|
|
@@ -1878,12 +1878,12 @@ function Ft(e) {
|
|
|
1878
1878
|
...vn
|
|
1879
1879
|
]
|
|
1880
1880
|
}
|
|
1881
|
-
},
|
|
1881
|
+
}, W = {
|
|
1882
1882
|
label: "use_strict",
|
|
1883
1883
|
className: "meta",
|
|
1884
1884
|
relevance: 10,
|
|
1885
1885
|
begin: /^\s*['"]use (strict|asm)['"]/
|
|
1886
|
-
},
|
|
1886
|
+
}, U = {
|
|
1887
1887
|
variants: [
|
|
1888
1888
|
{
|
|
1889
1889
|
match: [
|
|
@@ -1906,7 +1906,7 @@ function Ft(e) {
|
|
|
1906
1906
|
3: "title.function"
|
|
1907
1907
|
},
|
|
1908
1908
|
label: "func.def",
|
|
1909
|
-
contains: [
|
|
1909
|
+
contains: [D],
|
|
1910
1910
|
illegal: /%/
|
|
1911
1911
|
}, re = {
|
|
1912
1912
|
relevance: 0,
|
|
@@ -1916,7 +1916,7 @@ function Ft(e) {
|
|
|
1916
1916
|
function ae(h) {
|
|
1917
1917
|
return n.concat("(?!", h.join("|"), ")");
|
|
1918
1918
|
}
|
|
1919
|
-
const
|
|
1919
|
+
const ge = {
|
|
1920
1920
|
match: n.concat(
|
|
1921
1921
|
/\b/,
|
|
1922
1922
|
ae([
|
|
@@ -1929,7 +1929,7 @@ function Ft(e) {
|
|
|
1929
1929
|
),
|
|
1930
1930
|
className: "title.function",
|
|
1931
1931
|
relevance: 0
|
|
1932
|
-
},
|
|
1932
|
+
}, pe = {
|
|
1933
1933
|
begin: n.concat(/\./, n.lookahead(
|
|
1934
1934
|
n.concat(s, /(?![0-9A-Za-z$_(])/)
|
|
1935
1935
|
)),
|
|
@@ -1954,9 +1954,9 @@ function Ft(e) {
|
|
|
1954
1954
|
// eat to avoid empty params
|
|
1955
1955
|
begin: /\(\)/
|
|
1956
1956
|
},
|
|
1957
|
-
|
|
1957
|
+
D
|
|
1958
1958
|
]
|
|
1959
|
-
},
|
|
1959
|
+
}, Ne = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", u = {
|
|
1960
1960
|
match: [
|
|
1961
1961
|
/const|var|let/,
|
|
1962
1962
|
/\s+/,
|
|
@@ -1965,7 +1965,7 @@ function Ft(e) {
|
|
|
1965
1965
|
/=\s*/,
|
|
1966
1966
|
/(async\s*)?/,
|
|
1967
1967
|
// async is optional
|
|
1968
|
-
n.lookahead(
|
|
1968
|
+
n.lookahead(Ne)
|
|
1969
1969
|
],
|
|
1970
1970
|
keywords: "async",
|
|
1971
1971
|
className: {
|
|
@@ -1973,7 +1973,7 @@ function Ft(e) {
|
|
|
1973
1973
|
3: "title.function"
|
|
1974
1974
|
},
|
|
1975
1975
|
contains: [
|
|
1976
|
-
|
|
1976
|
+
D
|
|
1977
1977
|
]
|
|
1978
1978
|
};
|
|
1979
1979
|
return {
|
|
@@ -1981,7 +1981,7 @@ function Ft(e) {
|
|
|
1981
1981
|
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
1982
1982
|
keywords: r,
|
|
1983
1983
|
// this will be extended by TypeScript
|
|
1984
|
-
exports: { PARAMS_CONTAINS:
|
|
1984
|
+
exports: { PARAMS_CONTAINS: T, CLASS_REFERENCE: R },
|
|
1985
1985
|
illegal: /#(?![$_A-z])/,
|
|
1986
1986
|
contains: [
|
|
1987
1987
|
e.SHEBANG({
|
|
@@ -1989,17 +1989,17 @@ function Ft(e) {
|
|
|
1989
1989
|
binary: "node",
|
|
1990
1990
|
relevance: 5
|
|
1991
1991
|
}),
|
|
1992
|
-
|
|
1992
|
+
W,
|
|
1993
1993
|
e.APOS_STRING_MODE,
|
|
1994
1994
|
e.QUOTE_STRING_MODE,
|
|
1995
|
-
v,
|
|
1996
1995
|
m,
|
|
1997
|
-
|
|
1996
|
+
N,
|
|
1997
|
+
g,
|
|
1998
1998
|
S,
|
|
1999
1999
|
// Skip numbers when they are part of a variable name
|
|
2000
2000
|
{ match: /\$\d+/ },
|
|
2001
|
-
|
|
2002
|
-
|
|
2001
|
+
p,
|
|
2002
|
+
R,
|
|
2003
2003
|
{
|
|
2004
2004
|
className: "attr",
|
|
2005
2005
|
begin: s + n.lookahead(":"),
|
|
@@ -2019,7 +2019,7 @@ function Ft(e) {
|
|
|
2019
2019
|
// we have to count the parens to make sure we actually have the
|
|
2020
2020
|
// correct bounding ( ) before the =>. There could be any number of
|
|
2021
2021
|
// sub-expressions inside also surrounded by parens.
|
|
2022
|
-
begin:
|
|
2022
|
+
begin: Ne,
|
|
2023
2023
|
returnBegin: !0,
|
|
2024
2024
|
end: "\\s*=>",
|
|
2025
2025
|
contains: [
|
|
@@ -2041,7 +2041,7 @@ function Ft(e) {
|
|
|
2041
2041
|
excludeBegin: !0,
|
|
2042
2042
|
excludeEnd: !0,
|
|
2043
2043
|
keywords: r,
|
|
2044
|
-
contains:
|
|
2044
|
+
contains: T
|
|
2045
2045
|
}
|
|
2046
2046
|
]
|
|
2047
2047
|
}
|
|
@@ -2059,7 +2059,7 @@ function Ft(e) {
|
|
|
2059
2059
|
{
|
|
2060
2060
|
// JSX
|
|
2061
2061
|
variants: [
|
|
2062
|
-
{ begin:
|
|
2062
|
+
{ begin: o.begin, end: o.end },
|
|
2063
2063
|
{ match: l },
|
|
2064
2064
|
{
|
|
2065
2065
|
begin: i.begin,
|
|
@@ -2081,7 +2081,7 @@ function Ft(e) {
|
|
|
2081
2081
|
}
|
|
2082
2082
|
]
|
|
2083
2083
|
},
|
|
2084
|
-
|
|
2084
|
+
U,
|
|
2085
2085
|
{
|
|
2086
2086
|
// prevent this from getting swallowed up by function
|
|
2087
2087
|
// since they appear "function like"
|
|
@@ -2096,7 +2096,7 @@ function Ft(e) {
|
|
|
2096
2096
|
returnBegin: !0,
|
|
2097
2097
|
label: "func.def",
|
|
2098
2098
|
contains: [
|
|
2099
|
-
|
|
2099
|
+
D,
|
|
2100
2100
|
e.inherit(e.TITLE_MODE, { begin: s, className: "title.function" })
|
|
2101
2101
|
]
|
|
2102
2102
|
},
|
|
@@ -2105,7 +2105,7 @@ function Ft(e) {
|
|
|
2105
2105
|
match: /\.\.\./,
|
|
2106
2106
|
relevance: 0
|
|
2107
2107
|
},
|
|
2108
|
-
|
|
2108
|
+
pe,
|
|
2109
2109
|
// hack: prevents detection of keywords in some circumstances
|
|
2110
2110
|
// .keyword()
|
|
2111
2111
|
// $keyword = x
|
|
@@ -2116,11 +2116,11 @@ function Ft(e) {
|
|
|
2116
2116
|
{
|
|
2117
2117
|
match: [/\bconstructor(?=\s*\()/],
|
|
2118
2118
|
className: { 1: "title.function" },
|
|
2119
|
-
contains: [
|
|
2119
|
+
contains: [D]
|
|
2120
2120
|
},
|
|
2121
|
-
|
|
2121
|
+
ge,
|
|
2122
2122
|
re,
|
|
2123
|
-
|
|
2123
|
+
$,
|
|
2124
2124
|
oe,
|
|
2125
2125
|
{
|
|
2126
2126
|
match: /\$[(.]/
|
|
@@ -2129,7 +2129,7 @@ function Ft(e) {
|
|
|
2129
2129
|
]
|
|
2130
2130
|
};
|
|
2131
2131
|
}
|
|
2132
|
-
function
|
|
2132
|
+
function Kt(e) {
|
|
2133
2133
|
const n = {
|
|
2134
2134
|
className: "attr",
|
|
2135
2135
|
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
@@ -2142,7 +2142,7 @@ function Gt(e) {
|
|
|
2142
2142
|
"true",
|
|
2143
2143
|
"false",
|
|
2144
2144
|
"null"
|
|
2145
|
-
],
|
|
2145
|
+
], o = {
|
|
2146
2146
|
scope: "literal",
|
|
2147
2147
|
beginKeywords: s.join(" ")
|
|
2148
2148
|
};
|
|
@@ -2155,7 +2155,7 @@ function Gt(e) {
|
|
|
2155
2155
|
n,
|
|
2156
2156
|
t,
|
|
2157
2157
|
e.QUOTE_STRING_MODE,
|
|
2158
|
-
|
|
2158
|
+
o,
|
|
2159
2159
|
e.C_NUMBER_MODE,
|
|
2160
2160
|
e.C_LINE_COMMENT_MODE,
|
|
2161
2161
|
e.C_BLOCK_COMMENT_MODE
|
|
@@ -2163,7 +2163,7 @@ function Gt(e) {
|
|
|
2163
2163
|
illegal: "\\S"
|
|
2164
2164
|
};
|
|
2165
2165
|
}
|
|
2166
|
-
function
|
|
2166
|
+
function Wt(e) {
|
|
2167
2167
|
const n = "true false yes no null", t = "[\\w#;/?:@&=+$,.~*'()[\\]]+", s = {
|
|
2168
2168
|
className: "attr",
|
|
2169
2169
|
variants: [
|
|
@@ -2177,7 +2177,7 @@ function Kt(e) {
|
|
|
2177
2177
|
begin: "'\\w[\\w :\\/.-]*':(?=[ ]|$)"
|
|
2178
2178
|
}
|
|
2179
2179
|
]
|
|
2180
|
-
},
|
|
2180
|
+
}, o = {
|
|
2181
2181
|
className: "template-variable",
|
|
2182
2182
|
variants: [
|
|
2183
2183
|
{
|
|
@@ -2207,7 +2207,7 @@ function Kt(e) {
|
|
|
2207
2207
|
],
|
|
2208
2208
|
contains: [
|
|
2209
2209
|
e.BACKSLASH_ESCAPE,
|
|
2210
|
-
|
|
2210
|
+
o
|
|
2211
2211
|
]
|
|
2212
2212
|
}, i = e.inherit(l, { variants: [
|
|
2213
2213
|
{
|
|
@@ -2219,28 +2219,28 @@ function Kt(e) {
|
|
|
2219
2219
|
end: /"/
|
|
2220
2220
|
},
|
|
2221
2221
|
{ begin: /[^\s,{}[\]]+/ }
|
|
2222
|
-
] }), r = "[0-9]{4}(-[0-9][0-9]){0,2}", a = "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",
|
|
2222
|
+
] }), r = "[0-9]{4}(-[0-9][0-9]){0,2}", a = "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?", c = "(\\.[0-9]*)?", b = "([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?", p = {
|
|
2223
2223
|
className: "number",
|
|
2224
|
-
begin: "\\b" + r + a +
|
|
2225
|
-
},
|
|
2224
|
+
begin: "\\b" + r + a + c + b + "\\b"
|
|
2225
|
+
}, y = {
|
|
2226
2226
|
end: ",",
|
|
2227
2227
|
endsWithParent: !0,
|
|
2228
2228
|
excludeEnd: !0,
|
|
2229
2229
|
keywords: n,
|
|
2230
2230
|
relevance: 0
|
|
2231
|
-
},
|
|
2231
|
+
}, m = {
|
|
2232
2232
|
begin: /\{/,
|
|
2233
2233
|
end: /\}/,
|
|
2234
|
-
contains: [
|
|
2234
|
+
contains: [y],
|
|
2235
2235
|
illegal: "\\n",
|
|
2236
2236
|
relevance: 0
|
|
2237
|
-
},
|
|
2237
|
+
}, N = {
|
|
2238
2238
|
begin: "\\[",
|
|
2239
2239
|
end: "\\]",
|
|
2240
|
-
contains: [
|
|
2240
|
+
contains: [y],
|
|
2241
2241
|
illegal: "\\n",
|
|
2242
2242
|
relevance: 0
|
|
2243
|
-
},
|
|
2243
|
+
}, g = [
|
|
2244
2244
|
s,
|
|
2245
2245
|
{
|
|
2246
2246
|
className: "meta",
|
|
@@ -2308,7 +2308,7 @@ function Kt(e) {
|
|
|
2308
2308
|
beginKeywords: n,
|
|
2309
2309
|
keywords: { literal: n }
|
|
2310
2310
|
},
|
|
2311
|
-
|
|
2311
|
+
p,
|
|
2312
2312
|
// numbers are any valid C-style number that
|
|
2313
2313
|
// sit isolated from other words
|
|
2314
2314
|
{
|
|
@@ -2316,18 +2316,18 @@ function Kt(e) {
|
|
|
2316
2316
|
begin: e.C_NUMBER_RE + "\\b",
|
|
2317
2317
|
relevance: 0
|
|
2318
2318
|
},
|
|
2319
|
-
v,
|
|
2320
2319
|
m,
|
|
2320
|
+
N,
|
|
2321
2321
|
l
|
|
2322
|
-
],
|
|
2323
|
-
return
|
|
2322
|
+
], _ = [...g];
|
|
2323
|
+
return _.pop(), _.push(i), y.contains = _, {
|
|
2324
2324
|
name: "YAML",
|
|
2325
2325
|
case_insensitive: !0,
|
|
2326
2326
|
aliases: ["yml"],
|
|
2327
|
-
contains:
|
|
2327
|
+
contains: g
|
|
2328
2328
|
};
|
|
2329
2329
|
}
|
|
2330
|
-
function
|
|
2330
|
+
function Yt(e) {
|
|
2331
2331
|
return {
|
|
2332
2332
|
name: "Plain text",
|
|
2333
2333
|
aliases: [
|
|
@@ -2337,7 +2337,7 @@ function Wt(e) {
|
|
|
2337
2337
|
disableAutodetect: !0
|
|
2338
2338
|
};
|
|
2339
2339
|
}
|
|
2340
|
-
function
|
|
2340
|
+
function Zt(e) {
|
|
2341
2341
|
const n = e.regex, t = /[\p{XID_Start}_]\p{XID_Continue}*/u, s = [
|
|
2342
2342
|
"and",
|
|
2343
2343
|
"as",
|
|
@@ -2473,7 +2473,7 @@ function Yt(e) {
|
|
|
2473
2473
|
}, a = {
|
|
2474
2474
|
className: "meta",
|
|
2475
2475
|
begin: /^(>>>|\.\.\.) /
|
|
2476
|
-
},
|
|
2476
|
+
}, c = {
|
|
2477
2477
|
className: "subst",
|
|
2478
2478
|
begin: /\{/,
|
|
2479
2479
|
end: /\}/,
|
|
@@ -2482,7 +2482,7 @@ function Yt(e) {
|
|
|
2482
2482
|
}, b = {
|
|
2483
2483
|
begin: /\{\{/,
|
|
2484
2484
|
relevance: 0
|
|
2485
|
-
},
|
|
2485
|
+
}, p = {
|
|
2486
2486
|
className: "string",
|
|
2487
2487
|
contains: [e.BACKSLASH_ESCAPE],
|
|
2488
2488
|
variants: [
|
|
@@ -2511,7 +2511,7 @@ function Yt(e) {
|
|
|
2511
2511
|
e.BACKSLASH_ESCAPE,
|
|
2512
2512
|
a,
|
|
2513
2513
|
b,
|
|
2514
|
-
|
|
2514
|
+
c
|
|
2515
2515
|
]
|
|
2516
2516
|
},
|
|
2517
2517
|
{
|
|
@@ -2521,7 +2521,7 @@ function Yt(e) {
|
|
|
2521
2521
|
e.BACKSLASH_ESCAPE,
|
|
2522
2522
|
a,
|
|
2523
2523
|
b,
|
|
2524
|
-
|
|
2524
|
+
c
|
|
2525
2525
|
]
|
|
2526
2526
|
},
|
|
2527
2527
|
{
|
|
@@ -2548,7 +2548,7 @@ function Yt(e) {
|
|
|
2548
2548
|
contains: [
|
|
2549
2549
|
e.BACKSLASH_ESCAPE,
|
|
2550
2550
|
b,
|
|
2551
|
-
|
|
2551
|
+
c
|
|
2552
2552
|
]
|
|
2553
2553
|
},
|
|
2554
2554
|
{
|
|
@@ -2557,13 +2557,13 @@ function Yt(e) {
|
|
|
2557
2557
|
contains: [
|
|
2558
2558
|
e.BACKSLASH_ESCAPE,
|
|
2559
2559
|
b,
|
|
2560
|
-
|
|
2560
|
+
c
|
|
2561
2561
|
]
|
|
2562
2562
|
},
|
|
2563
2563
|
e.APOS_STRING_MODE,
|
|
2564
2564
|
e.QUOTE_STRING_MODE
|
|
2565
2565
|
]
|
|
2566
|
-
},
|
|
2566
|
+
}, y = "[0-9](_?[0-9])*", m = `(\\b(${y}))?\\.(${y})|\\b(${y})\\.`, N = `\\b|${s.join("|")}`, g = {
|
|
2567
2567
|
className: "number",
|
|
2568
2568
|
relevance: 0,
|
|
2569
2569
|
variants: [
|
|
@@ -2578,10 +2578,10 @@ function Yt(e) {
|
|
|
2578
2578
|
// because both MUST contain a decimal point and so cannot be confused with
|
|
2579
2579
|
// the interior part of an identifier
|
|
2580
2580
|
{
|
|
2581
|
-
begin: `(\\b(${
|
|
2581
|
+
begin: `(\\b(${y})|(${m}))[eE][+-]?(${y})[jJ]?(?=${N})`
|
|
2582
2582
|
},
|
|
2583
2583
|
{
|
|
2584
|
-
begin: `(${
|
|
2584
|
+
begin: `(${m})[jJ]?`
|
|
2585
2585
|
},
|
|
2586
2586
|
// decinteger, bininteger, octinteger, hexinteger
|
|
2587
2587
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
|
|
@@ -2590,24 +2590,24 @@ function Yt(e) {
|
|
|
2590
2590
|
// decinteger is optionally imaginary
|
|
2591
2591
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
2592
2592
|
{
|
|
2593
|
-
begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${
|
|
2593
|
+
begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${N})`
|
|
2594
2594
|
},
|
|
2595
2595
|
{
|
|
2596
|
-
begin: `\\b0[bB](_?[01])+[lL]?(?=${
|
|
2596
|
+
begin: `\\b0[bB](_?[01])+[lL]?(?=${N})`
|
|
2597
2597
|
},
|
|
2598
2598
|
{
|
|
2599
|
-
begin: `\\b0[oO](_?[0-7])+[lL]?(?=${
|
|
2599
|
+
begin: `\\b0[oO](_?[0-7])+[lL]?(?=${N})`
|
|
2600
2600
|
},
|
|
2601
2601
|
{
|
|
2602
|
-
begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${
|
|
2602
|
+
begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${N})`
|
|
2603
2603
|
},
|
|
2604
2604
|
// imagnumber (digitpart-based)
|
|
2605
2605
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
2606
2606
|
{
|
|
2607
|
-
begin: `\\b(${
|
|
2607
|
+
begin: `\\b(${y})[jJ](?=${N})`
|
|
2608
2608
|
}
|
|
2609
2609
|
]
|
|
2610
|
-
},
|
|
2610
|
+
}, _ = {
|
|
2611
2611
|
className: "comment",
|
|
2612
2612
|
begin: n.lookahead(/# type:/),
|
|
2613
2613
|
end: /$/,
|
|
@@ -2642,16 +2642,16 @@ function Yt(e) {
|
|
|
2642
2642
|
contains: [
|
|
2643
2643
|
"self",
|
|
2644
2644
|
a,
|
|
2645
|
-
|
|
2646
|
-
|
|
2645
|
+
g,
|
|
2646
|
+
p,
|
|
2647
2647
|
e.HASH_COMMENT_MODE
|
|
2648
2648
|
]
|
|
2649
2649
|
}
|
|
2650
2650
|
]
|
|
2651
2651
|
};
|
|
2652
|
-
return
|
|
2653
|
-
|
|
2654
|
-
|
|
2652
|
+
return c.contains = [
|
|
2653
|
+
p,
|
|
2654
|
+
g,
|
|
2655
2655
|
a
|
|
2656
2656
|
], {
|
|
2657
2657
|
name: "Python",
|
|
@@ -2665,7 +2665,7 @@ function Yt(e) {
|
|
|
2665
2665
|
illegal: /(<\/|->|\?)|=>/,
|
|
2666
2666
|
contains: [
|
|
2667
2667
|
a,
|
|
2668
|
-
|
|
2668
|
+
g,
|
|
2669
2669
|
{
|
|
2670
2670
|
// very common convention
|
|
2671
2671
|
begin: /\bself\b/
|
|
@@ -2676,8 +2676,8 @@ function Yt(e) {
|
|
|
2676
2676
|
beginKeywords: "if",
|
|
2677
2677
|
relevance: 0
|
|
2678
2678
|
},
|
|
2679
|
-
|
|
2680
|
-
|
|
2679
|
+
p,
|
|
2680
|
+
_,
|
|
2681
2681
|
e.HASH_COMMENT_MODE,
|
|
2682
2682
|
{
|
|
2683
2683
|
match: [
|
|
@@ -2723,30 +2723,30 @@ function Yt(e) {
|
|
|
2723
2723
|
begin: /^[\t ]*@/,
|
|
2724
2724
|
end: /(?=#)|$/,
|
|
2725
2725
|
contains: [
|
|
2726
|
-
|
|
2726
|
+
g,
|
|
2727
2727
|
S,
|
|
2728
|
-
|
|
2728
|
+
p
|
|
2729
2729
|
]
|
|
2730
2730
|
}
|
|
2731
2731
|
]
|
|
2732
2732
|
};
|
|
2733
2733
|
}
|
|
2734
|
-
var le = "[0-9](_*[0-9])*",
|
|
2734
|
+
var le = "[0-9](_*[0-9])*", Me = `\\.(${le})`, Re = "[0-9a-fA-F](_*[0-9a-fA-F])*", un = {
|
|
2735
2735
|
className: "number",
|
|
2736
2736
|
variants: [
|
|
2737
2737
|
// DecimalFloatingPointLiteral
|
|
2738
2738
|
// including ExponentPart
|
|
2739
|
-
{ begin: `(\\b(${le})((${
|
|
2739
|
+
{ begin: `(\\b(${le})((${Me})|\\.)?|(${Me}))[eE][+-]?(${le})[fFdD]?\\b` },
|
|
2740
2740
|
// excluding ExponentPart
|
|
2741
|
-
{ begin: `\\b(${le})((${
|
|
2742
|
-
{ begin: `(${
|
|
2741
|
+
{ begin: `\\b(${le})((${Me})[fFdD]?\\b|\\.([fFdD]\\b)?)` },
|
|
2742
|
+
{ begin: `(${Me})[fFdD]?\\b` },
|
|
2743
2743
|
{ begin: `\\b(${le})[fFdD]\\b` },
|
|
2744
2744
|
// HexadecimalFloatingPointLiteral
|
|
2745
|
-
{ begin: `\\b0[xX]((${
|
|
2745
|
+
{ begin: `\\b0[xX]((${Re})\\.?|(${Re})?\\.(${Re}))[pP][+-]?(${le})[fFdD]?\\b` },
|
|
2746
2746
|
// DecimalIntegerLiteral
|
|
2747
2747
|
{ begin: "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" },
|
|
2748
2748
|
// HexIntegerLiteral
|
|
2749
|
-
{ begin: `\\b0[xX](${
|
|
2749
|
+
{ begin: `\\b0[xX](${Re})[lL]?\\b` },
|
|
2750
2750
|
// OctalIntegerLiteral
|
|
2751
2751
|
{ begin: "\\b0(_*[0-7])*[lL]?\\b" },
|
|
2752
2752
|
// BinaryIntegerLiteral
|
|
@@ -2757,7 +2757,7 @@ var le = "[0-9](_*[0-9])*", we = `\\.(${le})`, Se = "[0-9a-fA-F](_*[0-9a-fA-F])*
|
|
|
2757
2757
|
function wn(e, n, t) {
|
|
2758
2758
|
return t === -1 ? "" : e.replace(n, (s) => wn(e, n, t - 1));
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2760
|
+
function Qt(e) {
|
|
2761
2761
|
const n = e.regex, t = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", s = t + wn("(?:<" + t + "~~~(?:\\s*,\\s*" + t + "~~~)*>)?", /~~~/g, 2), a = {
|
|
2762
2762
|
keyword: [
|
|
2763
2763
|
"synchronized",
|
|
@@ -2822,7 +2822,7 @@ function Zt(e) {
|
|
|
2822
2822
|
"super",
|
|
2823
2823
|
"this"
|
|
2824
2824
|
]
|
|
2825
|
-
},
|
|
2825
|
+
}, c = {
|
|
2826
2826
|
className: "meta",
|
|
2827
2827
|
begin: "@" + t,
|
|
2828
2828
|
contains: [
|
|
@@ -2950,7 +2950,7 @@ function Zt(e) {
|
|
|
2950
2950
|
keywords: a,
|
|
2951
2951
|
relevance: 0,
|
|
2952
2952
|
contains: [
|
|
2953
|
-
|
|
2953
|
+
c,
|
|
2954
2954
|
e.APOS_STRING_MODE,
|
|
2955
2955
|
e.QUOTE_STRING_MODE,
|
|
2956
2956
|
un,
|
|
@@ -2962,11 +2962,11 @@ function Zt(e) {
|
|
|
2962
2962
|
]
|
|
2963
2963
|
},
|
|
2964
2964
|
un,
|
|
2965
|
-
|
|
2965
|
+
c
|
|
2966
2966
|
]
|
|
2967
2967
|
};
|
|
2968
2968
|
}
|
|
2969
|
-
function
|
|
2969
|
+
function qt(e) {
|
|
2970
2970
|
const n = e.regex, t = {}, s = {
|
|
2971
2971
|
begin: /\$\{/,
|
|
2972
2972
|
end: /\}/,
|
|
@@ -2991,7 +2991,7 @@ function Qt(e) {
|
|
|
2991
2991
|
s
|
|
2992
2992
|
]
|
|
2993
2993
|
});
|
|
2994
|
-
const
|
|
2994
|
+
const o = {
|
|
2995
2995
|
className: "subst",
|
|
2996
2996
|
begin: /\$\(/,
|
|
2997
2997
|
end: /\)/,
|
|
@@ -3012,10 +3012,10 @@ function Qt(e) {
|
|
|
3012
3012
|
contains: [
|
|
3013
3013
|
e.BACKSLASH_ESCAPE,
|
|
3014
3014
|
t,
|
|
3015
|
-
|
|
3015
|
+
o
|
|
3016
3016
|
]
|
|
3017
3017
|
};
|
|
3018
|
-
|
|
3018
|
+
o.contains.push(i);
|
|
3019
3019
|
const r = {
|
|
3020
3020
|
className: "",
|
|
3021
3021
|
begin: /\\"/
|
|
@@ -3023,7 +3023,7 @@ function Qt(e) {
|
|
|
3023
3023
|
className: "string",
|
|
3024
3024
|
begin: /'/,
|
|
3025
3025
|
end: /'/
|
|
3026
|
-
},
|
|
3026
|
+
}, c = {
|
|
3027
3027
|
begin: /\$?\(\(/,
|
|
3028
3028
|
end: /\)\)/,
|
|
3029
3029
|
contains: [
|
|
@@ -3044,16 +3044,16 @@ function Qt(e) {
|
|
|
3044
3044
|
"tcsh",
|
|
3045
3045
|
"dash",
|
|
3046
3046
|
"scsh"
|
|
3047
|
-
],
|
|
3047
|
+
], p = e.SHEBANG({
|
|
3048
3048
|
binary: `(${b.join("|")})`,
|
|
3049
3049
|
relevance: 10
|
|
3050
|
-
}),
|
|
3050
|
+
}), y = {
|
|
3051
3051
|
className: "function",
|
|
3052
3052
|
begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
|
|
3053
3053
|
returnBegin: !0,
|
|
3054
3054
|
contains: [e.inherit(e.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
|
|
3055
3055
|
relevance: 0
|
|
3056
|
-
},
|
|
3056
|
+
}, m = [
|
|
3057
3057
|
"if",
|
|
3058
3058
|
"then",
|
|
3059
3059
|
"else",
|
|
@@ -3067,10 +3067,10 @@ function Qt(e) {
|
|
|
3067
3067
|
"case",
|
|
3068
3068
|
"esac",
|
|
3069
3069
|
"function"
|
|
3070
|
-
],
|
|
3070
|
+
], N = [
|
|
3071
3071
|
"true",
|
|
3072
3072
|
"false"
|
|
3073
|
-
],
|
|
3073
|
+
], g = { match: /(\/[a-z._-]+)+/ }, _ = [
|
|
3074
3074
|
"break",
|
|
3075
3075
|
"cd",
|
|
3076
3076
|
"continue",
|
|
@@ -3111,7 +3111,7 @@ function Qt(e) {
|
|
|
3111
3111
|
"typeset",
|
|
3112
3112
|
"ulimit",
|
|
3113
3113
|
"unalias"
|
|
3114
|
-
],
|
|
3114
|
+
], M = [
|
|
3115
3115
|
"autoload",
|
|
3116
3116
|
"bg",
|
|
3117
3117
|
"bindkey",
|
|
@@ -3180,7 +3180,7 @@ function Qt(e) {
|
|
|
3180
3180
|
"zsocket",
|
|
3181
3181
|
"zstyle",
|
|
3182
3182
|
"ztcp"
|
|
3183
|
-
],
|
|
3183
|
+
], O = [
|
|
3184
3184
|
"chcon",
|
|
3185
3185
|
"chgrp",
|
|
3186
3186
|
"chown",
|
|
@@ -3290,28 +3290,28 @@ function Qt(e) {
|
|
|
3290
3290
|
aliases: ["sh"],
|
|
3291
3291
|
keywords: {
|
|
3292
3292
|
$pattern: /\b[a-z][a-z0-9._-]+\b/,
|
|
3293
|
-
keyword:
|
|
3294
|
-
literal:
|
|
3293
|
+
keyword: m,
|
|
3294
|
+
literal: N,
|
|
3295
3295
|
built_in: [
|
|
3296
|
-
...
|
|
3296
|
+
..._,
|
|
3297
3297
|
...S,
|
|
3298
3298
|
// Shell modifiers
|
|
3299
3299
|
"set",
|
|
3300
3300
|
"shopt",
|
|
3301
|
-
...
|
|
3302
|
-
...
|
|
3301
|
+
...M,
|
|
3302
|
+
...O
|
|
3303
3303
|
]
|
|
3304
3304
|
},
|
|
3305
3305
|
contains: [
|
|
3306
|
-
|
|
3306
|
+
p,
|
|
3307
3307
|
// to catch known shells and boost relevancy
|
|
3308
3308
|
e.SHEBANG(),
|
|
3309
3309
|
// to catch unknown shells but still highlight the shebang
|
|
3310
|
-
|
|
3311
|
-
|
|
3310
|
+
y,
|
|
3311
|
+
c,
|
|
3312
3312
|
e.HASH_COMMENT_MODE,
|
|
3313
3313
|
l,
|
|
3314
|
-
|
|
3314
|
+
g,
|
|
3315
3315
|
i,
|
|
3316
3316
|
r,
|
|
3317
3317
|
a,
|
|
@@ -3319,7 +3319,7 @@ function Qt(e) {
|
|
|
3319
3319
|
]
|
|
3320
3320
|
};
|
|
3321
3321
|
}
|
|
3322
|
-
function
|
|
3322
|
+
function Xt(e) {
|
|
3323
3323
|
const n = e.regex, t = e.COMMENT("--", "$"), s = {
|
|
3324
3324
|
className: "string",
|
|
3325
3325
|
variants: [
|
|
@@ -3329,7 +3329,7 @@ function qt(e) {
|
|
|
3329
3329
|
contains: [{ begin: /''/ }]
|
|
3330
3330
|
}
|
|
3331
3331
|
]
|
|
3332
|
-
},
|
|
3332
|
+
}, o = {
|
|
3333
3333
|
begin: /"/,
|
|
3334
3334
|
end: /"/,
|
|
3335
3335
|
contains: [{ begin: /""/ }]
|
|
@@ -3382,7 +3382,7 @@ function qt(e) {
|
|
|
3382
3382
|
"first",
|
|
3383
3383
|
"last",
|
|
3384
3384
|
"view"
|
|
3385
|
-
],
|
|
3385
|
+
], c = [
|
|
3386
3386
|
"abs",
|
|
3387
3387
|
"acos",
|
|
3388
3388
|
"all",
|
|
@@ -3835,7 +3835,7 @@ function qt(e) {
|
|
|
3835
3835
|
"var_pop",
|
|
3836
3836
|
"var_samp",
|
|
3837
3837
|
"width_bucket"
|
|
3838
|
-
],
|
|
3838
|
+
], p = [
|
|
3839
3839
|
"current_catalog",
|
|
3840
3840
|
"current_date",
|
|
3841
3841
|
"current_default_transform_group",
|
|
@@ -3851,7 +3851,7 @@ function qt(e) {
|
|
|
3851
3851
|
"localtime",
|
|
3852
3852
|
"current_timestamp",
|
|
3853
3853
|
"localtimestamp"
|
|
3854
|
-
],
|
|
3854
|
+
], y = [
|
|
3855
3855
|
"create table",
|
|
3856
3856
|
"insert into",
|
|
3857
3857
|
"primary key",
|
|
@@ -3868,27 +3868,27 @@ function qt(e) {
|
|
|
3868
3868
|
"nulls last",
|
|
3869
3869
|
"depth first",
|
|
3870
3870
|
"breadth first"
|
|
3871
|
-
],
|
|
3872
|
-
...
|
|
3871
|
+
], m = b, N = [
|
|
3872
|
+
...c,
|
|
3873
3873
|
...a
|
|
3874
|
-
].filter((
|
|
3874
|
+
].filter((O) => !b.includes(O)), g = {
|
|
3875
3875
|
className: "variable",
|
|
3876
3876
|
begin: /@[a-z0-9]+/
|
|
3877
|
-
},
|
|
3877
|
+
}, _ = {
|
|
3878
3878
|
className: "operator",
|
|
3879
3879
|
begin: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
|
|
3880
3880
|
relevance: 0
|
|
3881
3881
|
}, S = {
|
|
3882
|
-
begin: n.concat(/\b/, n.either(...
|
|
3882
|
+
begin: n.concat(/\b/, n.either(...m), /\s*\(/),
|
|
3883
3883
|
relevance: 0,
|
|
3884
|
-
keywords: { built_in:
|
|
3884
|
+
keywords: { built_in: m }
|
|
3885
3885
|
};
|
|
3886
|
-
function
|
|
3887
|
-
exceptions:
|
|
3888
|
-
when:
|
|
3886
|
+
function M(O, {
|
|
3887
|
+
exceptions: T,
|
|
3888
|
+
when: D
|
|
3889
3889
|
} = {}) {
|
|
3890
|
-
const
|
|
3891
|
-
return
|
|
3890
|
+
const $ = D;
|
|
3891
|
+
return T = T || [], O.map((R) => R.match(/\|\d+$/) || T.includes(R) ? R : $(R) ? `${R}|0` : R);
|
|
3892
3892
|
}
|
|
3893
3893
|
return {
|
|
3894
3894
|
name: "SQL",
|
|
@@ -3897,18 +3897,18 @@ function qt(e) {
|
|
|
3897
3897
|
illegal: /[{}]|<\//,
|
|
3898
3898
|
keywords: {
|
|
3899
3899
|
$pattern: /\b[\w\.]+/,
|
|
3900
|
-
keyword:
|
|
3900
|
+
keyword: M(N, { when: (O) => O.length < 3 }),
|
|
3901
3901
|
literal: l,
|
|
3902
3902
|
type: r,
|
|
3903
|
-
built_in:
|
|
3903
|
+
built_in: p
|
|
3904
3904
|
},
|
|
3905
3905
|
contains: [
|
|
3906
3906
|
{
|
|
3907
|
-
begin: n.either(...
|
|
3907
|
+
begin: n.either(...y),
|
|
3908
3908
|
relevance: 0,
|
|
3909
3909
|
keywords: {
|
|
3910
3910
|
$pattern: /[\w\.]+/,
|
|
3911
|
-
keyword:
|
|
3911
|
+
keyword: N.concat(y),
|
|
3912
3912
|
literal: l,
|
|
3913
3913
|
type: r
|
|
3914
3914
|
}
|
|
@@ -3918,354 +3918,372 @@ function qt(e) {
|
|
|
3918
3918
|
begin: n.either(...i)
|
|
3919
3919
|
},
|
|
3920
3920
|
S,
|
|
3921
|
-
|
|
3921
|
+
g,
|
|
3922
3922
|
s,
|
|
3923
|
-
|
|
3923
|
+
o,
|
|
3924
3924
|
e.C_NUMBER_MODE,
|
|
3925
3925
|
e.C_BLOCK_COMMENT_MODE,
|
|
3926
3926
|
t,
|
|
3927
|
-
|
|
3927
|
+
_
|
|
3928
3928
|
]
|
|
3929
3929
|
};
|
|
3930
3930
|
}
|
|
3931
|
-
Z.registerLanguage("xml",
|
|
3932
|
-
Z.registerLanguage("javascript",
|
|
3933
|
-
Z.registerLanguage("json",
|
|
3934
|
-
Z.registerLanguage("yaml",
|
|
3935
|
-
Z.registerLanguage("plaintext",
|
|
3936
|
-
Z.registerLanguage("python",
|
|
3937
|
-
Z.registerLanguage("java",
|
|
3938
|
-
Z.registerLanguage("bash",
|
|
3939
|
-
Z.registerLanguage("sql",
|
|
3940
|
-
var
|
|
3941
|
-
const X = "<code-diff-modified>", V = "</code-diff-modified>",
|
|
3942
|
-
(
|
|
3931
|
+
Z.registerLanguage("xml", Ut);
|
|
3932
|
+
Z.registerLanguage("javascript", Gt);
|
|
3933
|
+
Z.registerLanguage("json", Kt);
|
|
3934
|
+
Z.registerLanguage("yaml", Wt);
|
|
3935
|
+
Z.registerLanguage("plaintext", Yt);
|
|
3936
|
+
Z.registerLanguage("python", Zt);
|
|
3937
|
+
Z.registerLanguage("java", Qt);
|
|
3938
|
+
Z.registerLanguage("bash", qt);
|
|
3939
|
+
Z.registerLanguage("sql", Xt);
|
|
3940
|
+
var d = /* @__PURE__ */ ((e) => (e.EQUAL = "equal", e.DELETE = "removed", e.ADD = "added", e.EMPTY = "empty", e))(d || {});
|
|
3941
|
+
const X = "<code-diff-modified>", V = "</code-diff-modified>", Vt = X.replace("<", "<").replace(">", ">"), jt = V.replace("<", "<").replace(">", ">"), de = (e) => e === void 0 ? d.EQUAL : e.added ? d.ADD : e.removed ? d.DELETE : d.EQUAL, De = (e, n, t = "word") => typeof e > "u" ? n : typeof n > "u" ? e : (t === "char" ? Un : Hn)(e, n).filter((o) => de(o) !== d.DELETE).map(
|
|
3942
|
+
(o) => de(o) === d.ADD ? `${X}${o.value}${V}` : o.value
|
|
3943
3943
|
).join(""), Y = (e, n) => {
|
|
3944
3944
|
if (!n.match(new RegExp(`(${X}|${V})`, "g")))
|
|
3945
3945
|
return Z.highlight(n, { language: e }).value;
|
|
3946
3946
|
let s = n;
|
|
3947
|
-
const
|
|
3948
|
-
l.innerHTML = Z.highlight(
|
|
3947
|
+
const o = n.replace(new RegExp(`(${X}|${V})`, "g"), ""), l = document.createElement("div");
|
|
3948
|
+
l.innerHTML = Z.highlight(o, { language: e }).value;
|
|
3949
3949
|
let i = !1;
|
|
3950
3950
|
const r = (a) => {
|
|
3951
|
-
a.childNodes.forEach((
|
|
3952
|
-
if (
|
|
3953
|
-
if (!
|
|
3951
|
+
a.childNodes.forEach((c) => {
|
|
3952
|
+
if (c.nodeType === Node.ELEMENT_NODE && r(c), c.nodeType === Node.TEXT_NODE) {
|
|
3953
|
+
if (!c.textContent)
|
|
3954
3954
|
return;
|
|
3955
|
-
let b =
|
|
3956
|
-
for (i && (
|
|
3955
|
+
let b = c.textContent, p = "";
|
|
3956
|
+
for (i && (p = p + X); b.length; ) {
|
|
3957
3957
|
if (s.startsWith(X)) {
|
|
3958
|
-
s = s.slice(X.length),
|
|
3958
|
+
s = s.slice(X.length), p = p + X, i = !0;
|
|
3959
3959
|
continue;
|
|
3960
3960
|
}
|
|
3961
3961
|
if (s.startsWith(V)) {
|
|
3962
|
-
s = s.slice(V.length),
|
|
3962
|
+
s = s.slice(V.length), p = p + V, i = !1;
|
|
3963
3963
|
continue;
|
|
3964
3964
|
}
|
|
3965
|
-
const
|
|
3966
|
-
|
|
3965
|
+
const y = s.match(new RegExp(`(${X}|${V})`)), m = y && y.index ? y.index : s.length, N = Math.min(m, b.length);
|
|
3966
|
+
p = p + s.substring(0, N), s = s.slice(N), b = b.slice(N);
|
|
3967
3967
|
}
|
|
3968
|
-
i && (
|
|
3968
|
+
i && (p = p + V), c.textContent = p;
|
|
3969
3969
|
}
|
|
3970
3970
|
});
|
|
3971
3971
|
};
|
|
3972
|
-
return r(l), l.innerHTML.replace(new RegExp(
|
|
3972
|
+
return r(l), l.innerHTML.replace(new RegExp(Vt, "g"), '<span class="x">').replace(new RegExp(jt, "g"), "</span>");
|
|
3973
3973
|
};
|
|
3974
|
-
function
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3974
|
+
function Sn(e) {
|
|
3975
|
+
const n = (o, l) => (o.match(new RegExp(l, "g")) || []).length;
|
|
3976
|
+
let t = 0, s = 0;
|
|
3977
|
+
for (const o of e)
|
|
3978
|
+
o.added && (t += n(o.value.trim(), `
|
|
3979
|
+
`) + 1), o.removed && (s += n(o.value.trim(), `
|
|
3980
|
+
`) + 1);
|
|
3981
|
+
return { additionsNum: t, deletionsNum: s };
|
|
3982
|
+
}
|
|
3983
|
+
function Jt(e, n, t = "plaintext", s = "word", o = 10) {
|
|
3984
|
+
var N;
|
|
3985
|
+
const l = () => ({ type: d.EMPTY }), i = (g, _, S) => ({ type: g, num: _, code: S }), r = fn(e, n);
|
|
3986
|
+
let a = 0, c = 0, b = !1;
|
|
3987
|
+
const p = [], y = {
|
|
3988
|
+
changes: p,
|
|
3989
|
+
stat: Sn(r)
|
|
3990
|
+
};
|
|
3991
|
+
for (let g = 0; g < r.length; g++) {
|
|
3980
3992
|
if (b) {
|
|
3981
3993
|
b = !1;
|
|
3982
3994
|
continue;
|
|
3983
3995
|
}
|
|
3984
|
-
const [
|
|
3996
|
+
const [_, S] = [r[g], r[g + 1]], [M, O] = [de(_), de(S)], T = _.value.replace(/\n$/, "").split(`
|
|
3985
3997
|
`);
|
|
3986
|
-
if (
|
|
3987
|
-
for (const
|
|
3988
|
-
let
|
|
3989
|
-
const
|
|
3990
|
-
|
|
3998
|
+
if (S === void 0) {
|
|
3999
|
+
for (const $ of T) {
|
|
4000
|
+
let R = l(), W = l();
|
|
4001
|
+
const U = Y(t, $);
|
|
4002
|
+
M === d.EQUAL && (a++, c++, R = i(d.EQUAL, a, U), W = i(d.EQUAL, c, U)), M === d.DELETE && (a++, R = i(d.DELETE, a, U), W = l()), M === d.ADD && (c++, R = l(), W = i(d.ADD, c, U)), p.push({ left: R, right: W });
|
|
3991
4003
|
}
|
|
3992
4004
|
break;
|
|
3993
4005
|
}
|
|
3994
|
-
if (
|
|
3995
|
-
for (const
|
|
3996
|
-
a++,
|
|
3997
|
-
const
|
|
3998
|
-
|
|
3999
|
-
left: i(
|
|
4000
|
-
right: i(
|
|
4006
|
+
if (M === d.EQUAL)
|
|
4007
|
+
for (const $ of T) {
|
|
4008
|
+
a++, c++;
|
|
4009
|
+
const R = Y(t, $);
|
|
4010
|
+
p.push({
|
|
4011
|
+
left: i(d.EQUAL, a, R),
|
|
4012
|
+
right: i(d.EQUAL, c, R)
|
|
4001
4013
|
});
|
|
4002
4014
|
}
|
|
4003
|
-
const
|
|
4015
|
+
const D = S.value.replace(/\n$/, "").split(`
|
|
4004
4016
|
`);
|
|
4005
|
-
if (
|
|
4006
|
-
if (
|
|
4007
|
-
for (const
|
|
4008
|
-
a++,
|
|
4009
|
-
left: i(
|
|
4017
|
+
if (M === d.DELETE) {
|
|
4018
|
+
if (O === d.EQUAL)
|
|
4019
|
+
for (const $ of T)
|
|
4020
|
+
a++, p.push({
|
|
4021
|
+
left: i(d.DELETE, a, Y(t, $)),
|
|
4010
4022
|
right: l()
|
|
4011
4023
|
});
|
|
4012
|
-
if (
|
|
4024
|
+
if (O === d.ADD) {
|
|
4013
4025
|
b = !0;
|
|
4014
|
-
const
|
|
4015
|
-
for (let
|
|
4016
|
-
|
|
4017
|
-
const [
|
|
4018
|
-
|
|
4026
|
+
const $ = Math.max(_.count, S.count);
|
|
4027
|
+
for (let R = 0; R < $; R++) {
|
|
4028
|
+
R < _.count && a++, R < S.count && c++;
|
|
4029
|
+
const [W, U] = [T[R], D[R]], re = T.length === D.length ? De(U, W, s) : W, ae = T.length === D.length ? De(W, U, s) : U, ge = R < _.count ? i(d.DELETE, a, Y(t, re)) : l(), pe = R < S.count ? i(d.ADD, c, Y(t, ae)) : l();
|
|
4030
|
+
p.push({ left: ge, right: pe });
|
|
4019
4031
|
}
|
|
4020
4032
|
}
|
|
4021
4033
|
}
|
|
4022
|
-
if (
|
|
4023
|
-
for (const
|
|
4024
|
-
|
|
4034
|
+
if (M === d.ADD)
|
|
4035
|
+
for (const $ of T)
|
|
4036
|
+
c++, p.push({
|
|
4025
4037
|
left: l(),
|
|
4026
|
-
right: i(
|
|
4038
|
+
right: i(d.ADD, c, Y(t, $))
|
|
4027
4039
|
});
|
|
4028
4040
|
}
|
|
4029
4041
|
if (e === n) {
|
|
4030
|
-
for (let
|
|
4031
|
-
|
|
4032
|
-
return
|
|
4042
|
+
for (let g = 0; g < p.length; g++)
|
|
4043
|
+
p[g].fold = !1;
|
|
4044
|
+
return y;
|
|
4033
4045
|
}
|
|
4034
|
-
for (let
|
|
4035
|
-
const
|
|
4036
|
-
if (
|
|
4037
|
-
const [
|
|
4038
|
-
for (let
|
|
4039
|
-
|
|
4046
|
+
for (let g = 0; g < p.length; g++) {
|
|
4047
|
+
const _ = p[g];
|
|
4048
|
+
if (_.left.type === d.DELETE || _.right.type === d.ADD) {
|
|
4049
|
+
const [S, M] = [Math.max(g - o, 0), Math.min(g + o + 1, p.length)];
|
|
4050
|
+
for (let O = S; O < M; O++)
|
|
4051
|
+
p[O].fold = !1;
|
|
4040
4052
|
}
|
|
4041
|
-
|
|
4053
|
+
_.fold === void 0 && (_.fold = !0);
|
|
4042
4054
|
}
|
|
4043
|
-
const
|
|
4044
|
-
for (let
|
|
4045
|
-
const
|
|
4046
|
-
if (
|
|
4047
|
-
|
|
4055
|
+
const m = [];
|
|
4056
|
+
for (let g = 0; g < p.length; g++) {
|
|
4057
|
+
const _ = p[g];
|
|
4058
|
+
if (_.fold === !1) {
|
|
4059
|
+
m.push(_);
|
|
4048
4060
|
continue;
|
|
4049
4061
|
}
|
|
4050
|
-
|
|
4062
|
+
_.fold === !0 && ((N = m[m.length - 1]) == null ? void 0 : N.fold) !== !0 && m.push(_);
|
|
4051
4063
|
}
|
|
4052
|
-
return
|
|
4064
|
+
return y.changes = m, y;
|
|
4053
4065
|
}
|
|
4054
|
-
function
|
|
4055
|
-
var
|
|
4066
|
+
function es(e, n, t = "plaintext", s = "word", o = 2) {
|
|
4067
|
+
var y;
|
|
4056
4068
|
const l = fn(e, n);
|
|
4057
4069
|
let i = 0, r = 0, a = !1;
|
|
4058
|
-
const
|
|
4059
|
-
|
|
4070
|
+
const c = [], b = {
|
|
4071
|
+
changes: c,
|
|
4072
|
+
stat: Sn(l)
|
|
4073
|
+
};
|
|
4074
|
+
for (let m = 0; m < l.length; m++) {
|
|
4060
4075
|
if (a) {
|
|
4061
4076
|
a = !1;
|
|
4062
4077
|
continue;
|
|
4063
4078
|
}
|
|
4064
|
-
const [
|
|
4079
|
+
const [N, g] = [l[m], l[m + 1]], [_, S] = [de(N), de(g)], M = N.value.replace(/\n$/, "").split(`
|
|
4065
4080
|
`);
|
|
4066
|
-
if (
|
|
4067
|
-
for (const
|
|
4068
|
-
|
|
4069
|
-
const
|
|
4070
|
-
|
|
4071
|
-
type:
|
|
4072
|
-
code:
|
|
4073
|
-
addNum:
|
|
4074
|
-
delNum:
|
|
4081
|
+
if (g === void 0) {
|
|
4082
|
+
for (const T of M) {
|
|
4083
|
+
_ === d.EQUAL && (i++, r++), _ === d.DELETE && i++, _ === d.ADD && r++;
|
|
4084
|
+
const D = Y(t, T);
|
|
4085
|
+
c.push({
|
|
4086
|
+
type: _,
|
|
4087
|
+
code: D,
|
|
4088
|
+
addNum: _ === d.DELETE ? void 0 : r,
|
|
4089
|
+
delNum: _ === d.ADD ? void 0 : i
|
|
4075
4090
|
});
|
|
4076
4091
|
}
|
|
4077
4092
|
break;
|
|
4078
4093
|
}
|
|
4079
|
-
if (
|
|
4080
|
-
for (const
|
|
4094
|
+
if (_ === d.EQUAL)
|
|
4095
|
+
for (const T of M) {
|
|
4081
4096
|
i++, r++;
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4097
|
+
const D = Y(t, T);
|
|
4098
|
+
c.push({ type: d.EQUAL, code: D, delNum: i, addNum: r });
|
|
4084
4099
|
}
|
|
4085
|
-
const
|
|
4100
|
+
const O = g.value.replace(/\n$/, "").split(`
|
|
4086
4101
|
`);
|
|
4087
|
-
if (
|
|
4088
|
-
if (
|
|
4089
|
-
for (let
|
|
4090
|
-
const
|
|
4102
|
+
if (_ === d.DELETE)
|
|
4103
|
+
if (S === d.ADD && M.length === O.length) {
|
|
4104
|
+
for (let T = 0; T < M.length; T++) {
|
|
4105
|
+
const D = M[T], $ = O[T];
|
|
4091
4106
|
i++;
|
|
4092
|
-
const
|
|
4093
|
-
|
|
4107
|
+
const R = Y(t, De($, D, s));
|
|
4108
|
+
c.push({ type: d.DELETE, code: R, delNum: i });
|
|
4094
4109
|
}
|
|
4095
|
-
for (let
|
|
4096
|
-
const
|
|
4110
|
+
for (let T = 0; T < O.length; T++) {
|
|
4111
|
+
const D = M[T], $ = O[T];
|
|
4097
4112
|
r++;
|
|
4098
|
-
const
|
|
4099
|
-
|
|
4113
|
+
const R = Y(t, De(D, $, s));
|
|
4114
|
+
c.push({ type: d.ADD, code: R, addNum: r });
|
|
4100
4115
|
}
|
|
4101
4116
|
a = !0;
|
|
4102
4117
|
} else
|
|
4103
|
-
for (const
|
|
4118
|
+
for (const T of M) {
|
|
4104
4119
|
i++;
|
|
4105
|
-
const
|
|
4106
|
-
|
|
4120
|
+
const D = Y(t, T);
|
|
4121
|
+
c.push({ type: d.DELETE, code: D, delNum: i });
|
|
4107
4122
|
}
|
|
4108
|
-
if (
|
|
4109
|
-
for (const
|
|
4123
|
+
if (_ === d.ADD)
|
|
4124
|
+
for (const T of M) {
|
|
4110
4125
|
r++;
|
|
4111
|
-
const
|
|
4112
|
-
|
|
4126
|
+
const D = Y(t, T);
|
|
4127
|
+
c.push({ type: d.ADD, code: D, addNum: r });
|
|
4113
4128
|
}
|
|
4114
4129
|
}
|
|
4115
|
-
for (let
|
|
4116
|
-
const
|
|
4117
|
-
if (
|
|
4118
|
-
const [
|
|
4119
|
-
for (let
|
|
4120
|
-
|
|
4130
|
+
for (let m = 0; m < c.length; m++) {
|
|
4131
|
+
const N = c[m];
|
|
4132
|
+
if (N.type === d.DELETE || N.type === d.ADD) {
|
|
4133
|
+
const [g, _] = [Math.max(m - o, 0), Math.min(m + o + 1, c.length)];
|
|
4134
|
+
for (let S = g; S < _; S++)
|
|
4135
|
+
c[S].fold = !1;
|
|
4121
4136
|
}
|
|
4122
|
-
|
|
4137
|
+
N.fold === void 0 && (N.fold = !0);
|
|
4123
4138
|
}
|
|
4124
4139
|
if (e === n) {
|
|
4125
|
-
for (let
|
|
4126
|
-
|
|
4127
|
-
return
|
|
4140
|
+
for (let m = 0; m < c.length; m++)
|
|
4141
|
+
c[m].fold = !1;
|
|
4142
|
+
return b;
|
|
4128
4143
|
}
|
|
4129
|
-
const
|
|
4130
|
-
for (let
|
|
4131
|
-
const
|
|
4132
|
-
if (
|
|
4133
|
-
|
|
4144
|
+
const p = [];
|
|
4145
|
+
for (let m = 0; m < c.length; m++) {
|
|
4146
|
+
const N = c[m];
|
|
4147
|
+
if (N.fold === !1) {
|
|
4148
|
+
p.push(N);
|
|
4134
4149
|
continue;
|
|
4135
4150
|
}
|
|
4136
|
-
|
|
4151
|
+
N.fold === !0 && (m === 0 || ((y = p[p.length - 1]) == null ? void 0 : y.fold) !== !0) && p.push(N);
|
|
4137
4152
|
}
|
|
4138
|
-
return b;
|
|
4153
|
+
return b.changes = p, b;
|
|
4139
4154
|
}
|
|
4140
|
-
const
|
|
4141
|
-
class: "blob-code blob-code-
|
|
4155
|
+
const ns = { key: 0 }, ts = /* @__PURE__ */ C("td", { class: "blob-num blob-num-hunk" }, " > ", -1), ss = /* @__PURE__ */ C("td", { class: "blob-num blob-num-hunk" }, " > ", -1), is = /* @__PURE__ */ C("td", {
|
|
4156
|
+
class: "blob-code blob-code-hunk",
|
|
4142
4157
|
align: "left"
|
|
4143
|
-
}, " ⋯ ", -1),
|
|
4144
|
-
ns,
|
|
4158
|
+
}, " ⋯ ", -1), rs = [
|
|
4145
4159
|
ts,
|
|
4146
|
-
ss
|
|
4147
|
-
|
|
4160
|
+
ss,
|
|
4161
|
+
is
|
|
4162
|
+
], as = { key: 1 }, os = ["data-code-marker", "innerHTML"], cs = /* @__PURE__ */ ye({
|
|
4148
4163
|
__name: "UnifiedLine",
|
|
4149
4164
|
props: {
|
|
4150
4165
|
line: null
|
|
4151
4166
|
},
|
|
4152
4167
|
setup(e) {
|
|
4153
|
-
const n = (t) => t ===
|
|
4154
|
-
return (t, s) => e.line.fold ? (
|
|
4155
|
-
|
|
4156
|
-
class:
|
|
4157
|
-
"blob-num-deletion": e.line.type ===
|
|
4158
|
-
"blob-num-addition": e.line.type ===
|
|
4159
|
-
"blob-num-context": e.line.type ===
|
|
4168
|
+
const n = (t) => t === d.DELETE ? "-" : t === d.ADD ? "+" : "";
|
|
4169
|
+
return (t, s) => e.line.fold ? (H(), K("tr", ns, rs)) : (H(), K("tr", as, [
|
|
4170
|
+
C("td", {
|
|
4171
|
+
class: he(["blob-num", {
|
|
4172
|
+
"blob-num-deletion": e.line.type === B(d).DELETE,
|
|
4173
|
+
"blob-num-addition": e.line.type === B(d).ADD,
|
|
4174
|
+
"blob-num-context": e.line.type === B(d).EQUAL
|
|
4160
4175
|
}])
|
|
4161
|
-
},
|
|
4162
|
-
|
|
4163
|
-
class:
|
|
4164
|
-
"blob-num-deletion": e.line.type ===
|
|
4165
|
-
"blob-num-addition": e.line.type ===
|
|
4166
|
-
"blob-num-context": e.line.type ===
|
|
4176
|
+
}, fe(e.line.delNum), 3),
|
|
4177
|
+
C("td", {
|
|
4178
|
+
class: he(["blob-num", {
|
|
4179
|
+
"blob-num-deletion": e.line.type === B(d).DELETE,
|
|
4180
|
+
"blob-num-addition": e.line.type === B(d).ADD,
|
|
4181
|
+
"blob-num-context": e.line.type === B(d).EQUAL
|
|
4167
4182
|
}])
|
|
4168
|
-
},
|
|
4169
|
-
|
|
4170
|
-
class:
|
|
4171
|
-
"blob-code-deletion": e.line.type ===
|
|
4172
|
-
"blob-code-addition": e.line.type ===
|
|
4173
|
-
"blob-code-context": e.line.type ===
|
|
4183
|
+
}, fe(e.line.addNum), 3),
|
|
4184
|
+
C("td", {
|
|
4185
|
+
class: he(["blob-code", {
|
|
4186
|
+
"blob-code-deletion": e.line.type === B(d).DELETE,
|
|
4187
|
+
"blob-code-addition": e.line.type === B(d).ADD,
|
|
4188
|
+
"blob-code-context": e.line.type === B(d).EQUAL
|
|
4174
4189
|
}])
|
|
4175
4190
|
}, [
|
|
4176
|
-
|
|
4191
|
+
C("span", {
|
|
4177
4192
|
class: "blob-code-inner blob-code-marker",
|
|
4178
4193
|
"data-code-marker": n(e.line.type),
|
|
4179
4194
|
innerHTML: e.line.code
|
|
4180
|
-
}, null, 8,
|
|
4195
|
+
}, null, 8, os)
|
|
4181
4196
|
], 2)
|
|
4182
4197
|
]));
|
|
4183
4198
|
}
|
|
4184
|
-
}),
|
|
4199
|
+
}), ls = { class: "diff-table" }, us = /* @__PURE__ */ ye({
|
|
4185
4200
|
__name: "UnifiedViewer",
|
|
4186
4201
|
props: {
|
|
4187
4202
|
diffChange: null
|
|
4188
4203
|
},
|
|
4189
4204
|
setup(e) {
|
|
4190
|
-
return (n, t) => (
|
|
4191
|
-
|
|
4192
|
-
(
|
|
4193
|
-
key:
|
|
4205
|
+
return (n, t) => (H(), K("table", ls, [
|
|
4206
|
+
C("tbody", null, [
|
|
4207
|
+
(H(!0), K(ue, null, He(e.diffChange, (s, o) => (H(), Oe(cs, {
|
|
4208
|
+
key: o,
|
|
4194
4209
|
line: s
|
|
4195
4210
|
}, null, 8, ["line"]))), 128))
|
|
4196
4211
|
])
|
|
4197
4212
|
]));
|
|
4198
4213
|
}
|
|
4199
|
-
}),
|
|
4200
|
-
class: "blob-num blob-num-
|
|
4214
|
+
}), fs = { key: 0 }, ds = /* @__PURE__ */ C("td", {
|
|
4215
|
+
class: "blob-num blob-num-hunk",
|
|
4201
4216
|
colspan: "1"
|
|
4202
|
-
}, " > ", -1),
|
|
4203
|
-
class: "blob-code blob-code-
|
|
4217
|
+
}, " > ", -1), gs = /* @__PURE__ */ C("td", {
|
|
4218
|
+
class: "blob-code blob-code-inner blob-code-hunk",
|
|
4204
4219
|
colspan: "3",
|
|
4205
4220
|
align: "left"
|
|
4206
|
-
}, " ⋯ ", -1),
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
],
|
|
4221
|
+
}, " ⋯ ", -1), ps = [
|
|
4222
|
+
ds,
|
|
4223
|
+
gs
|
|
4224
|
+
], hs = { key: 1 }, bs = /* @__PURE__ */ C("td", { class: "blob-num blob-num-empty empty-cell" }, null, -1), Es = /* @__PURE__ */ C("td", { class: "blob-code blob-code-empty empty-cell" }, null, -1), _s = ["data-code-marker", "innerHTML"], ms = /* @__PURE__ */ ye({
|
|
4210
4225
|
__name: "SplitLine",
|
|
4211
4226
|
props: {
|
|
4212
4227
|
splitLine: null
|
|
4213
4228
|
},
|
|
4214
4229
|
setup(e) {
|
|
4215
|
-
const n = (t) => t ===
|
|
4216
|
-
return (t, s) => e.splitLine.fold ? (
|
|
4217
|
-
(
|
|
4218
|
-
|
|
4230
|
+
const n = (t) => t === d.DELETE ? "-" : t === d.ADD ? "+" : "";
|
|
4231
|
+
return (t, s) => e.splitLine.fold ? (H(), K("tr", fs, ps)) : (H(), K("tr", hs, [
|
|
4232
|
+
(H(!0), K(ue, null, He([e.splitLine.left, e.splitLine.right], (o) => (H(), K(ue, null, [
|
|
4233
|
+
o.type === B(d).EMPTY ? (H(), K(ue, { key: 0 }, [
|
|
4219
4234
|
bs,
|
|
4220
|
-
|
|
4221
|
-
], 64)) : (
|
|
4222
|
-
|
|
4223
|
-
class:
|
|
4224
|
-
"blob-num-deletion":
|
|
4225
|
-
"blob-num-addition":
|
|
4226
|
-
"blob-num-context":
|
|
4235
|
+
Es
|
|
4236
|
+
], 64)) : (H(), K(ue, { key: 1 }, [
|
|
4237
|
+
C("td", {
|
|
4238
|
+
class: he(["blob-num", {
|
|
4239
|
+
"blob-num-deletion": o.type === B(d).DELETE,
|
|
4240
|
+
"blob-num-addition": o.type === B(d).ADD,
|
|
4241
|
+
"blob-num-context": o.type === B(d).EQUAL
|
|
4227
4242
|
}])
|
|
4228
|
-
},
|
|
4229
|
-
|
|
4230
|
-
class:
|
|
4231
|
-
"blob-code-deletion":
|
|
4232
|
-
"blob-code-addition":
|
|
4233
|
-
"blob-code-context":
|
|
4243
|
+
}, fe(o.num), 3),
|
|
4244
|
+
C("td", {
|
|
4245
|
+
class: he(["blob-code", {
|
|
4246
|
+
"blob-code-deletion": o.type === B(d).DELETE,
|
|
4247
|
+
"blob-code-addition": o.type === B(d).ADD,
|
|
4248
|
+
"blob-code-context": o.type === B(d).EQUAL
|
|
4234
4249
|
}])
|
|
4235
4250
|
}, [
|
|
4236
|
-
|
|
4251
|
+
C("span", {
|
|
4237
4252
|
class: "blob-code-inner blob-code-marker",
|
|
4238
|
-
"data-code-marker": n(
|
|
4239
|
-
innerHTML:
|
|
4240
|
-
}, null, 8,
|
|
4253
|
+
"data-code-marker": n(o.type),
|
|
4254
|
+
innerHTML: o.code
|
|
4255
|
+
}, null, 8, _s)
|
|
4241
4256
|
], 2)
|
|
4242
4257
|
], 64))
|
|
4243
4258
|
], 64))), 256))
|
|
4244
4259
|
]));
|
|
4245
4260
|
}
|
|
4246
|
-
}),
|
|
4247
|
-
/* @__PURE__ */
|
|
4248
|
-
/* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4251
|
-
], -1),
|
|
4261
|
+
}), ys = { class: "file-diff-split diff-table" }, Ns = /* @__PURE__ */ C("colgroup", null, [
|
|
4262
|
+
/* @__PURE__ */ C("col", { width: "44" }),
|
|
4263
|
+
/* @__PURE__ */ C("col"),
|
|
4264
|
+
/* @__PURE__ */ C("col", { width: "44" }),
|
|
4265
|
+
/* @__PURE__ */ C("col")
|
|
4266
|
+
], -1), As = /* @__PURE__ */ ye({
|
|
4252
4267
|
__name: "SplitViewer",
|
|
4253
4268
|
props: {
|
|
4254
4269
|
diffChange: null
|
|
4255
4270
|
},
|
|
4256
4271
|
setup(e) {
|
|
4257
|
-
return (n, t) => (
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
(
|
|
4261
|
-
key:
|
|
4272
|
+
return (n, t) => (H(), K("table", ys, [
|
|
4273
|
+
Ns,
|
|
4274
|
+
C("tbody", null, [
|
|
4275
|
+
(H(!0), K(ue, null, He(e.diffChange, (s, o) => (H(), Oe(ms, {
|
|
4276
|
+
key: o,
|
|
4262
4277
|
"split-line": s
|
|
4263
4278
|
}, null, 8, ["split-line"]))), 128))
|
|
4264
4279
|
])
|
|
4265
4280
|
]));
|
|
4266
4281
|
}
|
|
4267
4282
|
});
|
|
4268
|
-
const
|
|
4283
|
+
const vs = { class: "file-header" }, Ts = { class: "file-info" }, ws = { class: "filename" }, Ss = { class: "diff-stat" }, Ms = { class: "diff-stat-added" }, Rs = {
|
|
4284
|
+
class: "diff-stat-deleted",
|
|
4285
|
+
style: { "margin-left": "8px" }
|
|
4286
|
+
}, xs = /* @__PURE__ */ ye({
|
|
4269
4287
|
__name: "CodeDiff",
|
|
4270
4288
|
props: {
|
|
4271
4289
|
newString: null,
|
|
@@ -4276,40 +4294,50 @@ const As = /* @__PURE__ */ _e({
|
|
|
4276
4294
|
outputFormat: { default: "line-by-line" },
|
|
4277
4295
|
trim: { type: Boolean, default: !1 },
|
|
4278
4296
|
noDiffLineFeed: { type: Boolean, default: !1 },
|
|
4279
|
-
maxHeight: { default: void 0 }
|
|
4297
|
+
maxHeight: { default: void 0 },
|
|
4298
|
+
filename: { default: void 0 }
|
|
4280
4299
|
},
|
|
4281
4300
|
setup(e) {
|
|
4282
|
-
const n = e, t =
|
|
4301
|
+
const n = e, t = we(() => n.outputFormat === "line-by-line"), s = we(() => {
|
|
4283
4302
|
const i = n.trim ? n.oldString.trim() : n.oldString;
|
|
4284
4303
|
return n.noDiffLineFeed ? i.replace(/(\r\n)/g, `
|
|
4285
4304
|
`) : i;
|
|
4286
|
-
}),
|
|
4305
|
+
}), o = we(() => {
|
|
4287
4306
|
const i = n.trim ? n.newString.trim() : n.newString;
|
|
4288
4307
|
return n.noDiffLineFeed ? i.replace(/(\r\n)/g, `
|
|
4289
4308
|
`) : i;
|
|
4290
|
-
}), l =
|
|
4291
|
-
() => t.value ?
|
|
4309
|
+
}), l = we(
|
|
4310
|
+
() => t.value ? es(s.value, o.value, n.language, n.diffStyle, n.context) : Jt(s.value, o.value, n.language, n.diffStyle, n.context)
|
|
4292
4311
|
);
|
|
4293
|
-
return (i, r) => (
|
|
4312
|
+
return (i, r) => (H(), K("div", {
|
|
4294
4313
|
class: "code-diff-view",
|
|
4295
|
-
style:
|
|
4314
|
+
style: In({ maxHeight: e.maxHeight })
|
|
4296
4315
|
}, [
|
|
4297
|
-
|
|
4316
|
+
C("div", vs, [
|
|
4317
|
+
C("div", Ts, [
|
|
4318
|
+
C("span", ws, fe(e.filename), 1),
|
|
4319
|
+
C("span", Ss, [
|
|
4320
|
+
C("span", Ms, "+" + fe(B(l).stat.additionsNum) + " additions", 1),
|
|
4321
|
+
C("span", Rs, "-" + fe(B(l).stat.deletionsNum) + " deletions", 1)
|
|
4322
|
+
])
|
|
4323
|
+
])
|
|
4324
|
+
]),
|
|
4325
|
+
B(t) ? (H(), Oe(us, {
|
|
4298
4326
|
key: 0,
|
|
4299
|
-
"diff-change":
|
|
4300
|
-
}, null, 8, ["diff-change"])) : (
|
|
4327
|
+
"diff-change": B(l).changes
|
|
4328
|
+
}, null, 8, ["diff-change"])) : (H(), Oe(As, {
|
|
4301
4329
|
key: 1,
|
|
4302
|
-
"diff-change":
|
|
4330
|
+
"diff-change": B(l).changes
|
|
4303
4331
|
}, null, 8, ["diff-change"]))
|
|
4304
4332
|
], 4));
|
|
4305
4333
|
}
|
|
4306
|
-
}),
|
|
4307
|
-
e.component("CodeDiff",
|
|
4308
|
-
},
|
|
4309
|
-
install:
|
|
4334
|
+
}), Os = (e) => {
|
|
4335
|
+
e.component("CodeDiff", xs);
|
|
4336
|
+
}, Ds = {
|
|
4337
|
+
install: Os,
|
|
4310
4338
|
hljs: Z
|
|
4311
4339
|
};
|
|
4312
4340
|
export {
|
|
4313
|
-
|
|
4314
|
-
|
|
4341
|
+
xs as CodeDiff,
|
|
4342
|
+
Ds as default
|
|
4315
4343
|
};
|