v-code-diff 0.3.12 → 1.0.0-alpha.1
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/LICENSE +1 -1
- package/README.md +136 -92
- package/dist/v2/index.cjs.js +9 -0
- package/dist/v2/index.es.js +4526 -0
- package/dist/v2.7/index.cjs.js +9 -0
- package/dist/v2.7/index.es.js +4337 -0
- package/dist/v3/index.cjs.js +9 -0
- package/dist/v3/index.es.js +4315 -0
- package/package.json +44 -87
- package/scripts/postinstall.js +18 -0
- package/scripts/utils.js +36 -0
- package/src/CodeDiff.vue +57 -0
- package/src/highlight.ts +23 -0
- package/src/index.ts +15 -0
- package/src/split/SplitLine.vue +66 -0
- package/src/split/SplitViewer.vue +26 -0
- package/src/style.scss +114 -0
- package/src/types.ts +29 -0
- package/src/unified/UnifiedLine.vue +62 -0
- package/src/unified/UnifiedViewer.vue +20 -0
- package/src/utils.ts +418 -0
- package/src/var.scss +439 -0
- package/types/index.d.ts +14 -0
- package/dist/index.d.ts +0 -6
- package/dist/v-code-diff/index.d.ts +0 -2
- package/dist/v-code-diff/styles/index.d.ts +0 -3
- package/dist/v-code-diff/util.d.ts +0 -21
- package/dist/v-code-diff/v-code-diff.d.ts +0 -129
- package/dist/v-code-diff.cjs.js +0 -1
- package/dist/v-code-diff.esm.js +0 -1
- package/dist/v-code-diff.umd.js +0 -1
- package/src/lib/index.ts +0 -13
- package/src/lib/v-code-diff/index.ts +0 -3
- package/src/lib/v-code-diff/styles/highlight.scss +0 -84
- package/src/lib/v-code-diff/styles/index.ts +0 -3
- package/src/lib/v-code-diff/styles/style.scss +0 -36
- package/src/lib/v-code-diff/util.ts +0 -104
- package/src/lib/v-code-diff/v-code-diff.ts +0 -104
|
@@ -0,0 +1,4526 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode(".file{--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:static}.code-diff-view .file{position:relative;margin-top:16px;margin-bottom:16px;border:1px solid var(--color-border-default, #ddd);border-radius:2px}.code-diff-view .file table{border-spacing:0}.code-diff-view .file .diff-table{width:100%}.code-diff-view .file .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 .file .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 .file .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 .file .diff-table .blob-code{position:relative;padding-right:10px;padding-left:10px;line-height:20px;vertical-align:top}.code-diff-view .file .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 .file .diff-table .blob-code-deletion{background-color:var(--color-diff-blob-deletion-line-bg);outline:1px dashed transparent}.code-diff-view .file .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 .file .diff-table .blob-code-addition{background-color:var(--color-diff-blob-addition-line-bg);outline:1px dotted transparent}.code-diff-view .file .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 .file .diff-table .blob-code-context,.code-diff-view .file .diff-table .blob-code-addition,.code-diff-view .file .diff-table .blob-code-deletion{padding-left:22px!important}.code-diff-view .file .diff-table .blob-code-marker:before{position:absolute;top:1px;left:8px;padding-right:8px;content:attr(data-code-marker)}.code-diff-view .file .file-diff-split{table-layout:fixed}.code-diff-view .file .file-diff-split .blob-code+.blob-num{border-left:1px solid var(--color-border-muted)}.code-diff-view .file .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 ke from "vue";
|
|
3
|
+
import kn, { computed as ye } from "@vue/composition-api/dist/vue-composition-api.mjs";
|
|
4
|
+
function $n(e) {
|
|
5
|
+
e = e || ke, e && !e.__composition_api_installed__ && e.use(kn);
|
|
6
|
+
}
|
|
7
|
+
$n(ke);
|
|
8
|
+
ke.version;
|
|
9
|
+
function Z() {
|
|
10
|
+
}
|
|
11
|
+
Z.prototype = {
|
|
12
|
+
diff: function(n, t) {
|
|
13
|
+
var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, l = s.callback;
|
|
14
|
+
typeof s == "function" && (l = s, s = {}), this.options = s;
|
|
15
|
+
var c = this;
|
|
16
|
+
function i(g) {
|
|
17
|
+
return l ? (setTimeout(function() {
|
|
18
|
+
l(void 0, g);
|
|
19
|
+
}, 0), !0) : g;
|
|
20
|
+
}
|
|
21
|
+
n = this.castInput(n), t = this.castInput(t), n = this.removeEmpty(this.tokenize(n)), t = this.removeEmpty(this.tokenize(t));
|
|
22
|
+
var r = t.length, a = n.length, o = 1, p = r + a;
|
|
23
|
+
s.maxEditLength && (p = Math.min(p, s.maxEditLength));
|
|
24
|
+
var _ = [{
|
|
25
|
+
newPos: -1,
|
|
26
|
+
components: []
|
|
27
|
+
}], f = this.extractCommon(_[0], t, n, 0);
|
|
28
|
+
if (_[0].newPos + 1 >= r && f + 1 >= a)
|
|
29
|
+
return i([{
|
|
30
|
+
value: this.join(t),
|
|
31
|
+
count: t.length
|
|
32
|
+
}]);
|
|
33
|
+
function N() {
|
|
34
|
+
for (var g = -1 * o; g <= o; g += 2) {
|
|
35
|
+
var A = void 0, S = _[g - 1], x = _[g + 1], y = (x ? x.newPos : 0) - g;
|
|
36
|
+
S && (_[g - 1] = void 0);
|
|
37
|
+
var R = S && S.newPos + 1 < r, L = x && 0 <= y && y < a;
|
|
38
|
+
if (!R && !L) {
|
|
39
|
+
_[g] = void 0;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (!R || L && S.newPos < x.newPos ? (A = Un(x), c.pushComponent(A.components, void 0, !0)) : (A = S, A.newPos++, c.pushComponent(A.components, !0, void 0)), y = c.extractCommon(A, t, n, g), A.newPos + 1 >= r && y + 1 >= a)
|
|
43
|
+
return i(Bn(c, A.components, t, n, c.useLongestToken));
|
|
44
|
+
_[g] = A;
|
|
45
|
+
}
|
|
46
|
+
o++;
|
|
47
|
+
}
|
|
48
|
+
if (l)
|
|
49
|
+
(function g() {
|
|
50
|
+
setTimeout(function() {
|
|
51
|
+
if (o > p)
|
|
52
|
+
return l();
|
|
53
|
+
N() || g();
|
|
54
|
+
}, 0);
|
|
55
|
+
})();
|
|
56
|
+
else
|
|
57
|
+
for (; o <= p; ) {
|
|
58
|
+
var h = N();
|
|
59
|
+
if (h)
|
|
60
|
+
return h;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
pushComponent: function(n, t, s) {
|
|
64
|
+
var l = n[n.length - 1];
|
|
65
|
+
l && l.added === t && l.removed === s ? n[n.length - 1] = {
|
|
66
|
+
count: l.count + 1,
|
|
67
|
+
added: t,
|
|
68
|
+
removed: s
|
|
69
|
+
} : n.push({
|
|
70
|
+
count: 1,
|
|
71
|
+
added: t,
|
|
72
|
+
removed: s
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
extractCommon: function(n, t, s, l) {
|
|
76
|
+
for (var c = t.length, i = s.length, r = n.newPos, a = r - l, o = 0; r + 1 < c && a + 1 < i && this.equals(t[r + 1], s[a + 1]); )
|
|
77
|
+
r++, a++, o++;
|
|
78
|
+
return o && n.components.push({
|
|
79
|
+
count: o
|
|
80
|
+
}), n.newPos = r, a;
|
|
81
|
+
},
|
|
82
|
+
equals: function(n, t) {
|
|
83
|
+
return this.options.comparator ? this.options.comparator(n, t) : n === t || this.options.ignoreCase && n.toLowerCase() === t.toLowerCase();
|
|
84
|
+
},
|
|
85
|
+
removeEmpty: function(n) {
|
|
86
|
+
for (var t = [], s = 0; s < n.length; s++)
|
|
87
|
+
n[s] && t.push(n[s]);
|
|
88
|
+
return t;
|
|
89
|
+
},
|
|
90
|
+
castInput: function(n) {
|
|
91
|
+
return n;
|
|
92
|
+
},
|
|
93
|
+
tokenize: function(n) {
|
|
94
|
+
return n.split("");
|
|
95
|
+
},
|
|
96
|
+
join: function(n) {
|
|
97
|
+
return n.join("");
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
function Bn(e, n, t, s, l) {
|
|
101
|
+
for (var c = 0, i = n.length, r = 0, a = 0; c < i; c++) {
|
|
102
|
+
var o = n[c];
|
|
103
|
+
if (o.removed) {
|
|
104
|
+
if (o.value = e.join(s.slice(a, a + o.count)), a += o.count, c && n[c - 1].added) {
|
|
105
|
+
var _ = n[c - 1];
|
|
106
|
+
n[c - 1] = n[c], n[c] = _;
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
if (!o.added && l) {
|
|
110
|
+
var p = t.slice(r, r + o.count);
|
|
111
|
+
p = p.map(function(N, h) {
|
|
112
|
+
var g = s[a + h];
|
|
113
|
+
return g.length > N.length ? g : N;
|
|
114
|
+
}), o.value = e.join(p);
|
|
115
|
+
} else
|
|
116
|
+
o.value = e.join(t.slice(r, r + o.count));
|
|
117
|
+
r += o.count, o.added || (a += o.count);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
var f = n[i - 1];
|
|
121
|
+
return i > 1 && typeof f.value == "string" && (f.added || f.removed) && e.equals("", f.value) && (n[i - 2].value += f.value, n.pop()), n;
|
|
122
|
+
}
|
|
123
|
+
function Un(e) {
|
|
124
|
+
return {
|
|
125
|
+
newPos: e.newPos,
|
|
126
|
+
components: e.components.slice(0)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
var Pn = new Z();
|
|
130
|
+
function Hn(e, n, t) {
|
|
131
|
+
return Pn.diff(e, n, t);
|
|
132
|
+
}
|
|
133
|
+
function zn(e, n) {
|
|
134
|
+
if (typeof e == "function")
|
|
135
|
+
n.callback = e;
|
|
136
|
+
else if (e)
|
|
137
|
+
for (var t in e)
|
|
138
|
+
e.hasOwnProperty(t) && (n[t] = e[t]);
|
|
139
|
+
return n;
|
|
140
|
+
}
|
|
141
|
+
var Xe = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/, Ve = /\S/, $e = new Z();
|
|
142
|
+
$e.equals = function(e, n) {
|
|
143
|
+
return this.options.ignoreCase && (e = e.toLowerCase(), n = n.toLowerCase()), e === n || this.options.ignoreWhitespace && !Ve.test(e) && !Ve.test(n);
|
|
144
|
+
};
|
|
145
|
+
$e.tokenize = function(e) {
|
|
146
|
+
for (var n = e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/), t = 0; t < n.length - 1; t++)
|
|
147
|
+
!n[t + 1] && n[t + 2] && Xe.test(n[t]) && Xe.test(n[t + 2]) && (n[t] += n[t + 2], n.splice(t + 1, 2), t--);
|
|
148
|
+
return n;
|
|
149
|
+
};
|
|
150
|
+
function Fn(e, n, t) {
|
|
151
|
+
return t = zn(t, {
|
|
152
|
+
ignoreWhitespace: !0
|
|
153
|
+
}), $e.diff(e, n, t);
|
|
154
|
+
}
|
|
155
|
+
var Be = new Z();
|
|
156
|
+
Be.tokenize = function(e) {
|
|
157
|
+
var n = [], t = e.split(/(\n|\r\n)/);
|
|
158
|
+
t[t.length - 1] || t.pop();
|
|
159
|
+
for (var s = 0; s < t.length; s++) {
|
|
160
|
+
var l = t[s];
|
|
161
|
+
s % 2 && !this.options.newlineIsToken ? n[n.length - 1] += l : (this.options.ignoreWhitespace && (l = l.trim()), n.push(l));
|
|
162
|
+
}
|
|
163
|
+
return n;
|
|
164
|
+
};
|
|
165
|
+
function gn(e, n, t) {
|
|
166
|
+
return Be.diff(e, n, t);
|
|
167
|
+
}
|
|
168
|
+
var Gn = new Z();
|
|
169
|
+
Gn.tokenize = function(e) {
|
|
170
|
+
return e.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
171
|
+
};
|
|
172
|
+
var Kn = new Z();
|
|
173
|
+
Kn.tokenize = function(e) {
|
|
174
|
+
return e.split(/([{}:;,]|\s+)/);
|
|
175
|
+
};
|
|
176
|
+
function Ae(e) {
|
|
177
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ae = function(n) {
|
|
178
|
+
return typeof n;
|
|
179
|
+
} : Ae = function(n) {
|
|
180
|
+
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
181
|
+
}, Ae(e);
|
|
182
|
+
}
|
|
183
|
+
var Wn = Object.prototype.toString, ce = new Z();
|
|
184
|
+
ce.useLongestToken = !0;
|
|
185
|
+
ce.tokenize = Be.tokenize;
|
|
186
|
+
ce.castInput = function(e) {
|
|
187
|
+
var n = this.options, t = n.undefinedReplacement, s = n.stringifyReplacer, l = s === void 0 ? function(c, i) {
|
|
188
|
+
return typeof i > "u" ? t : i;
|
|
189
|
+
} : s;
|
|
190
|
+
return typeof e == "string" ? e : JSON.stringify(Ce(e, null, null, l), l, " ");
|
|
191
|
+
};
|
|
192
|
+
ce.equals = function(e, n) {
|
|
193
|
+
return Z.prototype.equals.call(ce, e.replace(/,([\r\n])/g, "$1"), n.replace(/,([\r\n])/g, "$1"));
|
|
194
|
+
};
|
|
195
|
+
function Ce(e, n, t, s, l) {
|
|
196
|
+
n = n || [], t = t || [], s && (e = s(l, e));
|
|
197
|
+
var c;
|
|
198
|
+
for (c = 0; c < n.length; c += 1)
|
|
199
|
+
if (n[c] === e)
|
|
200
|
+
return t[c];
|
|
201
|
+
var i;
|
|
202
|
+
if (Wn.call(e) === "[object Array]") {
|
|
203
|
+
for (n.push(e), i = new Array(e.length), t.push(i), c = 0; c < e.length; c += 1)
|
|
204
|
+
i[c] = Ce(e[c], n, t, s, l);
|
|
205
|
+
return n.pop(), t.pop(), i;
|
|
206
|
+
}
|
|
207
|
+
if (e && e.toJSON && (e = e.toJSON()), Ae(e) === "object" && e !== null) {
|
|
208
|
+
n.push(e), i = {}, t.push(i);
|
|
209
|
+
var r = [], a;
|
|
210
|
+
for (a in e)
|
|
211
|
+
e.hasOwnProperty(a) && r.push(a);
|
|
212
|
+
for (r.sort(), c = 0; c < r.length; c += 1)
|
|
213
|
+
a = r[c], i[a] = Ce(e[a], n, t, s, a);
|
|
214
|
+
n.pop(), t.pop();
|
|
215
|
+
} else
|
|
216
|
+
i = e;
|
|
217
|
+
return i;
|
|
218
|
+
}
|
|
219
|
+
var Ie = new Z();
|
|
220
|
+
Ie.tokenize = function(e) {
|
|
221
|
+
return e.slice();
|
|
222
|
+
};
|
|
223
|
+
Ie.join = Ie.removeEmpty = function(e) {
|
|
224
|
+
return e;
|
|
225
|
+
};
|
|
226
|
+
var Ue = { exports: {} };
|
|
227
|
+
function Pe(e) {
|
|
228
|
+
return e instanceof Map ? e.clear = e.delete = e.set = function() {
|
|
229
|
+
throw new Error("map is read-only");
|
|
230
|
+
} : e instanceof Set && (e.add = e.clear = e.delete = function() {
|
|
231
|
+
throw new Error("set is read-only");
|
|
232
|
+
}), Object.freeze(e), Object.getOwnPropertyNames(e).forEach(function(n) {
|
|
233
|
+
var t = e[n];
|
|
234
|
+
typeof t == "object" && !Object.isFrozen(t) && Pe(t);
|
|
235
|
+
}), e;
|
|
236
|
+
}
|
|
237
|
+
Ue.exports = Pe;
|
|
238
|
+
Ue.exports.default = Pe;
|
|
239
|
+
class je {
|
|
240
|
+
/**
|
|
241
|
+
* @param {CompiledMode} mode
|
|
242
|
+
*/
|
|
243
|
+
constructor(n) {
|
|
244
|
+
n.data === void 0 && (n.data = {}), this.data = n.data, this.isMatchIgnored = !1;
|
|
245
|
+
}
|
|
246
|
+
ignoreMatch() {
|
|
247
|
+
this.isMatchIgnored = !0;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function pn(e) {
|
|
251
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
252
|
+
}
|
|
253
|
+
function V(e, ...n) {
|
|
254
|
+
const t = /* @__PURE__ */ Object.create(null);
|
|
255
|
+
for (const s in e)
|
|
256
|
+
t[s] = e[s];
|
|
257
|
+
return n.forEach(function(s) {
|
|
258
|
+
for (const l in s)
|
|
259
|
+
t[l] = s[l];
|
|
260
|
+
}), /** @type {T} */
|
|
261
|
+
t;
|
|
262
|
+
}
|
|
263
|
+
const qn = "</span>", Je = (e) => !!e.scope || e.sublanguage && e.language, Yn = (e, { prefix: n }) => {
|
|
264
|
+
if (e.includes(".")) {
|
|
265
|
+
const t = e.split(".");
|
|
266
|
+
return [
|
|
267
|
+
`${n}${t.shift()}`,
|
|
268
|
+
...t.map((s, l) => `${s}${"_".repeat(l + 1)}`)
|
|
269
|
+
].join(" ");
|
|
270
|
+
}
|
|
271
|
+
return `${n}${e}`;
|
|
272
|
+
};
|
|
273
|
+
class Zn {
|
|
274
|
+
/**
|
|
275
|
+
* Creates a new HTMLRenderer
|
|
276
|
+
*
|
|
277
|
+
* @param {Tree} parseTree - the parse tree (must support `walk` API)
|
|
278
|
+
* @param {{classPrefix: string}} options
|
|
279
|
+
*/
|
|
280
|
+
constructor(n, t) {
|
|
281
|
+
this.buffer = "", this.classPrefix = t.classPrefix, n.walk(this);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Adds texts to the output stream
|
|
285
|
+
*
|
|
286
|
+
* @param {string} text */
|
|
287
|
+
addText(n) {
|
|
288
|
+
this.buffer += pn(n);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Adds a node open to the output stream (if needed)
|
|
292
|
+
*
|
|
293
|
+
* @param {Node} node */
|
|
294
|
+
openNode(n) {
|
|
295
|
+
if (!Je(n))
|
|
296
|
+
return;
|
|
297
|
+
let t = "";
|
|
298
|
+
n.sublanguage ? t = `language-${n.language}` : t = Yn(n.scope, { prefix: this.classPrefix }), this.span(t);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Adds a node close to the output stream (if needed)
|
|
302
|
+
*
|
|
303
|
+
* @param {Node} node */
|
|
304
|
+
closeNode(n) {
|
|
305
|
+
Je(n) && (this.buffer += qn);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* returns the accumulated buffer
|
|
309
|
+
*/
|
|
310
|
+
value() {
|
|
311
|
+
return this.buffer;
|
|
312
|
+
}
|
|
313
|
+
// helpers
|
|
314
|
+
/**
|
|
315
|
+
* Builds a span element
|
|
316
|
+
*
|
|
317
|
+
* @param {string} className */
|
|
318
|
+
span(n) {
|
|
319
|
+
this.buffer += `<span class="${n}">`;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const en = (e = {}) => {
|
|
323
|
+
const n = { children: [] };
|
|
324
|
+
return Object.assign(n, e), n;
|
|
325
|
+
};
|
|
326
|
+
class He {
|
|
327
|
+
constructor() {
|
|
328
|
+
this.rootNode = en(), this.stack = [this.rootNode];
|
|
329
|
+
}
|
|
330
|
+
get top() {
|
|
331
|
+
return this.stack[this.stack.length - 1];
|
|
332
|
+
}
|
|
333
|
+
get root() {
|
|
334
|
+
return this.rootNode;
|
|
335
|
+
}
|
|
336
|
+
/** @param {Node} node */
|
|
337
|
+
add(n) {
|
|
338
|
+
this.top.children.push(n);
|
|
339
|
+
}
|
|
340
|
+
/** @param {string} scope */
|
|
341
|
+
openNode(n) {
|
|
342
|
+
const t = en({ scope: n });
|
|
343
|
+
this.add(t), this.stack.push(t);
|
|
344
|
+
}
|
|
345
|
+
closeNode() {
|
|
346
|
+
if (this.stack.length > 1)
|
|
347
|
+
return this.stack.pop();
|
|
348
|
+
}
|
|
349
|
+
closeAllNodes() {
|
|
350
|
+
for (; this.closeNode(); )
|
|
351
|
+
;
|
|
352
|
+
}
|
|
353
|
+
toJSON() {
|
|
354
|
+
return JSON.stringify(this.rootNode, null, 4);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* @typedef { import("./html_renderer").Renderer } Renderer
|
|
358
|
+
* @param {Renderer} builder
|
|
359
|
+
*/
|
|
360
|
+
walk(n) {
|
|
361
|
+
return this.constructor._walk(n, this.rootNode);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* @param {Renderer} builder
|
|
365
|
+
* @param {Node} node
|
|
366
|
+
*/
|
|
367
|
+
static _walk(n, t) {
|
|
368
|
+
return typeof t == "string" ? n.addText(t) : t.children && (n.openNode(t), t.children.forEach((s) => this._walk(n, s)), n.closeNode(t)), n;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* @param {Node} node
|
|
372
|
+
*/
|
|
373
|
+
static _collapse(n) {
|
|
374
|
+
typeof n != "string" && n.children && (n.children.every((t) => typeof t == "string") ? n.children = [n.children.join("")] : n.children.forEach((t) => {
|
|
375
|
+
He._collapse(t);
|
|
376
|
+
}));
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
class Qn extends He {
|
|
380
|
+
/**
|
|
381
|
+
* @param {*} options
|
|
382
|
+
*/
|
|
383
|
+
constructor(n) {
|
|
384
|
+
super(), this.options = n;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* @param {string} text
|
|
388
|
+
* @param {string} scope
|
|
389
|
+
*/
|
|
390
|
+
addKeyword(n, t) {
|
|
391
|
+
n !== "" && (this.openNode(t), this.addText(n), this.closeNode());
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @param {string} text
|
|
395
|
+
*/
|
|
396
|
+
addText(n) {
|
|
397
|
+
n !== "" && this.add(n);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @param {Emitter & {root: DataNode}} emitter
|
|
401
|
+
* @param {string} name
|
|
402
|
+
*/
|
|
403
|
+
addSublanguage(n, t) {
|
|
404
|
+
const s = n.root;
|
|
405
|
+
s.sublanguage = !0, s.language = t, this.add(s);
|
|
406
|
+
}
|
|
407
|
+
toHTML() {
|
|
408
|
+
return new Zn(this, this.options).value();
|
|
409
|
+
}
|
|
410
|
+
finalize() {
|
|
411
|
+
return !0;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
function le(e) {
|
|
415
|
+
return e ? typeof e == "string" ? e : e.source : null;
|
|
416
|
+
}
|
|
417
|
+
function _n(e) {
|
|
418
|
+
return ee("(?=", e, ")");
|
|
419
|
+
}
|
|
420
|
+
function Xn(e) {
|
|
421
|
+
return ee("(?:", e, ")*");
|
|
422
|
+
}
|
|
423
|
+
function Vn(e) {
|
|
424
|
+
return ee("(?:", e, ")?");
|
|
425
|
+
}
|
|
426
|
+
function ee(...e) {
|
|
427
|
+
return e.map((t) => le(t)).join("");
|
|
428
|
+
}
|
|
429
|
+
function jn(e) {
|
|
430
|
+
const n = e[e.length - 1];
|
|
431
|
+
return typeof n == "object" && n.constructor === Object ? (e.splice(e.length - 1, 1), n) : {};
|
|
432
|
+
}
|
|
433
|
+
function ze(...e) {
|
|
434
|
+
return "(" + (jn(e).capture ? "" : "?:") + e.map((s) => le(s)).join("|") + ")";
|
|
435
|
+
}
|
|
436
|
+
function bn(e) {
|
|
437
|
+
return new RegExp(e.toString() + "|").exec("").length - 1;
|
|
438
|
+
}
|
|
439
|
+
function Jn(e, n) {
|
|
440
|
+
const t = e && e.exec(n);
|
|
441
|
+
return t && t.index === 0;
|
|
442
|
+
}
|
|
443
|
+
const et = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
444
|
+
function Fe(e, { joinWith: n }) {
|
|
445
|
+
let t = 0;
|
|
446
|
+
return e.map((s) => {
|
|
447
|
+
t += 1;
|
|
448
|
+
const l = t;
|
|
449
|
+
let c = le(s), i = "";
|
|
450
|
+
for (; c.length > 0; ) {
|
|
451
|
+
const r = et.exec(c);
|
|
452
|
+
if (!r) {
|
|
453
|
+
i += c;
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
i += c.substring(0, r.index), c = c.substring(r.index + r[0].length), r[0][0] === "\\" && r[1] ? i += "\\" + String(Number(r[1]) + l) : (i += r[0], r[0] === "(" && t++);
|
|
457
|
+
}
|
|
458
|
+
return i;
|
|
459
|
+
}).map((s) => `(${s})`).join(n);
|
|
460
|
+
}
|
|
461
|
+
const nt = /\b\B/, hn = "[a-zA-Z]\\w*", Ge = "[a-zA-Z_]\\w*", En = "\\b\\d+(\\.\\d+)?", mn = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", yn = "\\b(0b[01]+)", tt = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", st = (e = {}) => {
|
|
462
|
+
const n = /^#![ ]*\//;
|
|
463
|
+
return e.binary && (e.begin = ee(
|
|
464
|
+
n,
|
|
465
|
+
/.*\b/,
|
|
466
|
+
e.binary,
|
|
467
|
+
/\b.*/
|
|
468
|
+
)), V({
|
|
469
|
+
scope: "meta",
|
|
470
|
+
begin: n,
|
|
471
|
+
end: /$/,
|
|
472
|
+
relevance: 0,
|
|
473
|
+
/** @type {ModeCallback} */
|
|
474
|
+
"on:begin": (t, s) => {
|
|
475
|
+
t.index !== 0 && s.ignoreMatch();
|
|
476
|
+
}
|
|
477
|
+
}, e);
|
|
478
|
+
}, ue = {
|
|
479
|
+
begin: "\\\\[\\s\\S]",
|
|
480
|
+
relevance: 0
|
|
481
|
+
}, rt = {
|
|
482
|
+
scope: "string",
|
|
483
|
+
begin: "'",
|
|
484
|
+
end: "'",
|
|
485
|
+
illegal: "\\n",
|
|
486
|
+
contains: [ue]
|
|
487
|
+
}, it = {
|
|
488
|
+
scope: "string",
|
|
489
|
+
begin: '"',
|
|
490
|
+
end: '"',
|
|
491
|
+
illegal: "\\n",
|
|
492
|
+
contains: [ue]
|
|
493
|
+
}, at = {
|
|
494
|
+
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/
|
|
495
|
+
}, Me = function(e, n, t = {}) {
|
|
496
|
+
const s = V(
|
|
497
|
+
{
|
|
498
|
+
scope: "comment",
|
|
499
|
+
begin: e,
|
|
500
|
+
end: n,
|
|
501
|
+
contains: []
|
|
502
|
+
},
|
|
503
|
+
t
|
|
504
|
+
);
|
|
505
|
+
s.contains.push({
|
|
506
|
+
scope: "doctag",
|
|
507
|
+
// hack to avoid the space from being included. the space is necessary to
|
|
508
|
+
// match here to prevent the plain text rule below from gobbling up doctags
|
|
509
|
+
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
|
|
510
|
+
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
|
|
511
|
+
excludeBegin: !0,
|
|
512
|
+
relevance: 0
|
|
513
|
+
});
|
|
514
|
+
const l = ze(
|
|
515
|
+
// list of common 1 and 2 letter words in English
|
|
516
|
+
"I",
|
|
517
|
+
"a",
|
|
518
|
+
"is",
|
|
519
|
+
"so",
|
|
520
|
+
"us",
|
|
521
|
+
"to",
|
|
522
|
+
"at",
|
|
523
|
+
"if",
|
|
524
|
+
"in",
|
|
525
|
+
"it",
|
|
526
|
+
"on",
|
|
527
|
+
// note: this is not an exhaustive list of contractions, just popular ones
|
|
528
|
+
/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
|
|
529
|
+
// contractions - can't we'd they're let's, etc
|
|
530
|
+
/[A-Za-z]+[-][a-z]+/,
|
|
531
|
+
// `no-way`, etc.
|
|
532
|
+
/[A-Za-z][a-z]{2,}/
|
|
533
|
+
// allow capitalized words at beginning of sentences
|
|
534
|
+
);
|
|
535
|
+
return s.contains.push(
|
|
536
|
+
{
|
|
537
|
+
// TODO: how to include ", (, ) without breaking grammars that use these for
|
|
538
|
+
// comment delimiters?
|
|
539
|
+
// begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
|
|
540
|
+
// ---
|
|
541
|
+
// this tries to find sequences of 3 english words in a row (without any
|
|
542
|
+
// "programming" type syntax) this gives us a strong signal that we've
|
|
543
|
+
// TRULY found a comment - vs perhaps scanning with the wrong language.
|
|
544
|
+
// It's possible to find something that LOOKS like the start of the
|
|
545
|
+
// comment - but then if there is no readable text - good chance it is a
|
|
546
|
+
// false match and not a comment.
|
|
547
|
+
//
|
|
548
|
+
// for a visual example please see:
|
|
549
|
+
// https://github.com/highlightjs/highlight.js/issues/2827
|
|
550
|
+
begin: ee(
|
|
551
|
+
/[ ]+/,
|
|
552
|
+
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
553
|
+
"(",
|
|
554
|
+
l,
|
|
555
|
+
/[.]?[:]?([.][ ]|[ ])/,
|
|
556
|
+
"){3}"
|
|
557
|
+
)
|
|
558
|
+
// look for 3 words in a row
|
|
559
|
+
}
|
|
560
|
+
), s;
|
|
561
|
+
}, ot = Me("//", "$"), ct = Me("/\\*", "\\*/"), lt = Me("#", "$"), ut = {
|
|
562
|
+
scope: "number",
|
|
563
|
+
begin: En,
|
|
564
|
+
relevance: 0
|
|
565
|
+
}, ft = {
|
|
566
|
+
scope: "number",
|
|
567
|
+
begin: mn,
|
|
568
|
+
relevance: 0
|
|
569
|
+
}, dt = {
|
|
570
|
+
scope: "number",
|
|
571
|
+
begin: yn,
|
|
572
|
+
relevance: 0
|
|
573
|
+
}, gt = {
|
|
574
|
+
// this outer rule makes sure we actually have a WHOLE regex and not simply
|
|
575
|
+
// an expression such as:
|
|
576
|
+
//
|
|
577
|
+
// 3 / something
|
|
578
|
+
//
|
|
579
|
+
// (which will then blow up when regex's `illegal` sees the newline)
|
|
580
|
+
begin: /(?=\/[^/\n]*\/)/,
|
|
581
|
+
contains: [{
|
|
582
|
+
scope: "regexp",
|
|
583
|
+
begin: /\//,
|
|
584
|
+
end: /\/[gimuy]*/,
|
|
585
|
+
illegal: /\n/,
|
|
586
|
+
contains: [
|
|
587
|
+
ue,
|
|
588
|
+
{
|
|
589
|
+
begin: /\[/,
|
|
590
|
+
end: /\]/,
|
|
591
|
+
relevance: 0,
|
|
592
|
+
contains: [ue]
|
|
593
|
+
}
|
|
594
|
+
]
|
|
595
|
+
}]
|
|
596
|
+
}, pt = {
|
|
597
|
+
scope: "title",
|
|
598
|
+
begin: hn,
|
|
599
|
+
relevance: 0
|
|
600
|
+
}, _t = {
|
|
601
|
+
scope: "title",
|
|
602
|
+
begin: Ge,
|
|
603
|
+
relevance: 0
|
|
604
|
+
}, bt = {
|
|
605
|
+
// excludes method names from keyword processing
|
|
606
|
+
begin: "\\.\\s*" + Ge,
|
|
607
|
+
relevance: 0
|
|
608
|
+
}, ht = function(e) {
|
|
609
|
+
return Object.assign(
|
|
610
|
+
e,
|
|
611
|
+
{
|
|
612
|
+
/** @type {ModeCallback} */
|
|
613
|
+
"on:begin": (n, t) => {
|
|
614
|
+
t.data._beginMatch = n[1];
|
|
615
|
+
},
|
|
616
|
+
/** @type {ModeCallback} */
|
|
617
|
+
"on:end": (n, t) => {
|
|
618
|
+
t.data._beginMatch !== n[1] && t.ignoreMatch();
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
);
|
|
622
|
+
};
|
|
623
|
+
var ve = /* @__PURE__ */ Object.freeze({
|
|
624
|
+
__proto__: null,
|
|
625
|
+
MATCH_NOTHING_RE: nt,
|
|
626
|
+
IDENT_RE: hn,
|
|
627
|
+
UNDERSCORE_IDENT_RE: Ge,
|
|
628
|
+
NUMBER_RE: En,
|
|
629
|
+
C_NUMBER_RE: mn,
|
|
630
|
+
BINARY_NUMBER_RE: yn,
|
|
631
|
+
RE_STARTERS_RE: tt,
|
|
632
|
+
SHEBANG: st,
|
|
633
|
+
BACKSLASH_ESCAPE: ue,
|
|
634
|
+
APOS_STRING_MODE: rt,
|
|
635
|
+
QUOTE_STRING_MODE: it,
|
|
636
|
+
PHRASAL_WORDS_MODE: at,
|
|
637
|
+
COMMENT: Me,
|
|
638
|
+
C_LINE_COMMENT_MODE: ot,
|
|
639
|
+
C_BLOCK_COMMENT_MODE: ct,
|
|
640
|
+
HASH_COMMENT_MODE: lt,
|
|
641
|
+
NUMBER_MODE: ut,
|
|
642
|
+
C_NUMBER_MODE: ft,
|
|
643
|
+
BINARY_NUMBER_MODE: dt,
|
|
644
|
+
REGEXP_MODE: gt,
|
|
645
|
+
TITLE_MODE: pt,
|
|
646
|
+
UNDERSCORE_TITLE_MODE: _t,
|
|
647
|
+
METHOD_GUARD: bt,
|
|
648
|
+
END_SAME_AS_BEGIN: ht
|
|
649
|
+
});
|
|
650
|
+
function Et(e, n) {
|
|
651
|
+
e.input[e.index - 1] === "." && n.ignoreMatch();
|
|
652
|
+
}
|
|
653
|
+
function mt(e, n) {
|
|
654
|
+
e.className !== void 0 && (e.scope = e.className, delete e.className);
|
|
655
|
+
}
|
|
656
|
+
function yt(e, n) {
|
|
657
|
+
n && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = Et, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
|
|
658
|
+
}
|
|
659
|
+
function vt(e, n) {
|
|
660
|
+
Array.isArray(e.illegal) && (e.illegal = ze(...e.illegal));
|
|
661
|
+
}
|
|
662
|
+
function Nt(e, n) {
|
|
663
|
+
if (e.match) {
|
|
664
|
+
if (e.begin || e.end)
|
|
665
|
+
throw new Error("begin & end are not supported with match");
|
|
666
|
+
e.begin = e.match, delete e.match;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
function Tt(e, n) {
|
|
670
|
+
e.relevance === void 0 && (e.relevance = 1);
|
|
671
|
+
}
|
|
672
|
+
const At = (e, n) => {
|
|
673
|
+
if (!e.beforeMatch)
|
|
674
|
+
return;
|
|
675
|
+
if (e.starts)
|
|
676
|
+
throw new Error("beforeMatch cannot be used with starts");
|
|
677
|
+
const t = Object.assign({}, e);
|
|
678
|
+
Object.keys(e).forEach((s) => {
|
|
679
|
+
delete e[s];
|
|
680
|
+
}), e.keywords = t.keywords, e.begin = ee(t.beforeMatch, _n(t.begin)), e.starts = {
|
|
681
|
+
relevance: 0,
|
|
682
|
+
contains: [
|
|
683
|
+
Object.assign(t, { endsParent: !0 })
|
|
684
|
+
]
|
|
685
|
+
}, e.relevance = 0, delete t.beforeMatch;
|
|
686
|
+
}, wt = [
|
|
687
|
+
"of",
|
|
688
|
+
"and",
|
|
689
|
+
"for",
|
|
690
|
+
"in",
|
|
691
|
+
"not",
|
|
692
|
+
"or",
|
|
693
|
+
"if",
|
|
694
|
+
"then",
|
|
695
|
+
"parent",
|
|
696
|
+
// common variable name
|
|
697
|
+
"list",
|
|
698
|
+
// common variable name
|
|
699
|
+
"value"
|
|
700
|
+
// common variable name
|
|
701
|
+
], St = "keyword";
|
|
702
|
+
function vn(e, n, t = St) {
|
|
703
|
+
const s = /* @__PURE__ */ Object.create(null);
|
|
704
|
+
return typeof e == "string" ? l(t, e.split(" ")) : Array.isArray(e) ? l(t, e) : Object.keys(e).forEach(function(c) {
|
|
705
|
+
Object.assign(
|
|
706
|
+
s,
|
|
707
|
+
vn(e[c], n, c)
|
|
708
|
+
);
|
|
709
|
+
}), s;
|
|
710
|
+
function l(c, i) {
|
|
711
|
+
n && (i = i.map((r) => r.toLowerCase())), i.forEach(function(r) {
|
|
712
|
+
const a = r.split("|");
|
|
713
|
+
s[a[0]] = [c, Mt(a[0], a[1])];
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
function Mt(e, n) {
|
|
718
|
+
return n ? Number(n) : Rt(e) ? 0 : 1;
|
|
719
|
+
}
|
|
720
|
+
function Rt(e) {
|
|
721
|
+
return wt.includes(e.toLowerCase());
|
|
722
|
+
}
|
|
723
|
+
const nn = {}, J = (e) => {
|
|
724
|
+
console.error(e);
|
|
725
|
+
}, tn = (e, ...n) => {
|
|
726
|
+
console.log(`WARN: ${e}`, ...n);
|
|
727
|
+
}, re = (e, n) => {
|
|
728
|
+
nn[`${e}/${n}`] || (console.log(`Deprecated as of ${e}. ${n}`), nn[`${e}/${n}`] = !0);
|
|
729
|
+
}, we = new Error();
|
|
730
|
+
function Nn(e, n, { key: t }) {
|
|
731
|
+
let s = 0;
|
|
732
|
+
const l = e[t], c = {}, i = {};
|
|
733
|
+
for (let r = 1; r <= n.length; r++)
|
|
734
|
+
i[r + s] = l[r], c[r + s] = !0, s += bn(n[r - 1]);
|
|
735
|
+
e[t] = i, e[t]._emit = c, e[t]._multi = !0;
|
|
736
|
+
}
|
|
737
|
+
function Ot(e) {
|
|
738
|
+
if (Array.isArray(e.begin)) {
|
|
739
|
+
if (e.skip || e.excludeBegin || e.returnBegin)
|
|
740
|
+
throw J("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), we;
|
|
741
|
+
if (typeof e.beginScope != "object" || e.beginScope === null)
|
|
742
|
+
throw J("beginScope must be object"), we;
|
|
743
|
+
Nn(e, e.begin, { key: "beginScope" }), e.begin = Fe(e.begin, { joinWith: "" });
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
function xt(e) {
|
|
747
|
+
if (Array.isArray(e.end)) {
|
|
748
|
+
if (e.skip || e.excludeEnd || e.returnEnd)
|
|
749
|
+
throw J("skip, excludeEnd, returnEnd not compatible with endScope: {}"), we;
|
|
750
|
+
if (typeof e.endScope != "object" || e.endScope === null)
|
|
751
|
+
throw J("endScope must be object"), we;
|
|
752
|
+
Nn(e, e.end, { key: "endScope" }), e.end = Fe(e.end, { joinWith: "" });
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
function Lt(e) {
|
|
756
|
+
e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
|
|
757
|
+
}
|
|
758
|
+
function Dt(e) {
|
|
759
|
+
Lt(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), Ot(e), xt(e);
|
|
760
|
+
}
|
|
761
|
+
function Ct(e) {
|
|
762
|
+
function n(i, r) {
|
|
763
|
+
return new RegExp(
|
|
764
|
+
le(i),
|
|
765
|
+
"m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (r ? "g" : "")
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
class t {
|
|
769
|
+
constructor() {
|
|
770
|
+
this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
|
|
771
|
+
}
|
|
772
|
+
// @ts-ignore
|
|
773
|
+
addRule(r, a) {
|
|
774
|
+
a.position = this.position++, this.matchIndexes[this.matchAt] = a, this.regexes.push([a, r]), this.matchAt += bn(r) + 1;
|
|
775
|
+
}
|
|
776
|
+
compile() {
|
|
777
|
+
this.regexes.length === 0 && (this.exec = () => null);
|
|
778
|
+
const r = this.regexes.map((a) => a[1]);
|
|
779
|
+
this.matcherRe = n(Fe(r, { joinWith: "|" }), !0), this.lastIndex = 0;
|
|
780
|
+
}
|
|
781
|
+
/** @param {string} s */
|
|
782
|
+
exec(r) {
|
|
783
|
+
this.matcherRe.lastIndex = this.lastIndex;
|
|
784
|
+
const a = this.matcherRe.exec(r);
|
|
785
|
+
if (!a)
|
|
786
|
+
return null;
|
|
787
|
+
const o = a.findIndex((_, f) => f > 0 && _ !== void 0), p = this.matchIndexes[o];
|
|
788
|
+
return a.splice(0, o), Object.assign(a, p);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
class s {
|
|
792
|
+
constructor() {
|
|
793
|
+
this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
|
|
794
|
+
}
|
|
795
|
+
// @ts-ignore
|
|
796
|
+
getMatcher(r) {
|
|
797
|
+
if (this.multiRegexes[r])
|
|
798
|
+
return this.multiRegexes[r];
|
|
799
|
+
const a = new t();
|
|
800
|
+
return this.rules.slice(r).forEach(([o, p]) => a.addRule(o, p)), a.compile(), this.multiRegexes[r] = a, a;
|
|
801
|
+
}
|
|
802
|
+
resumingScanAtSamePosition() {
|
|
803
|
+
return this.regexIndex !== 0;
|
|
804
|
+
}
|
|
805
|
+
considerAll() {
|
|
806
|
+
this.regexIndex = 0;
|
|
807
|
+
}
|
|
808
|
+
// @ts-ignore
|
|
809
|
+
addRule(r, a) {
|
|
810
|
+
this.rules.push([r, a]), a.type === "begin" && this.count++;
|
|
811
|
+
}
|
|
812
|
+
/** @param {string} s */
|
|
813
|
+
exec(r) {
|
|
814
|
+
const a = this.getMatcher(this.regexIndex);
|
|
815
|
+
a.lastIndex = this.lastIndex;
|
|
816
|
+
let o = a.exec(r);
|
|
817
|
+
if (this.resumingScanAtSamePosition() && !(o && o.index === this.lastIndex)) {
|
|
818
|
+
const p = this.getMatcher(0);
|
|
819
|
+
p.lastIndex = this.lastIndex + 1, o = p.exec(r);
|
|
820
|
+
}
|
|
821
|
+
return o && (this.regexIndex += o.position + 1, this.regexIndex === this.count && this.considerAll()), o;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
function l(i) {
|
|
825
|
+
const r = new s();
|
|
826
|
+
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;
|
|
827
|
+
}
|
|
828
|
+
function c(i, r) {
|
|
829
|
+
const a = (
|
|
830
|
+
/** @type CompiledMode */
|
|
831
|
+
i
|
|
832
|
+
);
|
|
833
|
+
if (i.isCompiled)
|
|
834
|
+
return a;
|
|
835
|
+
[
|
|
836
|
+
mt,
|
|
837
|
+
// do this early so compiler extensions generally don't have to worry about
|
|
838
|
+
// the distinction between match/begin
|
|
839
|
+
Nt,
|
|
840
|
+
Dt,
|
|
841
|
+
At
|
|
842
|
+
].forEach((p) => p(i, r)), e.compilerExtensions.forEach((p) => p(i, r)), i.__beforeBegin = null, [
|
|
843
|
+
yt,
|
|
844
|
+
// do this later so compiler extensions that come earlier have access to the
|
|
845
|
+
// raw array if they wanted to perhaps manipulate it, etc.
|
|
846
|
+
vt,
|
|
847
|
+
// default to 1 relevance if not specified
|
|
848
|
+
Tt
|
|
849
|
+
].forEach((p) => p(i, r)), i.isCompiled = !0;
|
|
850
|
+
let o = null;
|
|
851
|
+
return typeof i.keywords == "object" && i.keywords.$pattern && (i.keywords = Object.assign({}, i.keywords), o = i.keywords.$pattern, delete i.keywords.$pattern), o = o || /\w+/, i.keywords && (i.keywords = vn(i.keywords, e.case_insensitive)), a.keywordPatternRe = n(o, !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 = le(a.end) || "", i.endsWithParent && r.terminatorEnd && (a.terminatorEnd += (i.end ? "|" : "") + r.terminatorEnd)), i.illegal && (a.illegalRe = n(
|
|
852
|
+
/** @type {RegExp | string} */
|
|
853
|
+
i.illegal
|
|
854
|
+
)), i.contains || (i.contains = []), i.contains = [].concat(...i.contains.map(function(p) {
|
|
855
|
+
return It(p === "self" ? i : p);
|
|
856
|
+
})), i.contains.forEach(function(p) {
|
|
857
|
+
c(
|
|
858
|
+
/** @type Mode */
|
|
859
|
+
p,
|
|
860
|
+
a
|
|
861
|
+
);
|
|
862
|
+
}), i.starts && c(i.starts, r), a.matcher = l(a), a;
|
|
863
|
+
}
|
|
864
|
+
if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self"))
|
|
865
|
+
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
866
|
+
return e.classNameAliases = V(e.classNameAliases || {}), c(
|
|
867
|
+
/** @type Mode */
|
|
868
|
+
e
|
|
869
|
+
);
|
|
870
|
+
}
|
|
871
|
+
function Tn(e) {
|
|
872
|
+
return e ? e.endsWithParent || Tn(e.starts) : !1;
|
|
873
|
+
}
|
|
874
|
+
function It(e) {
|
|
875
|
+
return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(n) {
|
|
876
|
+
return V(e, { variants: null }, n);
|
|
877
|
+
})), e.cachedVariants ? e.cachedVariants : Tn(e) ? V(e, { starts: e.starts ? V(e.starts) : null }) : Object.isFrozen(e) ? V(e) : e;
|
|
878
|
+
}
|
|
879
|
+
var kt = "11.7.0";
|
|
880
|
+
class $t extends Error {
|
|
881
|
+
constructor(n, t) {
|
|
882
|
+
super(n), this.name = "HTMLInjectionError", this.html = t;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
const De = pn, sn = V, rn = Symbol("nomatch"), Bt = 7, Ut = function(e) {
|
|
886
|
+
const n = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), s = [];
|
|
887
|
+
let l = !0;
|
|
888
|
+
const c = "Could not find the language '{}', did you forget to load/include a language module?", i = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
889
|
+
let r = {
|
|
890
|
+
ignoreUnescapedHTML: !1,
|
|
891
|
+
throwUnescapedHTML: !1,
|
|
892
|
+
noHighlightRe: /^(no-?highlight)$/i,
|
|
893
|
+
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
|
|
894
|
+
classPrefix: "hljs-",
|
|
895
|
+
cssSelector: "pre code",
|
|
896
|
+
languages: null,
|
|
897
|
+
// beta configuration options, subject to change, welcome to discuss
|
|
898
|
+
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
899
|
+
__emitter: Qn
|
|
900
|
+
};
|
|
901
|
+
function a(u) {
|
|
902
|
+
return r.noHighlightRe.test(u);
|
|
903
|
+
}
|
|
904
|
+
function o(u) {
|
|
905
|
+
let b = u.className + " ";
|
|
906
|
+
b += u.parentNode ? u.parentNode.className : "";
|
|
907
|
+
const T = r.languageDetectRe.exec(b);
|
|
908
|
+
if (T) {
|
|
909
|
+
const M = z(T[1]);
|
|
910
|
+
return M || (tn(c.replace("{}", T[1])), tn("Falling back to no-highlight mode for this block.", u)), M ? T[1] : "no-highlight";
|
|
911
|
+
}
|
|
912
|
+
return b.split(/\s+/).find((M) => a(M) || z(M));
|
|
913
|
+
}
|
|
914
|
+
function p(u, b, T) {
|
|
915
|
+
let M = "", I = "";
|
|
916
|
+
typeof b == "object" ? (M = u, T = b.ignoreIllegals, I = b.language) : (re("10.7.0", "highlight(lang, code, ...args) has been deprecated."), re("10.7.0", `Please use highlight(code, options) instead.
|
|
917
|
+
https://github.com/highlightjs/highlight.js/issues/2277`), I = u, M = b), T === void 0 && (T = !0);
|
|
918
|
+
const U = {
|
|
919
|
+
code: M,
|
|
920
|
+
language: I
|
|
921
|
+
};
|
|
922
|
+
se("before:highlight", U);
|
|
923
|
+
const K = U.result ? U.result : _(U.language, U.code, T);
|
|
924
|
+
return K.code = U.code, se("after:highlight", K), K;
|
|
925
|
+
}
|
|
926
|
+
function _(u, b, T, M) {
|
|
927
|
+
const I = /* @__PURE__ */ Object.create(null);
|
|
928
|
+
function U(d, E) {
|
|
929
|
+
return d.keywords[E];
|
|
930
|
+
}
|
|
931
|
+
function K() {
|
|
932
|
+
if (!v.keywords) {
|
|
933
|
+
$.addText(C);
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
let d = 0;
|
|
937
|
+
v.keywordPatternRe.lastIndex = 0;
|
|
938
|
+
let E = v.keywordPatternRe.exec(C), w = "";
|
|
939
|
+
for (; E; ) {
|
|
940
|
+
w += C.substring(d, E.index);
|
|
941
|
+
const O = X.case_insensitive ? E[0].toLowerCase() : E[0], B = U(v, O);
|
|
942
|
+
if (B) {
|
|
943
|
+
const [W, Cn] = B;
|
|
944
|
+
if ($.addText(w), w = "", I[O] = (I[O] || 0) + 1, I[O] <= Bt && (me += Cn), W.startsWith("_"))
|
|
945
|
+
w += E[0];
|
|
946
|
+
else {
|
|
947
|
+
const In = X.classNameAliases[W] || W;
|
|
948
|
+
$.addKeyword(E[0], In);
|
|
949
|
+
}
|
|
950
|
+
} else
|
|
951
|
+
w += E[0];
|
|
952
|
+
d = v.keywordPatternRe.lastIndex, E = v.keywordPatternRe.exec(C);
|
|
953
|
+
}
|
|
954
|
+
w += C.substring(d), $.addText(w);
|
|
955
|
+
}
|
|
956
|
+
function he() {
|
|
957
|
+
if (C === "")
|
|
958
|
+
return;
|
|
959
|
+
let d = null;
|
|
960
|
+
if (typeof v.subLanguage == "string") {
|
|
961
|
+
if (!n[v.subLanguage]) {
|
|
962
|
+
$.addText(C);
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
d = _(v.subLanguage, C, !0, Qe[v.subLanguage]), Qe[v.subLanguage] = /** @type {CompiledMode} */
|
|
966
|
+
d._top;
|
|
967
|
+
} else
|
|
968
|
+
d = N(C, v.subLanguage.length ? v.subLanguage : null);
|
|
969
|
+
v.relevance > 0 && (me += d.relevance), $.addSublanguage(d._emitter, d.language);
|
|
970
|
+
}
|
|
971
|
+
function P() {
|
|
972
|
+
v.subLanguage != null ? he() : K(), C = "";
|
|
973
|
+
}
|
|
974
|
+
function Q(d, E) {
|
|
975
|
+
let w = 1;
|
|
976
|
+
const O = E.length - 1;
|
|
977
|
+
for (; w <= O; ) {
|
|
978
|
+
if (!d._emit[w]) {
|
|
979
|
+
w++;
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
const B = X.classNameAliases[d[w]] || d[w], W = E[w];
|
|
983
|
+
B ? $.addKeyword(W, B) : (C = W, K(), C = ""), w++;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
function qe(d, E) {
|
|
987
|
+
return d.scope && typeof d.scope == "string" && $.openNode(X.classNameAliases[d.scope] || d.scope), d.beginScope && (d.beginScope._wrap ? ($.addKeyword(C, X.classNameAliases[d.beginScope._wrap] || d.beginScope._wrap), C = "") : d.beginScope._multi && (Q(d.beginScope, E), C = "")), v = Object.create(d, { parent: { value: v } }), v;
|
|
988
|
+
}
|
|
989
|
+
function Ye(d, E, w) {
|
|
990
|
+
let O = Jn(d.endRe, w);
|
|
991
|
+
if (O) {
|
|
992
|
+
if (d["on:end"]) {
|
|
993
|
+
const B = new je(d);
|
|
994
|
+
d["on:end"](E, B), B.isMatchIgnored && (O = !1);
|
|
995
|
+
}
|
|
996
|
+
if (O) {
|
|
997
|
+
for (; d.endsParent && d.parent; )
|
|
998
|
+
d = d.parent;
|
|
999
|
+
return d;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
if (d.endsWithParent)
|
|
1003
|
+
return Ye(d.parent, E, w);
|
|
1004
|
+
}
|
|
1005
|
+
function Rn(d) {
|
|
1006
|
+
return v.matcher.regexIndex === 0 ? (C += d[0], 1) : (Le = !0, 0);
|
|
1007
|
+
}
|
|
1008
|
+
function On(d) {
|
|
1009
|
+
const E = d[0], w = d.rule, O = new je(w), B = [w.__beforeBegin, w["on:begin"]];
|
|
1010
|
+
for (const W of B)
|
|
1011
|
+
if (W && (W(d, O), O.isMatchIgnored))
|
|
1012
|
+
return Rn(E);
|
|
1013
|
+
return w.skip ? C += E : (w.excludeBegin && (C += E), P(), !w.returnBegin && !w.excludeBegin && (C = E)), qe(w, d), w.returnBegin ? 0 : E.length;
|
|
1014
|
+
}
|
|
1015
|
+
function xn(d) {
|
|
1016
|
+
const E = d[0], w = b.substring(d.index), O = Ye(v, d, w);
|
|
1017
|
+
if (!O)
|
|
1018
|
+
return rn;
|
|
1019
|
+
const B = v;
|
|
1020
|
+
v.endScope && v.endScope._wrap ? (P(), $.addKeyword(E, v.endScope._wrap)) : v.endScope && v.endScope._multi ? (P(), Q(v.endScope, d)) : B.skip ? C += E : (B.returnEnd || B.excludeEnd || (C += E), P(), B.excludeEnd && (C = E));
|
|
1021
|
+
do
|
|
1022
|
+
v.scope && $.closeNode(), !v.skip && !v.subLanguage && (me += v.relevance), v = v.parent;
|
|
1023
|
+
while (v !== O.parent);
|
|
1024
|
+
return O.starts && qe(O.starts, d), B.returnEnd ? 0 : E.length;
|
|
1025
|
+
}
|
|
1026
|
+
function Ln() {
|
|
1027
|
+
const d = [];
|
|
1028
|
+
for (let E = v; E !== X; E = E.parent)
|
|
1029
|
+
E.scope && d.unshift(E.scope);
|
|
1030
|
+
d.forEach((E) => $.openNode(E));
|
|
1031
|
+
}
|
|
1032
|
+
let Ee = {};
|
|
1033
|
+
function Ze(d, E) {
|
|
1034
|
+
const w = E && E[0];
|
|
1035
|
+
if (C += d, w == null)
|
|
1036
|
+
return P(), 0;
|
|
1037
|
+
if (Ee.type === "begin" && E.type === "end" && Ee.index === E.index && w === "") {
|
|
1038
|
+
if (C += b.slice(E.index, E.index + 1), !l) {
|
|
1039
|
+
const O = new Error(`0 width match regex (${u})`);
|
|
1040
|
+
throw O.languageName = u, O.badRule = Ee.rule, O;
|
|
1041
|
+
}
|
|
1042
|
+
return 1;
|
|
1043
|
+
}
|
|
1044
|
+
if (Ee = E, E.type === "begin")
|
|
1045
|
+
return On(E);
|
|
1046
|
+
if (E.type === "illegal" && !T) {
|
|
1047
|
+
const O = new Error('Illegal lexeme "' + w + '" for mode "' + (v.scope || "<unnamed>") + '"');
|
|
1048
|
+
throw O.mode = v, O;
|
|
1049
|
+
} else if (E.type === "end") {
|
|
1050
|
+
const O = xn(E);
|
|
1051
|
+
if (O !== rn)
|
|
1052
|
+
return O;
|
|
1053
|
+
}
|
|
1054
|
+
if (E.type === "illegal" && w === "")
|
|
1055
|
+
return 1;
|
|
1056
|
+
if (xe > 1e5 && xe > E.index * 3)
|
|
1057
|
+
throw new Error("potential infinite loop, way more iterations than matches");
|
|
1058
|
+
return C += w, w.length;
|
|
1059
|
+
}
|
|
1060
|
+
const X = z(u);
|
|
1061
|
+
if (!X)
|
|
1062
|
+
throw J(c.replace("{}", u)), new Error('Unknown language: "' + u + '"');
|
|
1063
|
+
const Dn = Ct(X);
|
|
1064
|
+
let Oe = "", v = M || Dn;
|
|
1065
|
+
const Qe = {}, $ = new r.__emitter(r);
|
|
1066
|
+
Ln();
|
|
1067
|
+
let C = "", me = 0, j = 0, xe = 0, Le = !1;
|
|
1068
|
+
try {
|
|
1069
|
+
for (v.matcher.considerAll(); ; ) {
|
|
1070
|
+
xe++, Le ? Le = !1 : v.matcher.considerAll(), v.matcher.lastIndex = j;
|
|
1071
|
+
const d = v.matcher.exec(b);
|
|
1072
|
+
if (!d)
|
|
1073
|
+
break;
|
|
1074
|
+
const E = b.substring(j, d.index), w = Ze(E, d);
|
|
1075
|
+
j = d.index + w;
|
|
1076
|
+
}
|
|
1077
|
+
return Ze(b.substring(j)), $.closeAllNodes(), $.finalize(), Oe = $.toHTML(), {
|
|
1078
|
+
language: u,
|
|
1079
|
+
value: Oe,
|
|
1080
|
+
relevance: me,
|
|
1081
|
+
illegal: !1,
|
|
1082
|
+
_emitter: $,
|
|
1083
|
+
_top: v
|
|
1084
|
+
};
|
|
1085
|
+
} catch (d) {
|
|
1086
|
+
if (d.message && d.message.includes("Illegal"))
|
|
1087
|
+
return {
|
|
1088
|
+
language: u,
|
|
1089
|
+
value: De(b),
|
|
1090
|
+
illegal: !0,
|
|
1091
|
+
relevance: 0,
|
|
1092
|
+
_illegalBy: {
|
|
1093
|
+
message: d.message,
|
|
1094
|
+
index: j,
|
|
1095
|
+
context: b.slice(j - 100, j + 100),
|
|
1096
|
+
mode: d.mode,
|
|
1097
|
+
resultSoFar: Oe
|
|
1098
|
+
},
|
|
1099
|
+
_emitter: $
|
|
1100
|
+
};
|
|
1101
|
+
if (l)
|
|
1102
|
+
return {
|
|
1103
|
+
language: u,
|
|
1104
|
+
value: De(b),
|
|
1105
|
+
illegal: !1,
|
|
1106
|
+
relevance: 0,
|
|
1107
|
+
errorRaised: d,
|
|
1108
|
+
_emitter: $,
|
|
1109
|
+
_top: v
|
|
1110
|
+
};
|
|
1111
|
+
throw d;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
function f(u) {
|
|
1115
|
+
const b = {
|
|
1116
|
+
value: De(u),
|
|
1117
|
+
illegal: !1,
|
|
1118
|
+
relevance: 0,
|
|
1119
|
+
_top: i,
|
|
1120
|
+
_emitter: new r.__emitter(r)
|
|
1121
|
+
};
|
|
1122
|
+
return b._emitter.addText(u), b;
|
|
1123
|
+
}
|
|
1124
|
+
function N(u, b) {
|
|
1125
|
+
b = b || r.languages || Object.keys(n);
|
|
1126
|
+
const T = f(u), M = b.filter(z).filter(te).map(
|
|
1127
|
+
(P) => _(P, u, !1)
|
|
1128
|
+
);
|
|
1129
|
+
M.unshift(T);
|
|
1130
|
+
const I = M.sort((P, Q) => {
|
|
1131
|
+
if (P.relevance !== Q.relevance)
|
|
1132
|
+
return Q.relevance - P.relevance;
|
|
1133
|
+
if (P.language && Q.language) {
|
|
1134
|
+
if (z(P.language).supersetOf === Q.language)
|
|
1135
|
+
return 1;
|
|
1136
|
+
if (z(Q.language).supersetOf === P.language)
|
|
1137
|
+
return -1;
|
|
1138
|
+
}
|
|
1139
|
+
return 0;
|
|
1140
|
+
}), [U, K] = I, he = U;
|
|
1141
|
+
return he.secondBest = K, he;
|
|
1142
|
+
}
|
|
1143
|
+
function h(u, b, T) {
|
|
1144
|
+
const M = b && t[b] || T;
|
|
1145
|
+
u.classList.add("hljs"), u.classList.add(`language-${M}`);
|
|
1146
|
+
}
|
|
1147
|
+
function g(u) {
|
|
1148
|
+
let b = null;
|
|
1149
|
+
const T = o(u);
|
|
1150
|
+
if (a(T))
|
|
1151
|
+
return;
|
|
1152
|
+
if (se(
|
|
1153
|
+
"before:highlightElement",
|
|
1154
|
+
{ el: u, language: T }
|
|
1155
|
+
), 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))
|
|
1156
|
+
throw new $t(
|
|
1157
|
+
"One of your code blocks includes unescaped HTML.",
|
|
1158
|
+
u.innerHTML
|
|
1159
|
+
);
|
|
1160
|
+
b = u;
|
|
1161
|
+
const M = b.textContent, I = T ? p(M, { language: T, ignoreIllegals: !0 }) : N(M);
|
|
1162
|
+
u.innerHTML = I.value, h(u, T, I.language), u.result = {
|
|
1163
|
+
language: I.language,
|
|
1164
|
+
// TODO: remove with version 11.0
|
|
1165
|
+
re: I.relevance,
|
|
1166
|
+
relevance: I.relevance
|
|
1167
|
+
}, I.secondBest && (u.secondBest = {
|
|
1168
|
+
language: I.secondBest.language,
|
|
1169
|
+
relevance: I.secondBest.relevance
|
|
1170
|
+
}), se("after:highlightElement", { el: u, result: I, text: M });
|
|
1171
|
+
}
|
|
1172
|
+
function A(u) {
|
|
1173
|
+
r = sn(r, u);
|
|
1174
|
+
}
|
|
1175
|
+
const S = () => {
|
|
1176
|
+
R(), re("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
1177
|
+
};
|
|
1178
|
+
function x() {
|
|
1179
|
+
R(), re("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
1180
|
+
}
|
|
1181
|
+
let y = !1;
|
|
1182
|
+
function R() {
|
|
1183
|
+
if (document.readyState === "loading") {
|
|
1184
|
+
y = !0;
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
document.querySelectorAll(r.cssSelector).forEach(g);
|
|
1188
|
+
}
|
|
1189
|
+
function L() {
|
|
1190
|
+
y && R();
|
|
1191
|
+
}
|
|
1192
|
+
typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", L, !1);
|
|
1193
|
+
function D(u, b) {
|
|
1194
|
+
let T = null;
|
|
1195
|
+
try {
|
|
1196
|
+
T = b(e);
|
|
1197
|
+
} catch (M) {
|
|
1198
|
+
if (J("Language definition for '{}' could not be registered.".replace("{}", u)), l)
|
|
1199
|
+
J(M);
|
|
1200
|
+
else
|
|
1201
|
+
throw M;
|
|
1202
|
+
T = i;
|
|
1203
|
+
}
|
|
1204
|
+
T.name || (T.name = u), n[u] = T, T.rawDefinition = b.bind(null, e), T.aliases && ne(T.aliases, { languageName: u });
|
|
1205
|
+
}
|
|
1206
|
+
function k(u) {
|
|
1207
|
+
delete n[u];
|
|
1208
|
+
for (const b of Object.keys(t))
|
|
1209
|
+
t[b] === u && delete t[b];
|
|
1210
|
+
}
|
|
1211
|
+
function H() {
|
|
1212
|
+
return Object.keys(n);
|
|
1213
|
+
}
|
|
1214
|
+
function z(u) {
|
|
1215
|
+
return u = (u || "").toLowerCase(), n[u] || n[t[u]];
|
|
1216
|
+
}
|
|
1217
|
+
function ne(u, { languageName: b }) {
|
|
1218
|
+
typeof u == "string" && (u = [u]), u.forEach((T) => {
|
|
1219
|
+
t[T.toLowerCase()] = b;
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
function te(u) {
|
|
1223
|
+
const b = z(u);
|
|
1224
|
+
return b && !b.disableAutodetect;
|
|
1225
|
+
}
|
|
1226
|
+
function oe(u) {
|
|
1227
|
+
u["before:highlightBlock"] && !u["before:highlightElement"] && (u["before:highlightElement"] = (b) => {
|
|
1228
|
+
u["before:highlightBlock"](
|
|
1229
|
+
Object.assign({ block: b.el }, b)
|
|
1230
|
+
);
|
|
1231
|
+
}), u["after:highlightBlock"] && !u["after:highlightElement"] && (u["after:highlightElement"] = (b) => {
|
|
1232
|
+
u["after:highlightBlock"](
|
|
1233
|
+
Object.assign({ block: b.el }, b)
|
|
1234
|
+
);
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
function Re(u) {
|
|
1238
|
+
oe(u), s.push(u);
|
|
1239
|
+
}
|
|
1240
|
+
function se(u, b) {
|
|
1241
|
+
const T = u;
|
|
1242
|
+
s.forEach(function(M) {
|
|
1243
|
+
M[T] && M[T](b);
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
function be(u) {
|
|
1247
|
+
return re("10.7.0", "highlightBlock will be removed entirely in v12.0"), re("10.7.0", "Please use highlightElement now."), g(u);
|
|
1248
|
+
}
|
|
1249
|
+
Object.assign(e, {
|
|
1250
|
+
highlight: p,
|
|
1251
|
+
highlightAuto: N,
|
|
1252
|
+
highlightAll: R,
|
|
1253
|
+
highlightElement: g,
|
|
1254
|
+
// TODO: Remove with v12 API
|
|
1255
|
+
highlightBlock: be,
|
|
1256
|
+
configure: A,
|
|
1257
|
+
initHighlighting: S,
|
|
1258
|
+
initHighlightingOnLoad: x,
|
|
1259
|
+
registerLanguage: D,
|
|
1260
|
+
unregisterLanguage: k,
|
|
1261
|
+
listLanguages: H,
|
|
1262
|
+
getLanguage: z,
|
|
1263
|
+
registerAliases: ne,
|
|
1264
|
+
autoDetection: te,
|
|
1265
|
+
inherit: sn,
|
|
1266
|
+
addPlugin: Re
|
|
1267
|
+
}), e.debugMode = function() {
|
|
1268
|
+
l = !1;
|
|
1269
|
+
}, e.safeMode = function() {
|
|
1270
|
+
l = !0;
|
|
1271
|
+
}, e.versionString = kt, e.regex = {
|
|
1272
|
+
concat: ee,
|
|
1273
|
+
lookahead: _n,
|
|
1274
|
+
either: ze,
|
|
1275
|
+
optional: Vn,
|
|
1276
|
+
anyNumberOfTimes: Xn
|
|
1277
|
+
};
|
|
1278
|
+
for (const u in ve)
|
|
1279
|
+
typeof ve[u] == "object" && Ue.exports(ve[u]);
|
|
1280
|
+
return Object.assign(e, ve), e;
|
|
1281
|
+
};
|
|
1282
|
+
var fe = Ut({}), Pt = fe;
|
|
1283
|
+
fe.HighlightJS = fe;
|
|
1284
|
+
fe.default = fe;
|
|
1285
|
+
const G = Pt;
|
|
1286
|
+
function Ht(e) {
|
|
1287
|
+
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, l = {
|
|
1288
|
+
className: "symbol",
|
|
1289
|
+
begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
|
|
1290
|
+
}, c = {
|
|
1291
|
+
begin: /\s/,
|
|
1292
|
+
contains: [
|
|
1293
|
+
{
|
|
1294
|
+
className: "keyword",
|
|
1295
|
+
begin: /#?[a-z_][a-z1-9_-]+/,
|
|
1296
|
+
illegal: /\n/
|
|
1297
|
+
}
|
|
1298
|
+
]
|
|
1299
|
+
}, i = e.inherit(c, {
|
|
1300
|
+
begin: /\(/,
|
|
1301
|
+
end: /\)/
|
|
1302
|
+
}), r = e.inherit(e.APOS_STRING_MODE, { className: "string" }), a = e.inherit(e.QUOTE_STRING_MODE, { className: "string" }), o = {
|
|
1303
|
+
endsWithParent: !0,
|
|
1304
|
+
illegal: /</,
|
|
1305
|
+
relevance: 0,
|
|
1306
|
+
contains: [
|
|
1307
|
+
{
|
|
1308
|
+
className: "attr",
|
|
1309
|
+
begin: s,
|
|
1310
|
+
relevance: 0
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
begin: /=\s*/,
|
|
1314
|
+
relevance: 0,
|
|
1315
|
+
contains: [
|
|
1316
|
+
{
|
|
1317
|
+
className: "string",
|
|
1318
|
+
endsParent: !0,
|
|
1319
|
+
variants: [
|
|
1320
|
+
{
|
|
1321
|
+
begin: /"/,
|
|
1322
|
+
end: /"/,
|
|
1323
|
+
contains: [l]
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
begin: /'/,
|
|
1327
|
+
end: /'/,
|
|
1328
|
+
contains: [l]
|
|
1329
|
+
},
|
|
1330
|
+
{ begin: /[^\s"'=<>`]+/ }
|
|
1331
|
+
]
|
|
1332
|
+
}
|
|
1333
|
+
]
|
|
1334
|
+
}
|
|
1335
|
+
]
|
|
1336
|
+
};
|
|
1337
|
+
return {
|
|
1338
|
+
name: "HTML, XML",
|
|
1339
|
+
aliases: [
|
|
1340
|
+
"html",
|
|
1341
|
+
"xhtml",
|
|
1342
|
+
"rss",
|
|
1343
|
+
"atom",
|
|
1344
|
+
"xjb",
|
|
1345
|
+
"xsd",
|
|
1346
|
+
"xsl",
|
|
1347
|
+
"plist",
|
|
1348
|
+
"wsf",
|
|
1349
|
+
"svg"
|
|
1350
|
+
],
|
|
1351
|
+
case_insensitive: !0,
|
|
1352
|
+
unicodeRegex: !0,
|
|
1353
|
+
contains: [
|
|
1354
|
+
{
|
|
1355
|
+
className: "meta",
|
|
1356
|
+
begin: /<![a-z]/,
|
|
1357
|
+
end: />/,
|
|
1358
|
+
relevance: 10,
|
|
1359
|
+
contains: [
|
|
1360
|
+
c,
|
|
1361
|
+
a,
|
|
1362
|
+
r,
|
|
1363
|
+
i,
|
|
1364
|
+
{
|
|
1365
|
+
begin: /\[/,
|
|
1366
|
+
end: /\]/,
|
|
1367
|
+
contains: [
|
|
1368
|
+
{
|
|
1369
|
+
className: "meta",
|
|
1370
|
+
begin: /<![a-z]/,
|
|
1371
|
+
end: />/,
|
|
1372
|
+
contains: [
|
|
1373
|
+
c,
|
|
1374
|
+
i,
|
|
1375
|
+
a,
|
|
1376
|
+
r
|
|
1377
|
+
]
|
|
1378
|
+
}
|
|
1379
|
+
]
|
|
1380
|
+
}
|
|
1381
|
+
]
|
|
1382
|
+
},
|
|
1383
|
+
e.COMMENT(
|
|
1384
|
+
/<!--/,
|
|
1385
|
+
/-->/,
|
|
1386
|
+
{ relevance: 10 }
|
|
1387
|
+
),
|
|
1388
|
+
{
|
|
1389
|
+
begin: /<!\[CDATA\[/,
|
|
1390
|
+
end: /\]\]>/,
|
|
1391
|
+
relevance: 10
|
|
1392
|
+
},
|
|
1393
|
+
l,
|
|
1394
|
+
// xml processing instructions
|
|
1395
|
+
{
|
|
1396
|
+
className: "meta",
|
|
1397
|
+
end: /\?>/,
|
|
1398
|
+
variants: [
|
|
1399
|
+
{
|
|
1400
|
+
begin: /<\?xml/,
|
|
1401
|
+
relevance: 10,
|
|
1402
|
+
contains: [
|
|
1403
|
+
a
|
|
1404
|
+
]
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
begin: /<\?[a-z][a-z0-9]+/
|
|
1408
|
+
}
|
|
1409
|
+
]
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
className: "tag",
|
|
1413
|
+
/*
|
|
1414
|
+
The lookahead pattern (?=...) ensures that 'begin' only matches
|
|
1415
|
+
'<style' as a single word, followed by a whitespace or an
|
|
1416
|
+
ending bracket.
|
|
1417
|
+
*/
|
|
1418
|
+
begin: /<style(?=\s|>)/,
|
|
1419
|
+
end: />/,
|
|
1420
|
+
keywords: { name: "style" },
|
|
1421
|
+
contains: [o],
|
|
1422
|
+
starts: {
|
|
1423
|
+
end: /<\/style>/,
|
|
1424
|
+
returnEnd: !0,
|
|
1425
|
+
subLanguage: [
|
|
1426
|
+
"css",
|
|
1427
|
+
"xml"
|
|
1428
|
+
]
|
|
1429
|
+
}
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
className: "tag",
|
|
1433
|
+
// See the comment in the <style tag about the lookahead pattern
|
|
1434
|
+
begin: /<script(?=\s|>)/,
|
|
1435
|
+
end: />/,
|
|
1436
|
+
keywords: { name: "script" },
|
|
1437
|
+
contains: [o],
|
|
1438
|
+
starts: {
|
|
1439
|
+
end: /<\/script>/,
|
|
1440
|
+
returnEnd: !0,
|
|
1441
|
+
subLanguage: [
|
|
1442
|
+
"javascript",
|
|
1443
|
+
"handlebars",
|
|
1444
|
+
"xml"
|
|
1445
|
+
]
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
// we need this for now for jSX
|
|
1449
|
+
{
|
|
1450
|
+
className: "tag",
|
|
1451
|
+
begin: /<>|<\/>/
|
|
1452
|
+
},
|
|
1453
|
+
// open tag
|
|
1454
|
+
{
|
|
1455
|
+
className: "tag",
|
|
1456
|
+
begin: n.concat(
|
|
1457
|
+
/</,
|
|
1458
|
+
n.lookahead(n.concat(
|
|
1459
|
+
t,
|
|
1460
|
+
// <tag/>
|
|
1461
|
+
// <tag>
|
|
1462
|
+
// <tag ...
|
|
1463
|
+
n.either(/\/>/, />/, /\s/)
|
|
1464
|
+
))
|
|
1465
|
+
),
|
|
1466
|
+
end: /\/?>/,
|
|
1467
|
+
contains: [
|
|
1468
|
+
{
|
|
1469
|
+
className: "name",
|
|
1470
|
+
begin: t,
|
|
1471
|
+
relevance: 0,
|
|
1472
|
+
starts: o
|
|
1473
|
+
}
|
|
1474
|
+
]
|
|
1475
|
+
},
|
|
1476
|
+
// close tag
|
|
1477
|
+
{
|
|
1478
|
+
className: "tag",
|
|
1479
|
+
begin: n.concat(
|
|
1480
|
+
/<\//,
|
|
1481
|
+
n.lookahead(n.concat(
|
|
1482
|
+
t,
|
|
1483
|
+
/>/
|
|
1484
|
+
))
|
|
1485
|
+
),
|
|
1486
|
+
contains: [
|
|
1487
|
+
{
|
|
1488
|
+
className: "name",
|
|
1489
|
+
begin: t,
|
|
1490
|
+
relevance: 0
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
begin: />/,
|
|
1494
|
+
relevance: 0,
|
|
1495
|
+
endsParent: !0
|
|
1496
|
+
}
|
|
1497
|
+
]
|
|
1498
|
+
}
|
|
1499
|
+
]
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
const an = "[A-Za-z$_][0-9A-Za-z$_]*", zt = [
|
|
1503
|
+
"as",
|
|
1504
|
+
// for exports
|
|
1505
|
+
"in",
|
|
1506
|
+
"of",
|
|
1507
|
+
"if",
|
|
1508
|
+
"for",
|
|
1509
|
+
"while",
|
|
1510
|
+
"finally",
|
|
1511
|
+
"var",
|
|
1512
|
+
"new",
|
|
1513
|
+
"function",
|
|
1514
|
+
"do",
|
|
1515
|
+
"return",
|
|
1516
|
+
"void",
|
|
1517
|
+
"else",
|
|
1518
|
+
"break",
|
|
1519
|
+
"catch",
|
|
1520
|
+
"instanceof",
|
|
1521
|
+
"with",
|
|
1522
|
+
"throw",
|
|
1523
|
+
"case",
|
|
1524
|
+
"default",
|
|
1525
|
+
"try",
|
|
1526
|
+
"switch",
|
|
1527
|
+
"continue",
|
|
1528
|
+
"typeof",
|
|
1529
|
+
"delete",
|
|
1530
|
+
"let",
|
|
1531
|
+
"yield",
|
|
1532
|
+
"const",
|
|
1533
|
+
"class",
|
|
1534
|
+
// JS handles these with a special rule
|
|
1535
|
+
// "get",
|
|
1536
|
+
// "set",
|
|
1537
|
+
"debugger",
|
|
1538
|
+
"async",
|
|
1539
|
+
"await",
|
|
1540
|
+
"static",
|
|
1541
|
+
"import",
|
|
1542
|
+
"from",
|
|
1543
|
+
"export",
|
|
1544
|
+
"extends"
|
|
1545
|
+
], Ft = [
|
|
1546
|
+
"true",
|
|
1547
|
+
"false",
|
|
1548
|
+
"null",
|
|
1549
|
+
"undefined",
|
|
1550
|
+
"NaN",
|
|
1551
|
+
"Infinity"
|
|
1552
|
+
], An = [
|
|
1553
|
+
// Fundamental objects
|
|
1554
|
+
"Object",
|
|
1555
|
+
"Function",
|
|
1556
|
+
"Boolean",
|
|
1557
|
+
"Symbol",
|
|
1558
|
+
// numbers and dates
|
|
1559
|
+
"Math",
|
|
1560
|
+
"Date",
|
|
1561
|
+
"Number",
|
|
1562
|
+
"BigInt",
|
|
1563
|
+
// text
|
|
1564
|
+
"String",
|
|
1565
|
+
"RegExp",
|
|
1566
|
+
// Indexed collections
|
|
1567
|
+
"Array",
|
|
1568
|
+
"Float32Array",
|
|
1569
|
+
"Float64Array",
|
|
1570
|
+
"Int8Array",
|
|
1571
|
+
"Uint8Array",
|
|
1572
|
+
"Uint8ClampedArray",
|
|
1573
|
+
"Int16Array",
|
|
1574
|
+
"Int32Array",
|
|
1575
|
+
"Uint16Array",
|
|
1576
|
+
"Uint32Array",
|
|
1577
|
+
"BigInt64Array",
|
|
1578
|
+
"BigUint64Array",
|
|
1579
|
+
// Keyed collections
|
|
1580
|
+
"Set",
|
|
1581
|
+
"Map",
|
|
1582
|
+
"WeakSet",
|
|
1583
|
+
"WeakMap",
|
|
1584
|
+
// Structured data
|
|
1585
|
+
"ArrayBuffer",
|
|
1586
|
+
"SharedArrayBuffer",
|
|
1587
|
+
"Atomics",
|
|
1588
|
+
"DataView",
|
|
1589
|
+
"JSON",
|
|
1590
|
+
// Control abstraction objects
|
|
1591
|
+
"Promise",
|
|
1592
|
+
"Generator",
|
|
1593
|
+
"GeneratorFunction",
|
|
1594
|
+
"AsyncFunction",
|
|
1595
|
+
// Reflection
|
|
1596
|
+
"Reflect",
|
|
1597
|
+
"Proxy",
|
|
1598
|
+
// Internationalization
|
|
1599
|
+
"Intl",
|
|
1600
|
+
// WebAssembly
|
|
1601
|
+
"WebAssembly"
|
|
1602
|
+
], wn = [
|
|
1603
|
+
"Error",
|
|
1604
|
+
"EvalError",
|
|
1605
|
+
"InternalError",
|
|
1606
|
+
"RangeError",
|
|
1607
|
+
"ReferenceError",
|
|
1608
|
+
"SyntaxError",
|
|
1609
|
+
"TypeError",
|
|
1610
|
+
"URIError"
|
|
1611
|
+
], Sn = [
|
|
1612
|
+
"setInterval",
|
|
1613
|
+
"setTimeout",
|
|
1614
|
+
"clearInterval",
|
|
1615
|
+
"clearTimeout",
|
|
1616
|
+
"require",
|
|
1617
|
+
"exports",
|
|
1618
|
+
"eval",
|
|
1619
|
+
"isFinite",
|
|
1620
|
+
"isNaN",
|
|
1621
|
+
"parseFloat",
|
|
1622
|
+
"parseInt",
|
|
1623
|
+
"decodeURI",
|
|
1624
|
+
"decodeURIComponent",
|
|
1625
|
+
"encodeURI",
|
|
1626
|
+
"encodeURIComponent",
|
|
1627
|
+
"escape",
|
|
1628
|
+
"unescape"
|
|
1629
|
+
], Gt = [
|
|
1630
|
+
"arguments",
|
|
1631
|
+
"this",
|
|
1632
|
+
"super",
|
|
1633
|
+
"console",
|
|
1634
|
+
"window",
|
|
1635
|
+
"document",
|
|
1636
|
+
"localStorage",
|
|
1637
|
+
"module",
|
|
1638
|
+
"global"
|
|
1639
|
+
// Node.js
|
|
1640
|
+
], Kt = [].concat(
|
|
1641
|
+
Sn,
|
|
1642
|
+
An,
|
|
1643
|
+
wn
|
|
1644
|
+
);
|
|
1645
|
+
function Wt(e) {
|
|
1646
|
+
const n = e.regex, t = (b, { after: T }) => {
|
|
1647
|
+
const M = "</" + b[0].slice(1);
|
|
1648
|
+
return b.input.indexOf(M, T) !== -1;
|
|
1649
|
+
}, s = an, l = {
|
|
1650
|
+
begin: "<>",
|
|
1651
|
+
end: "</>"
|
|
1652
|
+
}, c = /<[A-Za-z0-9\\._:-]+\s*\/>/, i = {
|
|
1653
|
+
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
1654
|
+
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
1655
|
+
/**
|
|
1656
|
+
* @param {RegExpMatchArray} match
|
|
1657
|
+
* @param {CallbackResponse} response
|
|
1658
|
+
*/
|
|
1659
|
+
isTrulyOpeningTag: (b, T) => {
|
|
1660
|
+
const M = b[0].length + b.index, I = b.input[M];
|
|
1661
|
+
if (
|
|
1662
|
+
// HTML should not include another raw `<` inside a tag
|
|
1663
|
+
// nested type?
|
|
1664
|
+
// `<Array<Array<number>>`, etc.
|
|
1665
|
+
I === "<" || // the , gives away that this is not HTML
|
|
1666
|
+
// `<T, A extends keyof T, V>`
|
|
1667
|
+
I === ","
|
|
1668
|
+
) {
|
|
1669
|
+
T.ignoreMatch();
|
|
1670
|
+
return;
|
|
1671
|
+
}
|
|
1672
|
+
I === ">" && (t(b, { after: M }) || T.ignoreMatch());
|
|
1673
|
+
let U;
|
|
1674
|
+
const K = b.input.substring(M);
|
|
1675
|
+
if (U = K.match(/^\s*=/)) {
|
|
1676
|
+
T.ignoreMatch();
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
if ((U = K.match(/^\s+extends\s+/)) && U.index === 0) {
|
|
1680
|
+
T.ignoreMatch();
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
}, r = {
|
|
1685
|
+
$pattern: an,
|
|
1686
|
+
keyword: zt,
|
|
1687
|
+
literal: Ft,
|
|
1688
|
+
built_in: Kt,
|
|
1689
|
+
"variable.language": Gt
|
|
1690
|
+
}, a = "[0-9](_?[0-9])*", o = `\\.(${a})`, p = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", _ = {
|
|
1691
|
+
className: "number",
|
|
1692
|
+
variants: [
|
|
1693
|
+
// DecimalLiteral
|
|
1694
|
+
{ begin: `(\\b(${p})((${o})|\\.)?|(${o}))[eE][+-]?(${a})\\b` },
|
|
1695
|
+
{ begin: `\\b(${p})\\b((${o})\\b|\\.)?|(${o})\\b` },
|
|
1696
|
+
// DecimalBigIntegerLiteral
|
|
1697
|
+
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
|
|
1698
|
+
// NonDecimalIntegerLiteral
|
|
1699
|
+
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
1700
|
+
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
1701
|
+
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
1702
|
+
// LegacyOctalIntegerLiteral (does not include underscore separators)
|
|
1703
|
+
// https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
|
|
1704
|
+
{ begin: "\\b0[0-7]+n?\\b" }
|
|
1705
|
+
],
|
|
1706
|
+
relevance: 0
|
|
1707
|
+
}, f = {
|
|
1708
|
+
className: "subst",
|
|
1709
|
+
begin: "\\$\\{",
|
|
1710
|
+
end: "\\}",
|
|
1711
|
+
keywords: r,
|
|
1712
|
+
contains: []
|
|
1713
|
+
// defined later
|
|
1714
|
+
}, N = {
|
|
1715
|
+
begin: "html`",
|
|
1716
|
+
end: "",
|
|
1717
|
+
starts: {
|
|
1718
|
+
end: "`",
|
|
1719
|
+
returnEnd: !1,
|
|
1720
|
+
contains: [
|
|
1721
|
+
e.BACKSLASH_ESCAPE,
|
|
1722
|
+
f
|
|
1723
|
+
],
|
|
1724
|
+
subLanguage: "xml"
|
|
1725
|
+
}
|
|
1726
|
+
}, h = {
|
|
1727
|
+
begin: "css`",
|
|
1728
|
+
end: "",
|
|
1729
|
+
starts: {
|
|
1730
|
+
end: "`",
|
|
1731
|
+
returnEnd: !1,
|
|
1732
|
+
contains: [
|
|
1733
|
+
e.BACKSLASH_ESCAPE,
|
|
1734
|
+
f
|
|
1735
|
+
],
|
|
1736
|
+
subLanguage: "css"
|
|
1737
|
+
}
|
|
1738
|
+
}, g = {
|
|
1739
|
+
className: "string",
|
|
1740
|
+
begin: "`",
|
|
1741
|
+
end: "`",
|
|
1742
|
+
contains: [
|
|
1743
|
+
e.BACKSLASH_ESCAPE,
|
|
1744
|
+
f
|
|
1745
|
+
]
|
|
1746
|
+
}, S = {
|
|
1747
|
+
className: "comment",
|
|
1748
|
+
variants: [
|
|
1749
|
+
e.COMMENT(
|
|
1750
|
+
/\/\*\*(?!\/)/,
|
|
1751
|
+
"\\*/",
|
|
1752
|
+
{
|
|
1753
|
+
relevance: 0,
|
|
1754
|
+
contains: [
|
|
1755
|
+
{
|
|
1756
|
+
begin: "(?=@[A-Za-z]+)",
|
|
1757
|
+
relevance: 0,
|
|
1758
|
+
contains: [
|
|
1759
|
+
{
|
|
1760
|
+
className: "doctag",
|
|
1761
|
+
begin: "@[A-Za-z]+"
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
className: "type",
|
|
1765
|
+
begin: "\\{",
|
|
1766
|
+
end: "\\}",
|
|
1767
|
+
excludeEnd: !0,
|
|
1768
|
+
excludeBegin: !0,
|
|
1769
|
+
relevance: 0
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
className: "variable",
|
|
1773
|
+
begin: s + "(?=\\s*(-)|$)",
|
|
1774
|
+
endsParent: !0,
|
|
1775
|
+
relevance: 0
|
|
1776
|
+
},
|
|
1777
|
+
// eat spaces (not newlines) so we can find
|
|
1778
|
+
// types or variables
|
|
1779
|
+
{
|
|
1780
|
+
begin: /(?=[^\n])\s/,
|
|
1781
|
+
relevance: 0
|
|
1782
|
+
}
|
|
1783
|
+
]
|
|
1784
|
+
}
|
|
1785
|
+
]
|
|
1786
|
+
}
|
|
1787
|
+
),
|
|
1788
|
+
e.C_BLOCK_COMMENT_MODE,
|
|
1789
|
+
e.C_LINE_COMMENT_MODE
|
|
1790
|
+
]
|
|
1791
|
+
}, x = [
|
|
1792
|
+
e.APOS_STRING_MODE,
|
|
1793
|
+
e.QUOTE_STRING_MODE,
|
|
1794
|
+
N,
|
|
1795
|
+
h,
|
|
1796
|
+
g,
|
|
1797
|
+
// Skip numbers when they are part of a variable name
|
|
1798
|
+
{ match: /\$\d+/ },
|
|
1799
|
+
_
|
|
1800
|
+
// This is intentional:
|
|
1801
|
+
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
1802
|
+
// hljs.REGEXP_MODE
|
|
1803
|
+
];
|
|
1804
|
+
f.contains = x.concat({
|
|
1805
|
+
// we need to pair up {} inside our subst to prevent
|
|
1806
|
+
// it from ending too early by matching another }
|
|
1807
|
+
begin: /\{/,
|
|
1808
|
+
end: /\}/,
|
|
1809
|
+
keywords: r,
|
|
1810
|
+
contains: [
|
|
1811
|
+
"self"
|
|
1812
|
+
].concat(x)
|
|
1813
|
+
});
|
|
1814
|
+
const y = [].concat(S, f.contains), R = y.concat([
|
|
1815
|
+
// eat recursive parens in sub expressions
|
|
1816
|
+
{
|
|
1817
|
+
begin: /\(/,
|
|
1818
|
+
end: /\)/,
|
|
1819
|
+
keywords: r,
|
|
1820
|
+
contains: ["self"].concat(y)
|
|
1821
|
+
}
|
|
1822
|
+
]), L = {
|
|
1823
|
+
className: "params",
|
|
1824
|
+
begin: /\(/,
|
|
1825
|
+
end: /\)/,
|
|
1826
|
+
excludeBegin: !0,
|
|
1827
|
+
excludeEnd: !0,
|
|
1828
|
+
keywords: r,
|
|
1829
|
+
contains: R
|
|
1830
|
+
}, D = {
|
|
1831
|
+
variants: [
|
|
1832
|
+
// class Car extends vehicle
|
|
1833
|
+
{
|
|
1834
|
+
match: [
|
|
1835
|
+
/class/,
|
|
1836
|
+
/\s+/,
|
|
1837
|
+
s,
|
|
1838
|
+
/\s+/,
|
|
1839
|
+
/extends/,
|
|
1840
|
+
/\s+/,
|
|
1841
|
+
n.concat(s, "(", n.concat(/\./, s), ")*")
|
|
1842
|
+
],
|
|
1843
|
+
scope: {
|
|
1844
|
+
1: "keyword",
|
|
1845
|
+
3: "title.class",
|
|
1846
|
+
5: "keyword",
|
|
1847
|
+
7: "title.class.inherited"
|
|
1848
|
+
}
|
|
1849
|
+
},
|
|
1850
|
+
// class Car
|
|
1851
|
+
{
|
|
1852
|
+
match: [
|
|
1853
|
+
/class/,
|
|
1854
|
+
/\s+/,
|
|
1855
|
+
s
|
|
1856
|
+
],
|
|
1857
|
+
scope: {
|
|
1858
|
+
1: "keyword",
|
|
1859
|
+
3: "title.class"
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
]
|
|
1863
|
+
}, k = {
|
|
1864
|
+
relevance: 0,
|
|
1865
|
+
match: n.either(
|
|
1866
|
+
// Hard coded exceptions
|
|
1867
|
+
/\bJSON/,
|
|
1868
|
+
// Float32Array, OutT
|
|
1869
|
+
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
|
|
1870
|
+
// CSSFactory, CSSFactoryT
|
|
1871
|
+
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
|
|
1872
|
+
// FPs, FPsT
|
|
1873
|
+
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
|
|
1874
|
+
// P
|
|
1875
|
+
// single letters are not highlighted
|
|
1876
|
+
// BLAH
|
|
1877
|
+
// this will be flagged as a UPPER_CASE_CONSTANT instead
|
|
1878
|
+
),
|
|
1879
|
+
className: "title.class",
|
|
1880
|
+
keywords: {
|
|
1881
|
+
_: [
|
|
1882
|
+
// se we still get relevance credit for JS library classes
|
|
1883
|
+
...An,
|
|
1884
|
+
...wn
|
|
1885
|
+
]
|
|
1886
|
+
}
|
|
1887
|
+
}, H = {
|
|
1888
|
+
label: "use_strict",
|
|
1889
|
+
className: "meta",
|
|
1890
|
+
relevance: 10,
|
|
1891
|
+
begin: /^\s*['"]use (strict|asm)['"]/
|
|
1892
|
+
}, z = {
|
|
1893
|
+
variants: [
|
|
1894
|
+
{
|
|
1895
|
+
match: [
|
|
1896
|
+
/function/,
|
|
1897
|
+
/\s+/,
|
|
1898
|
+
s,
|
|
1899
|
+
/(?=\s*\()/
|
|
1900
|
+
]
|
|
1901
|
+
},
|
|
1902
|
+
// anonymous function
|
|
1903
|
+
{
|
|
1904
|
+
match: [
|
|
1905
|
+
/function/,
|
|
1906
|
+
/\s*(?=\()/
|
|
1907
|
+
]
|
|
1908
|
+
}
|
|
1909
|
+
],
|
|
1910
|
+
className: {
|
|
1911
|
+
1: "keyword",
|
|
1912
|
+
3: "title.function"
|
|
1913
|
+
},
|
|
1914
|
+
label: "func.def",
|
|
1915
|
+
contains: [L],
|
|
1916
|
+
illegal: /%/
|
|
1917
|
+
}, ne = {
|
|
1918
|
+
relevance: 0,
|
|
1919
|
+
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
1920
|
+
className: "variable.constant"
|
|
1921
|
+
};
|
|
1922
|
+
function te(b) {
|
|
1923
|
+
return n.concat("(?!", b.join("|"), ")");
|
|
1924
|
+
}
|
|
1925
|
+
const oe = {
|
|
1926
|
+
match: n.concat(
|
|
1927
|
+
/\b/,
|
|
1928
|
+
te([
|
|
1929
|
+
...Sn,
|
|
1930
|
+
"super",
|
|
1931
|
+
"import"
|
|
1932
|
+
]),
|
|
1933
|
+
s,
|
|
1934
|
+
n.lookahead(/\(/)
|
|
1935
|
+
),
|
|
1936
|
+
className: "title.function",
|
|
1937
|
+
relevance: 0
|
|
1938
|
+
}, Re = {
|
|
1939
|
+
begin: n.concat(/\./, n.lookahead(
|
|
1940
|
+
n.concat(s, /(?![0-9A-Za-z$_(])/)
|
|
1941
|
+
)),
|
|
1942
|
+
end: s,
|
|
1943
|
+
excludeBegin: !0,
|
|
1944
|
+
keywords: "prototype",
|
|
1945
|
+
className: "property",
|
|
1946
|
+
relevance: 0
|
|
1947
|
+
}, se = {
|
|
1948
|
+
match: [
|
|
1949
|
+
/get|set/,
|
|
1950
|
+
/\s+/,
|
|
1951
|
+
s,
|
|
1952
|
+
/(?=\()/
|
|
1953
|
+
],
|
|
1954
|
+
className: {
|
|
1955
|
+
1: "keyword",
|
|
1956
|
+
3: "title.function"
|
|
1957
|
+
},
|
|
1958
|
+
contains: [
|
|
1959
|
+
{
|
|
1960
|
+
// eat to avoid empty params
|
|
1961
|
+
begin: /\(\)/
|
|
1962
|
+
},
|
|
1963
|
+
L
|
|
1964
|
+
]
|
|
1965
|
+
}, be = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", u = {
|
|
1966
|
+
match: [
|
|
1967
|
+
/const|var|let/,
|
|
1968
|
+
/\s+/,
|
|
1969
|
+
s,
|
|
1970
|
+
/\s*/,
|
|
1971
|
+
/=\s*/,
|
|
1972
|
+
/(async\s*)?/,
|
|
1973
|
+
// async is optional
|
|
1974
|
+
n.lookahead(be)
|
|
1975
|
+
],
|
|
1976
|
+
keywords: "async",
|
|
1977
|
+
className: {
|
|
1978
|
+
1: "keyword",
|
|
1979
|
+
3: "title.function"
|
|
1980
|
+
},
|
|
1981
|
+
contains: [
|
|
1982
|
+
L
|
|
1983
|
+
]
|
|
1984
|
+
};
|
|
1985
|
+
return {
|
|
1986
|
+
name: "Javascript",
|
|
1987
|
+
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
1988
|
+
keywords: r,
|
|
1989
|
+
// this will be extended by TypeScript
|
|
1990
|
+
exports: { PARAMS_CONTAINS: R, CLASS_REFERENCE: k },
|
|
1991
|
+
illegal: /#(?![$_A-z])/,
|
|
1992
|
+
contains: [
|
|
1993
|
+
e.SHEBANG({
|
|
1994
|
+
label: "shebang",
|
|
1995
|
+
binary: "node",
|
|
1996
|
+
relevance: 5
|
|
1997
|
+
}),
|
|
1998
|
+
H,
|
|
1999
|
+
e.APOS_STRING_MODE,
|
|
2000
|
+
e.QUOTE_STRING_MODE,
|
|
2001
|
+
N,
|
|
2002
|
+
h,
|
|
2003
|
+
g,
|
|
2004
|
+
S,
|
|
2005
|
+
// Skip numbers when they are part of a variable name
|
|
2006
|
+
{ match: /\$\d+/ },
|
|
2007
|
+
_,
|
|
2008
|
+
k,
|
|
2009
|
+
{
|
|
2010
|
+
className: "attr",
|
|
2011
|
+
begin: s + n.lookahead(":"),
|
|
2012
|
+
relevance: 0
|
|
2013
|
+
},
|
|
2014
|
+
u,
|
|
2015
|
+
{
|
|
2016
|
+
// "value" container
|
|
2017
|
+
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
2018
|
+
keywords: "return throw case",
|
|
2019
|
+
relevance: 0,
|
|
2020
|
+
contains: [
|
|
2021
|
+
S,
|
|
2022
|
+
e.REGEXP_MODE,
|
|
2023
|
+
{
|
|
2024
|
+
className: "function",
|
|
2025
|
+
// we have to count the parens to make sure we actually have the
|
|
2026
|
+
// correct bounding ( ) before the =>. There could be any number of
|
|
2027
|
+
// sub-expressions inside also surrounded by parens.
|
|
2028
|
+
begin: be,
|
|
2029
|
+
returnBegin: !0,
|
|
2030
|
+
end: "\\s*=>",
|
|
2031
|
+
contains: [
|
|
2032
|
+
{
|
|
2033
|
+
className: "params",
|
|
2034
|
+
variants: [
|
|
2035
|
+
{
|
|
2036
|
+
begin: e.UNDERSCORE_IDENT_RE,
|
|
2037
|
+
relevance: 0
|
|
2038
|
+
},
|
|
2039
|
+
{
|
|
2040
|
+
className: null,
|
|
2041
|
+
begin: /\(\s*\)/,
|
|
2042
|
+
skip: !0
|
|
2043
|
+
},
|
|
2044
|
+
{
|
|
2045
|
+
begin: /\(/,
|
|
2046
|
+
end: /\)/,
|
|
2047
|
+
excludeBegin: !0,
|
|
2048
|
+
excludeEnd: !0,
|
|
2049
|
+
keywords: r,
|
|
2050
|
+
contains: R
|
|
2051
|
+
}
|
|
2052
|
+
]
|
|
2053
|
+
}
|
|
2054
|
+
]
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
// could be a comma delimited list of params to a function call
|
|
2058
|
+
begin: /,/,
|
|
2059
|
+
relevance: 0
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
match: /\s+/,
|
|
2063
|
+
relevance: 0
|
|
2064
|
+
},
|
|
2065
|
+
{
|
|
2066
|
+
// JSX
|
|
2067
|
+
variants: [
|
|
2068
|
+
{ begin: l.begin, end: l.end },
|
|
2069
|
+
{ match: c },
|
|
2070
|
+
{
|
|
2071
|
+
begin: i.begin,
|
|
2072
|
+
// we carefully check the opening tag to see if it truly
|
|
2073
|
+
// is a tag and not a false positive
|
|
2074
|
+
"on:begin": i.isTrulyOpeningTag,
|
|
2075
|
+
end: i.end
|
|
2076
|
+
}
|
|
2077
|
+
],
|
|
2078
|
+
subLanguage: "xml",
|
|
2079
|
+
contains: [
|
|
2080
|
+
{
|
|
2081
|
+
begin: i.begin,
|
|
2082
|
+
end: i.end,
|
|
2083
|
+
skip: !0,
|
|
2084
|
+
contains: ["self"]
|
|
2085
|
+
}
|
|
2086
|
+
]
|
|
2087
|
+
}
|
|
2088
|
+
]
|
|
2089
|
+
},
|
|
2090
|
+
z,
|
|
2091
|
+
{
|
|
2092
|
+
// prevent this from getting swallowed up by function
|
|
2093
|
+
// since they appear "function like"
|
|
2094
|
+
beginKeywords: "while if switch catch for"
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
// we have to count the parens to make sure we actually have the correct
|
|
2098
|
+
// bounding ( ). There could be any number of sub-expressions inside
|
|
2099
|
+
// also surrounded by parens.
|
|
2100
|
+
begin: "\\b(?!function)" + e.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
2101
|
+
// end parens
|
|
2102
|
+
returnBegin: !0,
|
|
2103
|
+
label: "func.def",
|
|
2104
|
+
contains: [
|
|
2105
|
+
L,
|
|
2106
|
+
e.inherit(e.TITLE_MODE, { begin: s, className: "title.function" })
|
|
2107
|
+
]
|
|
2108
|
+
},
|
|
2109
|
+
// catch ... so it won't trigger the property rule below
|
|
2110
|
+
{
|
|
2111
|
+
match: /\.\.\./,
|
|
2112
|
+
relevance: 0
|
|
2113
|
+
},
|
|
2114
|
+
Re,
|
|
2115
|
+
// hack: prevents detection of keywords in some circumstances
|
|
2116
|
+
// .keyword()
|
|
2117
|
+
// $keyword = x
|
|
2118
|
+
{
|
|
2119
|
+
match: "\\$" + s,
|
|
2120
|
+
relevance: 0
|
|
2121
|
+
},
|
|
2122
|
+
{
|
|
2123
|
+
match: [/\bconstructor(?=\s*\()/],
|
|
2124
|
+
className: { 1: "title.function" },
|
|
2125
|
+
contains: [L]
|
|
2126
|
+
},
|
|
2127
|
+
oe,
|
|
2128
|
+
ne,
|
|
2129
|
+
D,
|
|
2130
|
+
se,
|
|
2131
|
+
{
|
|
2132
|
+
match: /\$[(.]/
|
|
2133
|
+
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
2134
|
+
}
|
|
2135
|
+
]
|
|
2136
|
+
};
|
|
2137
|
+
}
|
|
2138
|
+
function qt(e) {
|
|
2139
|
+
const n = {
|
|
2140
|
+
className: "attr",
|
|
2141
|
+
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
2142
|
+
relevance: 1.01
|
|
2143
|
+
}, t = {
|
|
2144
|
+
match: /[{}[\],:]/,
|
|
2145
|
+
className: "punctuation",
|
|
2146
|
+
relevance: 0
|
|
2147
|
+
}, s = [
|
|
2148
|
+
"true",
|
|
2149
|
+
"false",
|
|
2150
|
+
"null"
|
|
2151
|
+
], l = {
|
|
2152
|
+
scope: "literal",
|
|
2153
|
+
beginKeywords: s.join(" ")
|
|
2154
|
+
};
|
|
2155
|
+
return {
|
|
2156
|
+
name: "JSON",
|
|
2157
|
+
keywords: {
|
|
2158
|
+
literal: s
|
|
2159
|
+
},
|
|
2160
|
+
contains: [
|
|
2161
|
+
n,
|
|
2162
|
+
t,
|
|
2163
|
+
e.QUOTE_STRING_MODE,
|
|
2164
|
+
l,
|
|
2165
|
+
e.C_NUMBER_MODE,
|
|
2166
|
+
e.C_LINE_COMMENT_MODE,
|
|
2167
|
+
e.C_BLOCK_COMMENT_MODE
|
|
2168
|
+
],
|
|
2169
|
+
illegal: "\\S"
|
|
2170
|
+
};
|
|
2171
|
+
}
|
|
2172
|
+
function Yt(e) {
|
|
2173
|
+
const n = "true false yes no null", t = "[\\w#;/?:@&=+$,.~*'()[\\]]+", s = {
|
|
2174
|
+
className: "attr",
|
|
2175
|
+
variants: [
|
|
2176
|
+
{ begin: "\\w[\\w :\\/.-]*:(?=[ ]|$)" },
|
|
2177
|
+
{
|
|
2178
|
+
// double quoted keys
|
|
2179
|
+
begin: '"\\w[\\w :\\/.-]*":(?=[ ]|$)'
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
// single quoted keys
|
|
2183
|
+
begin: "'\\w[\\w :\\/.-]*':(?=[ ]|$)"
|
|
2184
|
+
}
|
|
2185
|
+
]
|
|
2186
|
+
}, l = {
|
|
2187
|
+
className: "template-variable",
|
|
2188
|
+
variants: [
|
|
2189
|
+
{
|
|
2190
|
+
// jinja templates Ansible
|
|
2191
|
+
begin: /\{\{/,
|
|
2192
|
+
end: /\}\}/
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
// Ruby i18n
|
|
2196
|
+
begin: /%\{/,
|
|
2197
|
+
end: /\}/
|
|
2198
|
+
}
|
|
2199
|
+
]
|
|
2200
|
+
}, c = {
|
|
2201
|
+
className: "string",
|
|
2202
|
+
relevance: 0,
|
|
2203
|
+
variants: [
|
|
2204
|
+
{
|
|
2205
|
+
begin: /'/,
|
|
2206
|
+
end: /'/
|
|
2207
|
+
},
|
|
2208
|
+
{
|
|
2209
|
+
begin: /"/,
|
|
2210
|
+
end: /"/
|
|
2211
|
+
},
|
|
2212
|
+
{ begin: /\S+/ }
|
|
2213
|
+
],
|
|
2214
|
+
contains: [
|
|
2215
|
+
e.BACKSLASH_ESCAPE,
|
|
2216
|
+
l
|
|
2217
|
+
]
|
|
2218
|
+
}, i = e.inherit(c, { variants: [
|
|
2219
|
+
{
|
|
2220
|
+
begin: /'/,
|
|
2221
|
+
end: /'/
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
begin: /"/,
|
|
2225
|
+
end: /"/
|
|
2226
|
+
},
|
|
2227
|
+
{ begin: /[^\s,{}[\]]+/ }
|
|
2228
|
+
] }), r = "[0-9]{4}(-[0-9][0-9]){0,2}", a = "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?", o = "(\\.[0-9]*)?", p = "([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?", _ = {
|
|
2229
|
+
className: "number",
|
|
2230
|
+
begin: "\\b" + r + a + o + p + "\\b"
|
|
2231
|
+
}, f = {
|
|
2232
|
+
end: ",",
|
|
2233
|
+
endsWithParent: !0,
|
|
2234
|
+
excludeEnd: !0,
|
|
2235
|
+
keywords: n,
|
|
2236
|
+
relevance: 0
|
|
2237
|
+
}, N = {
|
|
2238
|
+
begin: /\{/,
|
|
2239
|
+
end: /\}/,
|
|
2240
|
+
contains: [f],
|
|
2241
|
+
illegal: "\\n",
|
|
2242
|
+
relevance: 0
|
|
2243
|
+
}, h = {
|
|
2244
|
+
begin: "\\[",
|
|
2245
|
+
end: "\\]",
|
|
2246
|
+
contains: [f],
|
|
2247
|
+
illegal: "\\n",
|
|
2248
|
+
relevance: 0
|
|
2249
|
+
}, g = [
|
|
2250
|
+
s,
|
|
2251
|
+
{
|
|
2252
|
+
className: "meta",
|
|
2253
|
+
begin: "^---\\s*$",
|
|
2254
|
+
relevance: 10
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
// multi line string
|
|
2258
|
+
// Blocks start with a | or > followed by a newline
|
|
2259
|
+
//
|
|
2260
|
+
// Indentation of subsequent lines must be the same to
|
|
2261
|
+
// be considered part of the block
|
|
2262
|
+
className: "string",
|
|
2263
|
+
begin: "[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
// Ruby/Rails erb
|
|
2267
|
+
begin: "<%[%=-]?",
|
|
2268
|
+
end: "[%-]?%>",
|
|
2269
|
+
subLanguage: "ruby",
|
|
2270
|
+
excludeBegin: !0,
|
|
2271
|
+
excludeEnd: !0,
|
|
2272
|
+
relevance: 0
|
|
2273
|
+
},
|
|
2274
|
+
{
|
|
2275
|
+
// named tags
|
|
2276
|
+
className: "type",
|
|
2277
|
+
begin: "!\\w+!" + t
|
|
2278
|
+
},
|
|
2279
|
+
// https://yaml.org/spec/1.2/spec.html#id2784064
|
|
2280
|
+
{
|
|
2281
|
+
// verbatim tags
|
|
2282
|
+
className: "type",
|
|
2283
|
+
begin: "!<" + t + ">"
|
|
2284
|
+
},
|
|
2285
|
+
{
|
|
2286
|
+
// primary tags
|
|
2287
|
+
className: "type",
|
|
2288
|
+
begin: "!" + t
|
|
2289
|
+
},
|
|
2290
|
+
{
|
|
2291
|
+
// secondary tags
|
|
2292
|
+
className: "type",
|
|
2293
|
+
begin: "!!" + t
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
// fragment id &ref
|
|
2297
|
+
className: "meta",
|
|
2298
|
+
begin: "&" + e.UNDERSCORE_IDENT_RE + "$"
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
// fragment reference *ref
|
|
2302
|
+
className: "meta",
|
|
2303
|
+
begin: "\\*" + e.UNDERSCORE_IDENT_RE + "$"
|
|
2304
|
+
},
|
|
2305
|
+
{
|
|
2306
|
+
// array listing
|
|
2307
|
+
className: "bullet",
|
|
2308
|
+
// TODO: remove |$ hack when we have proper look-ahead support
|
|
2309
|
+
begin: "-(?=[ ]|$)",
|
|
2310
|
+
relevance: 0
|
|
2311
|
+
},
|
|
2312
|
+
e.HASH_COMMENT_MODE,
|
|
2313
|
+
{
|
|
2314
|
+
beginKeywords: n,
|
|
2315
|
+
keywords: { literal: n }
|
|
2316
|
+
},
|
|
2317
|
+
_,
|
|
2318
|
+
// numbers are any valid C-style number that
|
|
2319
|
+
// sit isolated from other words
|
|
2320
|
+
{
|
|
2321
|
+
className: "number",
|
|
2322
|
+
begin: e.C_NUMBER_RE + "\\b",
|
|
2323
|
+
relevance: 0
|
|
2324
|
+
},
|
|
2325
|
+
N,
|
|
2326
|
+
h,
|
|
2327
|
+
c
|
|
2328
|
+
], A = [...g];
|
|
2329
|
+
return A.pop(), A.push(i), f.contains = A, {
|
|
2330
|
+
name: "YAML",
|
|
2331
|
+
case_insensitive: !0,
|
|
2332
|
+
aliases: ["yml"],
|
|
2333
|
+
contains: g
|
|
2334
|
+
};
|
|
2335
|
+
}
|
|
2336
|
+
function Zt(e) {
|
|
2337
|
+
return {
|
|
2338
|
+
name: "Plain text",
|
|
2339
|
+
aliases: [
|
|
2340
|
+
"text",
|
|
2341
|
+
"txt"
|
|
2342
|
+
],
|
|
2343
|
+
disableAutodetect: !0
|
|
2344
|
+
};
|
|
2345
|
+
}
|
|
2346
|
+
function Qt(e) {
|
|
2347
|
+
const n = e.regex, t = /[\p{XID_Start}_]\p{XID_Continue}*/u, s = [
|
|
2348
|
+
"and",
|
|
2349
|
+
"as",
|
|
2350
|
+
"assert",
|
|
2351
|
+
"async",
|
|
2352
|
+
"await",
|
|
2353
|
+
"break",
|
|
2354
|
+
"case",
|
|
2355
|
+
"class",
|
|
2356
|
+
"continue",
|
|
2357
|
+
"def",
|
|
2358
|
+
"del",
|
|
2359
|
+
"elif",
|
|
2360
|
+
"else",
|
|
2361
|
+
"except",
|
|
2362
|
+
"finally",
|
|
2363
|
+
"for",
|
|
2364
|
+
"from",
|
|
2365
|
+
"global",
|
|
2366
|
+
"if",
|
|
2367
|
+
"import",
|
|
2368
|
+
"in",
|
|
2369
|
+
"is",
|
|
2370
|
+
"lambda",
|
|
2371
|
+
"match",
|
|
2372
|
+
"nonlocal|10",
|
|
2373
|
+
"not",
|
|
2374
|
+
"or",
|
|
2375
|
+
"pass",
|
|
2376
|
+
"raise",
|
|
2377
|
+
"return",
|
|
2378
|
+
"try",
|
|
2379
|
+
"while",
|
|
2380
|
+
"with",
|
|
2381
|
+
"yield"
|
|
2382
|
+
], r = {
|
|
2383
|
+
$pattern: /[A-Za-z]\w+|__\w+__/,
|
|
2384
|
+
keyword: s,
|
|
2385
|
+
built_in: [
|
|
2386
|
+
"__import__",
|
|
2387
|
+
"abs",
|
|
2388
|
+
"all",
|
|
2389
|
+
"any",
|
|
2390
|
+
"ascii",
|
|
2391
|
+
"bin",
|
|
2392
|
+
"bool",
|
|
2393
|
+
"breakpoint",
|
|
2394
|
+
"bytearray",
|
|
2395
|
+
"bytes",
|
|
2396
|
+
"callable",
|
|
2397
|
+
"chr",
|
|
2398
|
+
"classmethod",
|
|
2399
|
+
"compile",
|
|
2400
|
+
"complex",
|
|
2401
|
+
"delattr",
|
|
2402
|
+
"dict",
|
|
2403
|
+
"dir",
|
|
2404
|
+
"divmod",
|
|
2405
|
+
"enumerate",
|
|
2406
|
+
"eval",
|
|
2407
|
+
"exec",
|
|
2408
|
+
"filter",
|
|
2409
|
+
"float",
|
|
2410
|
+
"format",
|
|
2411
|
+
"frozenset",
|
|
2412
|
+
"getattr",
|
|
2413
|
+
"globals",
|
|
2414
|
+
"hasattr",
|
|
2415
|
+
"hash",
|
|
2416
|
+
"help",
|
|
2417
|
+
"hex",
|
|
2418
|
+
"id",
|
|
2419
|
+
"input",
|
|
2420
|
+
"int",
|
|
2421
|
+
"isinstance",
|
|
2422
|
+
"issubclass",
|
|
2423
|
+
"iter",
|
|
2424
|
+
"len",
|
|
2425
|
+
"list",
|
|
2426
|
+
"locals",
|
|
2427
|
+
"map",
|
|
2428
|
+
"max",
|
|
2429
|
+
"memoryview",
|
|
2430
|
+
"min",
|
|
2431
|
+
"next",
|
|
2432
|
+
"object",
|
|
2433
|
+
"oct",
|
|
2434
|
+
"open",
|
|
2435
|
+
"ord",
|
|
2436
|
+
"pow",
|
|
2437
|
+
"print",
|
|
2438
|
+
"property",
|
|
2439
|
+
"range",
|
|
2440
|
+
"repr",
|
|
2441
|
+
"reversed",
|
|
2442
|
+
"round",
|
|
2443
|
+
"set",
|
|
2444
|
+
"setattr",
|
|
2445
|
+
"slice",
|
|
2446
|
+
"sorted",
|
|
2447
|
+
"staticmethod",
|
|
2448
|
+
"str",
|
|
2449
|
+
"sum",
|
|
2450
|
+
"super",
|
|
2451
|
+
"tuple",
|
|
2452
|
+
"type",
|
|
2453
|
+
"vars",
|
|
2454
|
+
"zip"
|
|
2455
|
+
],
|
|
2456
|
+
literal: [
|
|
2457
|
+
"__debug__",
|
|
2458
|
+
"Ellipsis",
|
|
2459
|
+
"False",
|
|
2460
|
+
"None",
|
|
2461
|
+
"NotImplemented",
|
|
2462
|
+
"True"
|
|
2463
|
+
],
|
|
2464
|
+
type: [
|
|
2465
|
+
"Any",
|
|
2466
|
+
"Callable",
|
|
2467
|
+
"Coroutine",
|
|
2468
|
+
"Dict",
|
|
2469
|
+
"List",
|
|
2470
|
+
"Literal",
|
|
2471
|
+
"Generic",
|
|
2472
|
+
"Optional",
|
|
2473
|
+
"Sequence",
|
|
2474
|
+
"Set",
|
|
2475
|
+
"Tuple",
|
|
2476
|
+
"Type",
|
|
2477
|
+
"Union"
|
|
2478
|
+
]
|
|
2479
|
+
}, a = {
|
|
2480
|
+
className: "meta",
|
|
2481
|
+
begin: /^(>>>|\.\.\.) /
|
|
2482
|
+
}, o = {
|
|
2483
|
+
className: "subst",
|
|
2484
|
+
begin: /\{/,
|
|
2485
|
+
end: /\}/,
|
|
2486
|
+
keywords: r,
|
|
2487
|
+
illegal: /#/
|
|
2488
|
+
}, p = {
|
|
2489
|
+
begin: /\{\{/,
|
|
2490
|
+
relevance: 0
|
|
2491
|
+
}, _ = {
|
|
2492
|
+
className: "string",
|
|
2493
|
+
contains: [e.BACKSLASH_ESCAPE],
|
|
2494
|
+
variants: [
|
|
2495
|
+
{
|
|
2496
|
+
begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,
|
|
2497
|
+
end: /'''/,
|
|
2498
|
+
contains: [
|
|
2499
|
+
e.BACKSLASH_ESCAPE,
|
|
2500
|
+
a
|
|
2501
|
+
],
|
|
2502
|
+
relevance: 10
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,
|
|
2506
|
+
end: /"""/,
|
|
2507
|
+
contains: [
|
|
2508
|
+
e.BACKSLASH_ESCAPE,
|
|
2509
|
+
a
|
|
2510
|
+
],
|
|
2511
|
+
relevance: 10
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
begin: /([fF][rR]|[rR][fF]|[fF])'''/,
|
|
2515
|
+
end: /'''/,
|
|
2516
|
+
contains: [
|
|
2517
|
+
e.BACKSLASH_ESCAPE,
|
|
2518
|
+
a,
|
|
2519
|
+
p,
|
|
2520
|
+
o
|
|
2521
|
+
]
|
|
2522
|
+
},
|
|
2523
|
+
{
|
|
2524
|
+
begin: /([fF][rR]|[rR][fF]|[fF])"""/,
|
|
2525
|
+
end: /"""/,
|
|
2526
|
+
contains: [
|
|
2527
|
+
e.BACKSLASH_ESCAPE,
|
|
2528
|
+
a,
|
|
2529
|
+
p,
|
|
2530
|
+
o
|
|
2531
|
+
]
|
|
2532
|
+
},
|
|
2533
|
+
{
|
|
2534
|
+
begin: /([uU]|[rR])'/,
|
|
2535
|
+
end: /'/,
|
|
2536
|
+
relevance: 10
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
begin: /([uU]|[rR])"/,
|
|
2540
|
+
end: /"/,
|
|
2541
|
+
relevance: 10
|
|
2542
|
+
},
|
|
2543
|
+
{
|
|
2544
|
+
begin: /([bB]|[bB][rR]|[rR][bB])'/,
|
|
2545
|
+
end: /'/
|
|
2546
|
+
},
|
|
2547
|
+
{
|
|
2548
|
+
begin: /([bB]|[bB][rR]|[rR][bB])"/,
|
|
2549
|
+
end: /"/
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
begin: /([fF][rR]|[rR][fF]|[fF])'/,
|
|
2553
|
+
end: /'/,
|
|
2554
|
+
contains: [
|
|
2555
|
+
e.BACKSLASH_ESCAPE,
|
|
2556
|
+
p,
|
|
2557
|
+
o
|
|
2558
|
+
]
|
|
2559
|
+
},
|
|
2560
|
+
{
|
|
2561
|
+
begin: /([fF][rR]|[rR][fF]|[fF])"/,
|
|
2562
|
+
end: /"/,
|
|
2563
|
+
contains: [
|
|
2564
|
+
e.BACKSLASH_ESCAPE,
|
|
2565
|
+
p,
|
|
2566
|
+
o
|
|
2567
|
+
]
|
|
2568
|
+
},
|
|
2569
|
+
e.APOS_STRING_MODE,
|
|
2570
|
+
e.QUOTE_STRING_MODE
|
|
2571
|
+
]
|
|
2572
|
+
}, f = "[0-9](_?[0-9])*", N = `(\\b(${f}))?\\.(${f})|\\b(${f})\\.`, h = `\\b|${s.join("|")}`, g = {
|
|
2573
|
+
className: "number",
|
|
2574
|
+
relevance: 0,
|
|
2575
|
+
variants: [
|
|
2576
|
+
// exponentfloat, pointfloat
|
|
2577
|
+
// https://docs.python.org/3.9/reference/lexical_analysis.html#floating-point-literals
|
|
2578
|
+
// optionally imaginary
|
|
2579
|
+
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
2580
|
+
// Note: no leading \b because floats can start with a decimal point
|
|
2581
|
+
// and we don't want to mishandle e.g. `fn(.5)`,
|
|
2582
|
+
// no trailing \b for pointfloat because it can end with a decimal point
|
|
2583
|
+
// and we don't want to mishandle e.g. `0..hex()`; this should be safe
|
|
2584
|
+
// because both MUST contain a decimal point and so cannot be confused with
|
|
2585
|
+
// the interior part of an identifier
|
|
2586
|
+
{
|
|
2587
|
+
begin: `(\\b(${f})|(${N}))[eE][+-]?(${f})[jJ]?(?=${h})`
|
|
2588
|
+
},
|
|
2589
|
+
{
|
|
2590
|
+
begin: `(${N})[jJ]?`
|
|
2591
|
+
},
|
|
2592
|
+
// decinteger, bininteger, octinteger, hexinteger
|
|
2593
|
+
// https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
|
|
2594
|
+
// optionally "long" in Python 2
|
|
2595
|
+
// https://docs.python.org/2.7/reference/lexical_analysis.html#integer-and-long-integer-literals
|
|
2596
|
+
// decinteger is optionally imaginary
|
|
2597
|
+
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
2598
|
+
{
|
|
2599
|
+
begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
begin: `\\b0[bB](_?[01])+[lL]?(?=${h})`
|
|
2603
|
+
},
|
|
2604
|
+
{
|
|
2605
|
+
begin: `\\b0[oO](_?[0-7])+[lL]?(?=${h})`
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`
|
|
2609
|
+
},
|
|
2610
|
+
// imagnumber (digitpart-based)
|
|
2611
|
+
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
2612
|
+
{
|
|
2613
|
+
begin: `\\b(${f})[jJ](?=${h})`
|
|
2614
|
+
}
|
|
2615
|
+
]
|
|
2616
|
+
}, A = {
|
|
2617
|
+
className: "comment",
|
|
2618
|
+
begin: n.lookahead(/# type:/),
|
|
2619
|
+
end: /$/,
|
|
2620
|
+
keywords: r,
|
|
2621
|
+
contains: [
|
|
2622
|
+
{
|
|
2623
|
+
// prevent keywords from coloring `type`
|
|
2624
|
+
begin: /# type:/
|
|
2625
|
+
},
|
|
2626
|
+
// comment within a datatype comment includes no keywords
|
|
2627
|
+
{
|
|
2628
|
+
begin: /#/,
|
|
2629
|
+
end: /\b\B/,
|
|
2630
|
+
endsWithParent: !0
|
|
2631
|
+
}
|
|
2632
|
+
]
|
|
2633
|
+
}, S = {
|
|
2634
|
+
className: "params",
|
|
2635
|
+
variants: [
|
|
2636
|
+
// Exclude params in functions without params
|
|
2637
|
+
{
|
|
2638
|
+
className: "",
|
|
2639
|
+
begin: /\(\s*\)/,
|
|
2640
|
+
skip: !0
|
|
2641
|
+
},
|
|
2642
|
+
{
|
|
2643
|
+
begin: /\(/,
|
|
2644
|
+
end: /\)/,
|
|
2645
|
+
excludeBegin: !0,
|
|
2646
|
+
excludeEnd: !0,
|
|
2647
|
+
keywords: r,
|
|
2648
|
+
contains: [
|
|
2649
|
+
"self",
|
|
2650
|
+
a,
|
|
2651
|
+
g,
|
|
2652
|
+
_,
|
|
2653
|
+
e.HASH_COMMENT_MODE
|
|
2654
|
+
]
|
|
2655
|
+
}
|
|
2656
|
+
]
|
|
2657
|
+
};
|
|
2658
|
+
return o.contains = [
|
|
2659
|
+
_,
|
|
2660
|
+
g,
|
|
2661
|
+
a
|
|
2662
|
+
], {
|
|
2663
|
+
name: "Python",
|
|
2664
|
+
aliases: [
|
|
2665
|
+
"py",
|
|
2666
|
+
"gyp",
|
|
2667
|
+
"ipython"
|
|
2668
|
+
],
|
|
2669
|
+
unicodeRegex: !0,
|
|
2670
|
+
keywords: r,
|
|
2671
|
+
illegal: /(<\/|->|\?)|=>/,
|
|
2672
|
+
contains: [
|
|
2673
|
+
a,
|
|
2674
|
+
g,
|
|
2675
|
+
{
|
|
2676
|
+
// very common convention
|
|
2677
|
+
begin: /\bself\b/
|
|
2678
|
+
},
|
|
2679
|
+
{
|
|
2680
|
+
// eat "if" prior to string so that it won't accidentally be
|
|
2681
|
+
// labeled as an f-string
|
|
2682
|
+
beginKeywords: "if",
|
|
2683
|
+
relevance: 0
|
|
2684
|
+
},
|
|
2685
|
+
_,
|
|
2686
|
+
A,
|
|
2687
|
+
e.HASH_COMMENT_MODE,
|
|
2688
|
+
{
|
|
2689
|
+
match: [
|
|
2690
|
+
/\bdef/,
|
|
2691
|
+
/\s+/,
|
|
2692
|
+
t
|
|
2693
|
+
],
|
|
2694
|
+
scope: {
|
|
2695
|
+
1: "keyword",
|
|
2696
|
+
3: "title.function"
|
|
2697
|
+
},
|
|
2698
|
+
contains: [S]
|
|
2699
|
+
},
|
|
2700
|
+
{
|
|
2701
|
+
variants: [
|
|
2702
|
+
{
|
|
2703
|
+
match: [
|
|
2704
|
+
/\bclass/,
|
|
2705
|
+
/\s+/,
|
|
2706
|
+
t,
|
|
2707
|
+
/\s*/,
|
|
2708
|
+
/\(\s*/,
|
|
2709
|
+
t,
|
|
2710
|
+
/\s*\)/
|
|
2711
|
+
]
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
match: [
|
|
2715
|
+
/\bclass/,
|
|
2716
|
+
/\s+/,
|
|
2717
|
+
t
|
|
2718
|
+
]
|
|
2719
|
+
}
|
|
2720
|
+
],
|
|
2721
|
+
scope: {
|
|
2722
|
+
1: "keyword",
|
|
2723
|
+
3: "title.class",
|
|
2724
|
+
6: "title.class.inherited"
|
|
2725
|
+
}
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
className: "meta",
|
|
2729
|
+
begin: /^[\t ]*@/,
|
|
2730
|
+
end: /(?=#)|$/,
|
|
2731
|
+
contains: [
|
|
2732
|
+
g,
|
|
2733
|
+
S,
|
|
2734
|
+
_
|
|
2735
|
+
]
|
|
2736
|
+
}
|
|
2737
|
+
]
|
|
2738
|
+
};
|
|
2739
|
+
}
|
|
2740
|
+
var ie = "[0-9](_*[0-9])*", Ne = `\\.(${ie})`, Te = "[0-9a-fA-F](_*[0-9a-fA-F])*", on = {
|
|
2741
|
+
className: "number",
|
|
2742
|
+
variants: [
|
|
2743
|
+
// DecimalFloatingPointLiteral
|
|
2744
|
+
// including ExponentPart
|
|
2745
|
+
{ begin: `(\\b(${ie})((${Ne})|\\.)?|(${Ne}))[eE][+-]?(${ie})[fFdD]?\\b` },
|
|
2746
|
+
// excluding ExponentPart
|
|
2747
|
+
{ begin: `\\b(${ie})((${Ne})[fFdD]?\\b|\\.([fFdD]\\b)?)` },
|
|
2748
|
+
{ begin: `(${Ne})[fFdD]?\\b` },
|
|
2749
|
+
{ begin: `\\b(${ie})[fFdD]\\b` },
|
|
2750
|
+
// HexadecimalFloatingPointLiteral
|
|
2751
|
+
{ begin: `\\b0[xX]((${Te})\\.?|(${Te})?\\.(${Te}))[pP][+-]?(${ie})[fFdD]?\\b` },
|
|
2752
|
+
// DecimalIntegerLiteral
|
|
2753
|
+
{ begin: "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" },
|
|
2754
|
+
// HexIntegerLiteral
|
|
2755
|
+
{ begin: `\\b0[xX](${Te})[lL]?\\b` },
|
|
2756
|
+
// OctalIntegerLiteral
|
|
2757
|
+
{ begin: "\\b0(_*[0-7])*[lL]?\\b" },
|
|
2758
|
+
// BinaryIntegerLiteral
|
|
2759
|
+
{ begin: "\\b0[bB][01](_*[01])*[lL]?\\b" }
|
|
2760
|
+
],
|
|
2761
|
+
relevance: 0
|
|
2762
|
+
};
|
|
2763
|
+
function Mn(e, n, t) {
|
|
2764
|
+
return t === -1 ? "" : e.replace(n, (s) => Mn(e, n, t - 1));
|
|
2765
|
+
}
|
|
2766
|
+
function Xt(e) {
|
|
2767
|
+
const n = e.regex, t = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", s = t + Mn("(?:<" + t + "~~~(?:\\s*,\\s*" + t + "~~~)*>)?", /~~~/g, 2), a = {
|
|
2768
|
+
keyword: [
|
|
2769
|
+
"synchronized",
|
|
2770
|
+
"abstract",
|
|
2771
|
+
"private",
|
|
2772
|
+
"var",
|
|
2773
|
+
"static",
|
|
2774
|
+
"if",
|
|
2775
|
+
"const ",
|
|
2776
|
+
"for",
|
|
2777
|
+
"while",
|
|
2778
|
+
"strictfp",
|
|
2779
|
+
"finally",
|
|
2780
|
+
"protected",
|
|
2781
|
+
"import",
|
|
2782
|
+
"native",
|
|
2783
|
+
"final",
|
|
2784
|
+
"void",
|
|
2785
|
+
"enum",
|
|
2786
|
+
"else",
|
|
2787
|
+
"break",
|
|
2788
|
+
"transient",
|
|
2789
|
+
"catch",
|
|
2790
|
+
"instanceof",
|
|
2791
|
+
"volatile",
|
|
2792
|
+
"case",
|
|
2793
|
+
"assert",
|
|
2794
|
+
"package",
|
|
2795
|
+
"default",
|
|
2796
|
+
"public",
|
|
2797
|
+
"try",
|
|
2798
|
+
"switch",
|
|
2799
|
+
"continue",
|
|
2800
|
+
"throws",
|
|
2801
|
+
"protected",
|
|
2802
|
+
"public",
|
|
2803
|
+
"private",
|
|
2804
|
+
"module",
|
|
2805
|
+
"requires",
|
|
2806
|
+
"exports",
|
|
2807
|
+
"do",
|
|
2808
|
+
"sealed",
|
|
2809
|
+
"yield",
|
|
2810
|
+
"permits"
|
|
2811
|
+
],
|
|
2812
|
+
literal: [
|
|
2813
|
+
"false",
|
|
2814
|
+
"true",
|
|
2815
|
+
"null"
|
|
2816
|
+
],
|
|
2817
|
+
type: [
|
|
2818
|
+
"char",
|
|
2819
|
+
"boolean",
|
|
2820
|
+
"long",
|
|
2821
|
+
"float",
|
|
2822
|
+
"int",
|
|
2823
|
+
"byte",
|
|
2824
|
+
"short",
|
|
2825
|
+
"double"
|
|
2826
|
+
],
|
|
2827
|
+
built_in: [
|
|
2828
|
+
"super",
|
|
2829
|
+
"this"
|
|
2830
|
+
]
|
|
2831
|
+
}, o = {
|
|
2832
|
+
className: "meta",
|
|
2833
|
+
begin: "@" + t,
|
|
2834
|
+
contains: [
|
|
2835
|
+
{
|
|
2836
|
+
begin: /\(/,
|
|
2837
|
+
end: /\)/,
|
|
2838
|
+
contains: ["self"]
|
|
2839
|
+
// allow nested () inside our annotation
|
|
2840
|
+
}
|
|
2841
|
+
]
|
|
2842
|
+
}, p = {
|
|
2843
|
+
className: "params",
|
|
2844
|
+
begin: /\(/,
|
|
2845
|
+
end: /\)/,
|
|
2846
|
+
keywords: a,
|
|
2847
|
+
relevance: 0,
|
|
2848
|
+
contains: [e.C_BLOCK_COMMENT_MODE],
|
|
2849
|
+
endsParent: !0
|
|
2850
|
+
};
|
|
2851
|
+
return {
|
|
2852
|
+
name: "Java",
|
|
2853
|
+
aliases: ["jsp"],
|
|
2854
|
+
keywords: a,
|
|
2855
|
+
illegal: /<\/|#/,
|
|
2856
|
+
contains: [
|
|
2857
|
+
e.COMMENT(
|
|
2858
|
+
"/\\*\\*",
|
|
2859
|
+
"\\*/",
|
|
2860
|
+
{
|
|
2861
|
+
relevance: 0,
|
|
2862
|
+
contains: [
|
|
2863
|
+
{
|
|
2864
|
+
// eat up @'s in emails to prevent them to be recognized as doctags
|
|
2865
|
+
begin: /\w+@/,
|
|
2866
|
+
relevance: 0
|
|
2867
|
+
},
|
|
2868
|
+
{
|
|
2869
|
+
className: "doctag",
|
|
2870
|
+
begin: "@[A-Za-z]+"
|
|
2871
|
+
}
|
|
2872
|
+
]
|
|
2873
|
+
}
|
|
2874
|
+
),
|
|
2875
|
+
// relevance boost
|
|
2876
|
+
{
|
|
2877
|
+
begin: /import java\.[a-z]+\./,
|
|
2878
|
+
keywords: "import",
|
|
2879
|
+
relevance: 2
|
|
2880
|
+
},
|
|
2881
|
+
e.C_LINE_COMMENT_MODE,
|
|
2882
|
+
e.C_BLOCK_COMMENT_MODE,
|
|
2883
|
+
{
|
|
2884
|
+
begin: /"""/,
|
|
2885
|
+
end: /"""/,
|
|
2886
|
+
className: "string",
|
|
2887
|
+
contains: [e.BACKSLASH_ESCAPE]
|
|
2888
|
+
},
|
|
2889
|
+
e.APOS_STRING_MODE,
|
|
2890
|
+
e.QUOTE_STRING_MODE,
|
|
2891
|
+
{
|
|
2892
|
+
match: [
|
|
2893
|
+
/\b(?:class|interface|enum|extends|implements|new)/,
|
|
2894
|
+
/\s+/,
|
|
2895
|
+
t
|
|
2896
|
+
],
|
|
2897
|
+
className: {
|
|
2898
|
+
1: "keyword",
|
|
2899
|
+
3: "title.class"
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2902
|
+
{
|
|
2903
|
+
// Exceptions for hyphenated keywords
|
|
2904
|
+
match: /non-sealed/,
|
|
2905
|
+
scope: "keyword"
|
|
2906
|
+
},
|
|
2907
|
+
{
|
|
2908
|
+
begin: [
|
|
2909
|
+
n.concat(/(?!else)/, t),
|
|
2910
|
+
/\s+/,
|
|
2911
|
+
t,
|
|
2912
|
+
/\s+/,
|
|
2913
|
+
/=(?!=)/
|
|
2914
|
+
],
|
|
2915
|
+
className: {
|
|
2916
|
+
1: "type",
|
|
2917
|
+
3: "variable",
|
|
2918
|
+
5: "operator"
|
|
2919
|
+
}
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
begin: [
|
|
2923
|
+
/record/,
|
|
2924
|
+
/\s+/,
|
|
2925
|
+
t
|
|
2926
|
+
],
|
|
2927
|
+
className: {
|
|
2928
|
+
1: "keyword",
|
|
2929
|
+
3: "title.class"
|
|
2930
|
+
},
|
|
2931
|
+
contains: [
|
|
2932
|
+
p,
|
|
2933
|
+
e.C_LINE_COMMENT_MODE,
|
|
2934
|
+
e.C_BLOCK_COMMENT_MODE
|
|
2935
|
+
]
|
|
2936
|
+
},
|
|
2937
|
+
{
|
|
2938
|
+
// Expression keywords prevent 'keyword Name(...)' from being
|
|
2939
|
+
// recognized as a function definition
|
|
2940
|
+
beginKeywords: "new throw return else",
|
|
2941
|
+
relevance: 0
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
begin: [
|
|
2945
|
+
"(?:" + s + "\\s+)",
|
|
2946
|
+
e.UNDERSCORE_IDENT_RE,
|
|
2947
|
+
/\s*(?=\()/
|
|
2948
|
+
],
|
|
2949
|
+
className: { 2: "title.function" },
|
|
2950
|
+
keywords: a,
|
|
2951
|
+
contains: [
|
|
2952
|
+
{
|
|
2953
|
+
className: "params",
|
|
2954
|
+
begin: /\(/,
|
|
2955
|
+
end: /\)/,
|
|
2956
|
+
keywords: a,
|
|
2957
|
+
relevance: 0,
|
|
2958
|
+
contains: [
|
|
2959
|
+
o,
|
|
2960
|
+
e.APOS_STRING_MODE,
|
|
2961
|
+
e.QUOTE_STRING_MODE,
|
|
2962
|
+
on,
|
|
2963
|
+
e.C_BLOCK_COMMENT_MODE
|
|
2964
|
+
]
|
|
2965
|
+
},
|
|
2966
|
+
e.C_LINE_COMMENT_MODE,
|
|
2967
|
+
e.C_BLOCK_COMMENT_MODE
|
|
2968
|
+
]
|
|
2969
|
+
},
|
|
2970
|
+
on,
|
|
2971
|
+
o
|
|
2972
|
+
]
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
function Vt(e) {
|
|
2976
|
+
const n = e.regex, t = {}, s = {
|
|
2977
|
+
begin: /\$\{/,
|
|
2978
|
+
end: /\}/,
|
|
2979
|
+
contains: [
|
|
2980
|
+
"self",
|
|
2981
|
+
{
|
|
2982
|
+
begin: /:-/,
|
|
2983
|
+
contains: [t]
|
|
2984
|
+
}
|
|
2985
|
+
// default values
|
|
2986
|
+
]
|
|
2987
|
+
};
|
|
2988
|
+
Object.assign(t, {
|
|
2989
|
+
className: "variable",
|
|
2990
|
+
variants: [
|
|
2991
|
+
{ begin: n.concat(
|
|
2992
|
+
/\$[\w\d#@][\w\d_]*/,
|
|
2993
|
+
// negative look-ahead tries to avoid matching patterns that are not
|
|
2994
|
+
// Perl at all like $ident$, @ident@, etc.
|
|
2995
|
+
"(?![\\w\\d])(?![$])"
|
|
2996
|
+
) },
|
|
2997
|
+
s
|
|
2998
|
+
]
|
|
2999
|
+
});
|
|
3000
|
+
const l = {
|
|
3001
|
+
className: "subst",
|
|
3002
|
+
begin: /\$\(/,
|
|
3003
|
+
end: /\)/,
|
|
3004
|
+
contains: [e.BACKSLASH_ESCAPE]
|
|
3005
|
+
}, c = {
|
|
3006
|
+
begin: /<<-?\s*(?=\w+)/,
|
|
3007
|
+
starts: { contains: [
|
|
3008
|
+
e.END_SAME_AS_BEGIN({
|
|
3009
|
+
begin: /(\w+)/,
|
|
3010
|
+
end: /(\w+)/,
|
|
3011
|
+
className: "string"
|
|
3012
|
+
})
|
|
3013
|
+
] }
|
|
3014
|
+
}, i = {
|
|
3015
|
+
className: "string",
|
|
3016
|
+
begin: /"/,
|
|
3017
|
+
end: /"/,
|
|
3018
|
+
contains: [
|
|
3019
|
+
e.BACKSLASH_ESCAPE,
|
|
3020
|
+
t,
|
|
3021
|
+
l
|
|
3022
|
+
]
|
|
3023
|
+
};
|
|
3024
|
+
l.contains.push(i);
|
|
3025
|
+
const r = {
|
|
3026
|
+
className: "",
|
|
3027
|
+
begin: /\\"/
|
|
3028
|
+
}, a = {
|
|
3029
|
+
className: "string",
|
|
3030
|
+
begin: /'/,
|
|
3031
|
+
end: /'/
|
|
3032
|
+
}, o = {
|
|
3033
|
+
begin: /\$?\(\(/,
|
|
3034
|
+
end: /\)\)/,
|
|
3035
|
+
contains: [
|
|
3036
|
+
{
|
|
3037
|
+
begin: /\d+#[0-9a-f]+/,
|
|
3038
|
+
className: "number"
|
|
3039
|
+
},
|
|
3040
|
+
e.NUMBER_MODE,
|
|
3041
|
+
t
|
|
3042
|
+
]
|
|
3043
|
+
}, p = [
|
|
3044
|
+
"fish",
|
|
3045
|
+
"bash",
|
|
3046
|
+
"zsh",
|
|
3047
|
+
"sh",
|
|
3048
|
+
"csh",
|
|
3049
|
+
"ksh",
|
|
3050
|
+
"tcsh",
|
|
3051
|
+
"dash",
|
|
3052
|
+
"scsh"
|
|
3053
|
+
], _ = e.SHEBANG({
|
|
3054
|
+
binary: `(${p.join("|")})`,
|
|
3055
|
+
relevance: 10
|
|
3056
|
+
}), f = {
|
|
3057
|
+
className: "function",
|
|
3058
|
+
begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
|
|
3059
|
+
returnBegin: !0,
|
|
3060
|
+
contains: [e.inherit(e.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
|
|
3061
|
+
relevance: 0
|
|
3062
|
+
}, N = [
|
|
3063
|
+
"if",
|
|
3064
|
+
"then",
|
|
3065
|
+
"else",
|
|
3066
|
+
"elif",
|
|
3067
|
+
"fi",
|
|
3068
|
+
"for",
|
|
3069
|
+
"while",
|
|
3070
|
+
"in",
|
|
3071
|
+
"do",
|
|
3072
|
+
"done",
|
|
3073
|
+
"case",
|
|
3074
|
+
"esac",
|
|
3075
|
+
"function"
|
|
3076
|
+
], h = [
|
|
3077
|
+
"true",
|
|
3078
|
+
"false"
|
|
3079
|
+
], g = { match: /(\/[a-z._-]+)+/ }, A = [
|
|
3080
|
+
"break",
|
|
3081
|
+
"cd",
|
|
3082
|
+
"continue",
|
|
3083
|
+
"eval",
|
|
3084
|
+
"exec",
|
|
3085
|
+
"exit",
|
|
3086
|
+
"export",
|
|
3087
|
+
"getopts",
|
|
3088
|
+
"hash",
|
|
3089
|
+
"pwd",
|
|
3090
|
+
"readonly",
|
|
3091
|
+
"return",
|
|
3092
|
+
"shift",
|
|
3093
|
+
"test",
|
|
3094
|
+
"times",
|
|
3095
|
+
"trap",
|
|
3096
|
+
"umask",
|
|
3097
|
+
"unset"
|
|
3098
|
+
], S = [
|
|
3099
|
+
"alias",
|
|
3100
|
+
"bind",
|
|
3101
|
+
"builtin",
|
|
3102
|
+
"caller",
|
|
3103
|
+
"command",
|
|
3104
|
+
"declare",
|
|
3105
|
+
"echo",
|
|
3106
|
+
"enable",
|
|
3107
|
+
"help",
|
|
3108
|
+
"let",
|
|
3109
|
+
"local",
|
|
3110
|
+
"logout",
|
|
3111
|
+
"mapfile",
|
|
3112
|
+
"printf",
|
|
3113
|
+
"read",
|
|
3114
|
+
"readarray",
|
|
3115
|
+
"source",
|
|
3116
|
+
"type",
|
|
3117
|
+
"typeset",
|
|
3118
|
+
"ulimit",
|
|
3119
|
+
"unalias"
|
|
3120
|
+
], x = [
|
|
3121
|
+
"autoload",
|
|
3122
|
+
"bg",
|
|
3123
|
+
"bindkey",
|
|
3124
|
+
"bye",
|
|
3125
|
+
"cap",
|
|
3126
|
+
"chdir",
|
|
3127
|
+
"clone",
|
|
3128
|
+
"comparguments",
|
|
3129
|
+
"compcall",
|
|
3130
|
+
"compctl",
|
|
3131
|
+
"compdescribe",
|
|
3132
|
+
"compfiles",
|
|
3133
|
+
"compgroups",
|
|
3134
|
+
"compquote",
|
|
3135
|
+
"comptags",
|
|
3136
|
+
"comptry",
|
|
3137
|
+
"compvalues",
|
|
3138
|
+
"dirs",
|
|
3139
|
+
"disable",
|
|
3140
|
+
"disown",
|
|
3141
|
+
"echotc",
|
|
3142
|
+
"echoti",
|
|
3143
|
+
"emulate",
|
|
3144
|
+
"fc",
|
|
3145
|
+
"fg",
|
|
3146
|
+
"float",
|
|
3147
|
+
"functions",
|
|
3148
|
+
"getcap",
|
|
3149
|
+
"getln",
|
|
3150
|
+
"history",
|
|
3151
|
+
"integer",
|
|
3152
|
+
"jobs",
|
|
3153
|
+
"kill",
|
|
3154
|
+
"limit",
|
|
3155
|
+
"log",
|
|
3156
|
+
"noglob",
|
|
3157
|
+
"popd",
|
|
3158
|
+
"print",
|
|
3159
|
+
"pushd",
|
|
3160
|
+
"pushln",
|
|
3161
|
+
"rehash",
|
|
3162
|
+
"sched",
|
|
3163
|
+
"setcap",
|
|
3164
|
+
"setopt",
|
|
3165
|
+
"stat",
|
|
3166
|
+
"suspend",
|
|
3167
|
+
"ttyctl",
|
|
3168
|
+
"unfunction",
|
|
3169
|
+
"unhash",
|
|
3170
|
+
"unlimit",
|
|
3171
|
+
"unsetopt",
|
|
3172
|
+
"vared",
|
|
3173
|
+
"wait",
|
|
3174
|
+
"whence",
|
|
3175
|
+
"where",
|
|
3176
|
+
"which",
|
|
3177
|
+
"zcompile",
|
|
3178
|
+
"zformat",
|
|
3179
|
+
"zftp",
|
|
3180
|
+
"zle",
|
|
3181
|
+
"zmodload",
|
|
3182
|
+
"zparseopts",
|
|
3183
|
+
"zprof",
|
|
3184
|
+
"zpty",
|
|
3185
|
+
"zregexparse",
|
|
3186
|
+
"zsocket",
|
|
3187
|
+
"zstyle",
|
|
3188
|
+
"ztcp"
|
|
3189
|
+
], y = [
|
|
3190
|
+
"chcon",
|
|
3191
|
+
"chgrp",
|
|
3192
|
+
"chown",
|
|
3193
|
+
"chmod",
|
|
3194
|
+
"cp",
|
|
3195
|
+
"dd",
|
|
3196
|
+
"df",
|
|
3197
|
+
"dir",
|
|
3198
|
+
"dircolors",
|
|
3199
|
+
"ln",
|
|
3200
|
+
"ls",
|
|
3201
|
+
"mkdir",
|
|
3202
|
+
"mkfifo",
|
|
3203
|
+
"mknod",
|
|
3204
|
+
"mktemp",
|
|
3205
|
+
"mv",
|
|
3206
|
+
"realpath",
|
|
3207
|
+
"rm",
|
|
3208
|
+
"rmdir",
|
|
3209
|
+
"shred",
|
|
3210
|
+
"sync",
|
|
3211
|
+
"touch",
|
|
3212
|
+
"truncate",
|
|
3213
|
+
"vdir",
|
|
3214
|
+
"b2sum",
|
|
3215
|
+
"base32",
|
|
3216
|
+
"base64",
|
|
3217
|
+
"cat",
|
|
3218
|
+
"cksum",
|
|
3219
|
+
"comm",
|
|
3220
|
+
"csplit",
|
|
3221
|
+
"cut",
|
|
3222
|
+
"expand",
|
|
3223
|
+
"fmt",
|
|
3224
|
+
"fold",
|
|
3225
|
+
"head",
|
|
3226
|
+
"join",
|
|
3227
|
+
"md5sum",
|
|
3228
|
+
"nl",
|
|
3229
|
+
"numfmt",
|
|
3230
|
+
"od",
|
|
3231
|
+
"paste",
|
|
3232
|
+
"ptx",
|
|
3233
|
+
"pr",
|
|
3234
|
+
"sha1sum",
|
|
3235
|
+
"sha224sum",
|
|
3236
|
+
"sha256sum",
|
|
3237
|
+
"sha384sum",
|
|
3238
|
+
"sha512sum",
|
|
3239
|
+
"shuf",
|
|
3240
|
+
"sort",
|
|
3241
|
+
"split",
|
|
3242
|
+
"sum",
|
|
3243
|
+
"tac",
|
|
3244
|
+
"tail",
|
|
3245
|
+
"tr",
|
|
3246
|
+
"tsort",
|
|
3247
|
+
"unexpand",
|
|
3248
|
+
"uniq",
|
|
3249
|
+
"wc",
|
|
3250
|
+
"arch",
|
|
3251
|
+
"basename",
|
|
3252
|
+
"chroot",
|
|
3253
|
+
"date",
|
|
3254
|
+
"dirname",
|
|
3255
|
+
"du",
|
|
3256
|
+
"echo",
|
|
3257
|
+
"env",
|
|
3258
|
+
"expr",
|
|
3259
|
+
"factor",
|
|
3260
|
+
// "false", // keyword literal already
|
|
3261
|
+
"groups",
|
|
3262
|
+
"hostid",
|
|
3263
|
+
"id",
|
|
3264
|
+
"link",
|
|
3265
|
+
"logname",
|
|
3266
|
+
"nice",
|
|
3267
|
+
"nohup",
|
|
3268
|
+
"nproc",
|
|
3269
|
+
"pathchk",
|
|
3270
|
+
"pinky",
|
|
3271
|
+
"printenv",
|
|
3272
|
+
"printf",
|
|
3273
|
+
"pwd",
|
|
3274
|
+
"readlink",
|
|
3275
|
+
"runcon",
|
|
3276
|
+
"seq",
|
|
3277
|
+
"sleep",
|
|
3278
|
+
"stat",
|
|
3279
|
+
"stdbuf",
|
|
3280
|
+
"stty",
|
|
3281
|
+
"tee",
|
|
3282
|
+
"test",
|
|
3283
|
+
"timeout",
|
|
3284
|
+
// "true", // keyword literal already
|
|
3285
|
+
"tty",
|
|
3286
|
+
"uname",
|
|
3287
|
+
"unlink",
|
|
3288
|
+
"uptime",
|
|
3289
|
+
"users",
|
|
3290
|
+
"who",
|
|
3291
|
+
"whoami",
|
|
3292
|
+
"yes"
|
|
3293
|
+
];
|
|
3294
|
+
return {
|
|
3295
|
+
name: "Bash",
|
|
3296
|
+
aliases: ["sh"],
|
|
3297
|
+
keywords: {
|
|
3298
|
+
$pattern: /\b[a-z][a-z0-9._-]+\b/,
|
|
3299
|
+
keyword: N,
|
|
3300
|
+
literal: h,
|
|
3301
|
+
built_in: [
|
|
3302
|
+
...A,
|
|
3303
|
+
...S,
|
|
3304
|
+
// Shell modifiers
|
|
3305
|
+
"set",
|
|
3306
|
+
"shopt",
|
|
3307
|
+
...x,
|
|
3308
|
+
...y
|
|
3309
|
+
]
|
|
3310
|
+
},
|
|
3311
|
+
contains: [
|
|
3312
|
+
_,
|
|
3313
|
+
// to catch known shells and boost relevancy
|
|
3314
|
+
e.SHEBANG(),
|
|
3315
|
+
// to catch unknown shells but still highlight the shebang
|
|
3316
|
+
f,
|
|
3317
|
+
o,
|
|
3318
|
+
e.HASH_COMMENT_MODE,
|
|
3319
|
+
c,
|
|
3320
|
+
g,
|
|
3321
|
+
i,
|
|
3322
|
+
r,
|
|
3323
|
+
a,
|
|
3324
|
+
t
|
|
3325
|
+
]
|
|
3326
|
+
};
|
|
3327
|
+
}
|
|
3328
|
+
function jt(e) {
|
|
3329
|
+
const n = e.regex, t = e.COMMENT("--", "$"), s = {
|
|
3330
|
+
className: "string",
|
|
3331
|
+
variants: [
|
|
3332
|
+
{
|
|
3333
|
+
begin: /'/,
|
|
3334
|
+
end: /'/,
|
|
3335
|
+
contains: [{ begin: /''/ }]
|
|
3336
|
+
}
|
|
3337
|
+
]
|
|
3338
|
+
}, l = {
|
|
3339
|
+
begin: /"/,
|
|
3340
|
+
end: /"/,
|
|
3341
|
+
contains: [{ begin: /""/ }]
|
|
3342
|
+
}, c = [
|
|
3343
|
+
"true",
|
|
3344
|
+
"false",
|
|
3345
|
+
// Not sure it's correct to call NULL literal, and clauses like IS [NOT] NULL look strange that way.
|
|
3346
|
+
// "null",
|
|
3347
|
+
"unknown"
|
|
3348
|
+
], i = [
|
|
3349
|
+
"double precision",
|
|
3350
|
+
"large object",
|
|
3351
|
+
"with timezone",
|
|
3352
|
+
"without timezone"
|
|
3353
|
+
], r = [
|
|
3354
|
+
"bigint",
|
|
3355
|
+
"binary",
|
|
3356
|
+
"blob",
|
|
3357
|
+
"boolean",
|
|
3358
|
+
"char",
|
|
3359
|
+
"character",
|
|
3360
|
+
"clob",
|
|
3361
|
+
"date",
|
|
3362
|
+
"dec",
|
|
3363
|
+
"decfloat",
|
|
3364
|
+
"decimal",
|
|
3365
|
+
"float",
|
|
3366
|
+
"int",
|
|
3367
|
+
"integer",
|
|
3368
|
+
"interval",
|
|
3369
|
+
"nchar",
|
|
3370
|
+
"nclob",
|
|
3371
|
+
"national",
|
|
3372
|
+
"numeric",
|
|
3373
|
+
"real",
|
|
3374
|
+
"row",
|
|
3375
|
+
"smallint",
|
|
3376
|
+
"time",
|
|
3377
|
+
"timestamp",
|
|
3378
|
+
"varchar",
|
|
3379
|
+
"varying",
|
|
3380
|
+
// modifier (character varying)
|
|
3381
|
+
"varbinary"
|
|
3382
|
+
], a = [
|
|
3383
|
+
"add",
|
|
3384
|
+
"asc",
|
|
3385
|
+
"collation",
|
|
3386
|
+
"desc",
|
|
3387
|
+
"final",
|
|
3388
|
+
"first",
|
|
3389
|
+
"last",
|
|
3390
|
+
"view"
|
|
3391
|
+
], o = [
|
|
3392
|
+
"abs",
|
|
3393
|
+
"acos",
|
|
3394
|
+
"all",
|
|
3395
|
+
"allocate",
|
|
3396
|
+
"alter",
|
|
3397
|
+
"and",
|
|
3398
|
+
"any",
|
|
3399
|
+
"are",
|
|
3400
|
+
"array",
|
|
3401
|
+
"array_agg",
|
|
3402
|
+
"array_max_cardinality",
|
|
3403
|
+
"as",
|
|
3404
|
+
"asensitive",
|
|
3405
|
+
"asin",
|
|
3406
|
+
"asymmetric",
|
|
3407
|
+
"at",
|
|
3408
|
+
"atan",
|
|
3409
|
+
"atomic",
|
|
3410
|
+
"authorization",
|
|
3411
|
+
"avg",
|
|
3412
|
+
"begin",
|
|
3413
|
+
"begin_frame",
|
|
3414
|
+
"begin_partition",
|
|
3415
|
+
"between",
|
|
3416
|
+
"bigint",
|
|
3417
|
+
"binary",
|
|
3418
|
+
"blob",
|
|
3419
|
+
"boolean",
|
|
3420
|
+
"both",
|
|
3421
|
+
"by",
|
|
3422
|
+
"call",
|
|
3423
|
+
"called",
|
|
3424
|
+
"cardinality",
|
|
3425
|
+
"cascaded",
|
|
3426
|
+
"case",
|
|
3427
|
+
"cast",
|
|
3428
|
+
"ceil",
|
|
3429
|
+
"ceiling",
|
|
3430
|
+
"char",
|
|
3431
|
+
"char_length",
|
|
3432
|
+
"character",
|
|
3433
|
+
"character_length",
|
|
3434
|
+
"check",
|
|
3435
|
+
"classifier",
|
|
3436
|
+
"clob",
|
|
3437
|
+
"close",
|
|
3438
|
+
"coalesce",
|
|
3439
|
+
"collate",
|
|
3440
|
+
"collect",
|
|
3441
|
+
"column",
|
|
3442
|
+
"commit",
|
|
3443
|
+
"condition",
|
|
3444
|
+
"connect",
|
|
3445
|
+
"constraint",
|
|
3446
|
+
"contains",
|
|
3447
|
+
"convert",
|
|
3448
|
+
"copy",
|
|
3449
|
+
"corr",
|
|
3450
|
+
"corresponding",
|
|
3451
|
+
"cos",
|
|
3452
|
+
"cosh",
|
|
3453
|
+
"count",
|
|
3454
|
+
"covar_pop",
|
|
3455
|
+
"covar_samp",
|
|
3456
|
+
"create",
|
|
3457
|
+
"cross",
|
|
3458
|
+
"cube",
|
|
3459
|
+
"cume_dist",
|
|
3460
|
+
"current",
|
|
3461
|
+
"current_catalog",
|
|
3462
|
+
"current_date",
|
|
3463
|
+
"current_default_transform_group",
|
|
3464
|
+
"current_path",
|
|
3465
|
+
"current_role",
|
|
3466
|
+
"current_row",
|
|
3467
|
+
"current_schema",
|
|
3468
|
+
"current_time",
|
|
3469
|
+
"current_timestamp",
|
|
3470
|
+
"current_path",
|
|
3471
|
+
"current_role",
|
|
3472
|
+
"current_transform_group_for_type",
|
|
3473
|
+
"current_user",
|
|
3474
|
+
"cursor",
|
|
3475
|
+
"cycle",
|
|
3476
|
+
"date",
|
|
3477
|
+
"day",
|
|
3478
|
+
"deallocate",
|
|
3479
|
+
"dec",
|
|
3480
|
+
"decimal",
|
|
3481
|
+
"decfloat",
|
|
3482
|
+
"declare",
|
|
3483
|
+
"default",
|
|
3484
|
+
"define",
|
|
3485
|
+
"delete",
|
|
3486
|
+
"dense_rank",
|
|
3487
|
+
"deref",
|
|
3488
|
+
"describe",
|
|
3489
|
+
"deterministic",
|
|
3490
|
+
"disconnect",
|
|
3491
|
+
"distinct",
|
|
3492
|
+
"double",
|
|
3493
|
+
"drop",
|
|
3494
|
+
"dynamic",
|
|
3495
|
+
"each",
|
|
3496
|
+
"element",
|
|
3497
|
+
"else",
|
|
3498
|
+
"empty",
|
|
3499
|
+
"end",
|
|
3500
|
+
"end_frame",
|
|
3501
|
+
"end_partition",
|
|
3502
|
+
"end-exec",
|
|
3503
|
+
"equals",
|
|
3504
|
+
"escape",
|
|
3505
|
+
"every",
|
|
3506
|
+
"except",
|
|
3507
|
+
"exec",
|
|
3508
|
+
"execute",
|
|
3509
|
+
"exists",
|
|
3510
|
+
"exp",
|
|
3511
|
+
"external",
|
|
3512
|
+
"extract",
|
|
3513
|
+
"false",
|
|
3514
|
+
"fetch",
|
|
3515
|
+
"filter",
|
|
3516
|
+
"first_value",
|
|
3517
|
+
"float",
|
|
3518
|
+
"floor",
|
|
3519
|
+
"for",
|
|
3520
|
+
"foreign",
|
|
3521
|
+
"frame_row",
|
|
3522
|
+
"free",
|
|
3523
|
+
"from",
|
|
3524
|
+
"full",
|
|
3525
|
+
"function",
|
|
3526
|
+
"fusion",
|
|
3527
|
+
"get",
|
|
3528
|
+
"global",
|
|
3529
|
+
"grant",
|
|
3530
|
+
"group",
|
|
3531
|
+
"grouping",
|
|
3532
|
+
"groups",
|
|
3533
|
+
"having",
|
|
3534
|
+
"hold",
|
|
3535
|
+
"hour",
|
|
3536
|
+
"identity",
|
|
3537
|
+
"in",
|
|
3538
|
+
"indicator",
|
|
3539
|
+
"initial",
|
|
3540
|
+
"inner",
|
|
3541
|
+
"inout",
|
|
3542
|
+
"insensitive",
|
|
3543
|
+
"insert",
|
|
3544
|
+
"int",
|
|
3545
|
+
"integer",
|
|
3546
|
+
"intersect",
|
|
3547
|
+
"intersection",
|
|
3548
|
+
"interval",
|
|
3549
|
+
"into",
|
|
3550
|
+
"is",
|
|
3551
|
+
"join",
|
|
3552
|
+
"json_array",
|
|
3553
|
+
"json_arrayagg",
|
|
3554
|
+
"json_exists",
|
|
3555
|
+
"json_object",
|
|
3556
|
+
"json_objectagg",
|
|
3557
|
+
"json_query",
|
|
3558
|
+
"json_table",
|
|
3559
|
+
"json_table_primitive",
|
|
3560
|
+
"json_value",
|
|
3561
|
+
"lag",
|
|
3562
|
+
"language",
|
|
3563
|
+
"large",
|
|
3564
|
+
"last_value",
|
|
3565
|
+
"lateral",
|
|
3566
|
+
"lead",
|
|
3567
|
+
"leading",
|
|
3568
|
+
"left",
|
|
3569
|
+
"like",
|
|
3570
|
+
"like_regex",
|
|
3571
|
+
"listagg",
|
|
3572
|
+
"ln",
|
|
3573
|
+
"local",
|
|
3574
|
+
"localtime",
|
|
3575
|
+
"localtimestamp",
|
|
3576
|
+
"log",
|
|
3577
|
+
"log10",
|
|
3578
|
+
"lower",
|
|
3579
|
+
"match",
|
|
3580
|
+
"match_number",
|
|
3581
|
+
"match_recognize",
|
|
3582
|
+
"matches",
|
|
3583
|
+
"max",
|
|
3584
|
+
"member",
|
|
3585
|
+
"merge",
|
|
3586
|
+
"method",
|
|
3587
|
+
"min",
|
|
3588
|
+
"minute",
|
|
3589
|
+
"mod",
|
|
3590
|
+
"modifies",
|
|
3591
|
+
"module",
|
|
3592
|
+
"month",
|
|
3593
|
+
"multiset",
|
|
3594
|
+
"national",
|
|
3595
|
+
"natural",
|
|
3596
|
+
"nchar",
|
|
3597
|
+
"nclob",
|
|
3598
|
+
"new",
|
|
3599
|
+
"no",
|
|
3600
|
+
"none",
|
|
3601
|
+
"normalize",
|
|
3602
|
+
"not",
|
|
3603
|
+
"nth_value",
|
|
3604
|
+
"ntile",
|
|
3605
|
+
"null",
|
|
3606
|
+
"nullif",
|
|
3607
|
+
"numeric",
|
|
3608
|
+
"octet_length",
|
|
3609
|
+
"occurrences_regex",
|
|
3610
|
+
"of",
|
|
3611
|
+
"offset",
|
|
3612
|
+
"old",
|
|
3613
|
+
"omit",
|
|
3614
|
+
"on",
|
|
3615
|
+
"one",
|
|
3616
|
+
"only",
|
|
3617
|
+
"open",
|
|
3618
|
+
"or",
|
|
3619
|
+
"order",
|
|
3620
|
+
"out",
|
|
3621
|
+
"outer",
|
|
3622
|
+
"over",
|
|
3623
|
+
"overlaps",
|
|
3624
|
+
"overlay",
|
|
3625
|
+
"parameter",
|
|
3626
|
+
"partition",
|
|
3627
|
+
"pattern",
|
|
3628
|
+
"per",
|
|
3629
|
+
"percent",
|
|
3630
|
+
"percent_rank",
|
|
3631
|
+
"percentile_cont",
|
|
3632
|
+
"percentile_disc",
|
|
3633
|
+
"period",
|
|
3634
|
+
"portion",
|
|
3635
|
+
"position",
|
|
3636
|
+
"position_regex",
|
|
3637
|
+
"power",
|
|
3638
|
+
"precedes",
|
|
3639
|
+
"precision",
|
|
3640
|
+
"prepare",
|
|
3641
|
+
"primary",
|
|
3642
|
+
"procedure",
|
|
3643
|
+
"ptf",
|
|
3644
|
+
"range",
|
|
3645
|
+
"rank",
|
|
3646
|
+
"reads",
|
|
3647
|
+
"real",
|
|
3648
|
+
"recursive",
|
|
3649
|
+
"ref",
|
|
3650
|
+
"references",
|
|
3651
|
+
"referencing",
|
|
3652
|
+
"regr_avgx",
|
|
3653
|
+
"regr_avgy",
|
|
3654
|
+
"regr_count",
|
|
3655
|
+
"regr_intercept",
|
|
3656
|
+
"regr_r2",
|
|
3657
|
+
"regr_slope",
|
|
3658
|
+
"regr_sxx",
|
|
3659
|
+
"regr_sxy",
|
|
3660
|
+
"regr_syy",
|
|
3661
|
+
"release",
|
|
3662
|
+
"result",
|
|
3663
|
+
"return",
|
|
3664
|
+
"returns",
|
|
3665
|
+
"revoke",
|
|
3666
|
+
"right",
|
|
3667
|
+
"rollback",
|
|
3668
|
+
"rollup",
|
|
3669
|
+
"row",
|
|
3670
|
+
"row_number",
|
|
3671
|
+
"rows",
|
|
3672
|
+
"running",
|
|
3673
|
+
"savepoint",
|
|
3674
|
+
"scope",
|
|
3675
|
+
"scroll",
|
|
3676
|
+
"search",
|
|
3677
|
+
"second",
|
|
3678
|
+
"seek",
|
|
3679
|
+
"select",
|
|
3680
|
+
"sensitive",
|
|
3681
|
+
"session_user",
|
|
3682
|
+
"set",
|
|
3683
|
+
"show",
|
|
3684
|
+
"similar",
|
|
3685
|
+
"sin",
|
|
3686
|
+
"sinh",
|
|
3687
|
+
"skip",
|
|
3688
|
+
"smallint",
|
|
3689
|
+
"some",
|
|
3690
|
+
"specific",
|
|
3691
|
+
"specifictype",
|
|
3692
|
+
"sql",
|
|
3693
|
+
"sqlexception",
|
|
3694
|
+
"sqlstate",
|
|
3695
|
+
"sqlwarning",
|
|
3696
|
+
"sqrt",
|
|
3697
|
+
"start",
|
|
3698
|
+
"static",
|
|
3699
|
+
"stddev_pop",
|
|
3700
|
+
"stddev_samp",
|
|
3701
|
+
"submultiset",
|
|
3702
|
+
"subset",
|
|
3703
|
+
"substring",
|
|
3704
|
+
"substring_regex",
|
|
3705
|
+
"succeeds",
|
|
3706
|
+
"sum",
|
|
3707
|
+
"symmetric",
|
|
3708
|
+
"system",
|
|
3709
|
+
"system_time",
|
|
3710
|
+
"system_user",
|
|
3711
|
+
"table",
|
|
3712
|
+
"tablesample",
|
|
3713
|
+
"tan",
|
|
3714
|
+
"tanh",
|
|
3715
|
+
"then",
|
|
3716
|
+
"time",
|
|
3717
|
+
"timestamp",
|
|
3718
|
+
"timezone_hour",
|
|
3719
|
+
"timezone_minute",
|
|
3720
|
+
"to",
|
|
3721
|
+
"trailing",
|
|
3722
|
+
"translate",
|
|
3723
|
+
"translate_regex",
|
|
3724
|
+
"translation",
|
|
3725
|
+
"treat",
|
|
3726
|
+
"trigger",
|
|
3727
|
+
"trim",
|
|
3728
|
+
"trim_array",
|
|
3729
|
+
"true",
|
|
3730
|
+
"truncate",
|
|
3731
|
+
"uescape",
|
|
3732
|
+
"union",
|
|
3733
|
+
"unique",
|
|
3734
|
+
"unknown",
|
|
3735
|
+
"unnest",
|
|
3736
|
+
"update",
|
|
3737
|
+
"upper",
|
|
3738
|
+
"user",
|
|
3739
|
+
"using",
|
|
3740
|
+
"value",
|
|
3741
|
+
"values",
|
|
3742
|
+
"value_of",
|
|
3743
|
+
"var_pop",
|
|
3744
|
+
"var_samp",
|
|
3745
|
+
"varbinary",
|
|
3746
|
+
"varchar",
|
|
3747
|
+
"varying",
|
|
3748
|
+
"versioning",
|
|
3749
|
+
"when",
|
|
3750
|
+
"whenever",
|
|
3751
|
+
"where",
|
|
3752
|
+
"width_bucket",
|
|
3753
|
+
"window",
|
|
3754
|
+
"with",
|
|
3755
|
+
"within",
|
|
3756
|
+
"without",
|
|
3757
|
+
"year"
|
|
3758
|
+
], p = [
|
|
3759
|
+
"abs",
|
|
3760
|
+
"acos",
|
|
3761
|
+
"array_agg",
|
|
3762
|
+
"asin",
|
|
3763
|
+
"atan",
|
|
3764
|
+
"avg",
|
|
3765
|
+
"cast",
|
|
3766
|
+
"ceil",
|
|
3767
|
+
"ceiling",
|
|
3768
|
+
"coalesce",
|
|
3769
|
+
"corr",
|
|
3770
|
+
"cos",
|
|
3771
|
+
"cosh",
|
|
3772
|
+
"count",
|
|
3773
|
+
"covar_pop",
|
|
3774
|
+
"covar_samp",
|
|
3775
|
+
"cume_dist",
|
|
3776
|
+
"dense_rank",
|
|
3777
|
+
"deref",
|
|
3778
|
+
"element",
|
|
3779
|
+
"exp",
|
|
3780
|
+
"extract",
|
|
3781
|
+
"first_value",
|
|
3782
|
+
"floor",
|
|
3783
|
+
"json_array",
|
|
3784
|
+
"json_arrayagg",
|
|
3785
|
+
"json_exists",
|
|
3786
|
+
"json_object",
|
|
3787
|
+
"json_objectagg",
|
|
3788
|
+
"json_query",
|
|
3789
|
+
"json_table",
|
|
3790
|
+
"json_table_primitive",
|
|
3791
|
+
"json_value",
|
|
3792
|
+
"lag",
|
|
3793
|
+
"last_value",
|
|
3794
|
+
"lead",
|
|
3795
|
+
"listagg",
|
|
3796
|
+
"ln",
|
|
3797
|
+
"log",
|
|
3798
|
+
"log10",
|
|
3799
|
+
"lower",
|
|
3800
|
+
"max",
|
|
3801
|
+
"min",
|
|
3802
|
+
"mod",
|
|
3803
|
+
"nth_value",
|
|
3804
|
+
"ntile",
|
|
3805
|
+
"nullif",
|
|
3806
|
+
"percent_rank",
|
|
3807
|
+
"percentile_cont",
|
|
3808
|
+
"percentile_disc",
|
|
3809
|
+
"position",
|
|
3810
|
+
"position_regex",
|
|
3811
|
+
"power",
|
|
3812
|
+
"rank",
|
|
3813
|
+
"regr_avgx",
|
|
3814
|
+
"regr_avgy",
|
|
3815
|
+
"regr_count",
|
|
3816
|
+
"regr_intercept",
|
|
3817
|
+
"regr_r2",
|
|
3818
|
+
"regr_slope",
|
|
3819
|
+
"regr_sxx",
|
|
3820
|
+
"regr_sxy",
|
|
3821
|
+
"regr_syy",
|
|
3822
|
+
"row_number",
|
|
3823
|
+
"sin",
|
|
3824
|
+
"sinh",
|
|
3825
|
+
"sqrt",
|
|
3826
|
+
"stddev_pop",
|
|
3827
|
+
"stddev_samp",
|
|
3828
|
+
"substring",
|
|
3829
|
+
"substring_regex",
|
|
3830
|
+
"sum",
|
|
3831
|
+
"tan",
|
|
3832
|
+
"tanh",
|
|
3833
|
+
"translate",
|
|
3834
|
+
"translate_regex",
|
|
3835
|
+
"treat",
|
|
3836
|
+
"trim",
|
|
3837
|
+
"trim_array",
|
|
3838
|
+
"unnest",
|
|
3839
|
+
"upper",
|
|
3840
|
+
"value_of",
|
|
3841
|
+
"var_pop",
|
|
3842
|
+
"var_samp",
|
|
3843
|
+
"width_bucket"
|
|
3844
|
+
], _ = [
|
|
3845
|
+
"current_catalog",
|
|
3846
|
+
"current_date",
|
|
3847
|
+
"current_default_transform_group",
|
|
3848
|
+
"current_path",
|
|
3849
|
+
"current_role",
|
|
3850
|
+
"current_schema",
|
|
3851
|
+
"current_transform_group_for_type",
|
|
3852
|
+
"current_user",
|
|
3853
|
+
"session_user",
|
|
3854
|
+
"system_time",
|
|
3855
|
+
"system_user",
|
|
3856
|
+
"current_time",
|
|
3857
|
+
"localtime",
|
|
3858
|
+
"current_timestamp",
|
|
3859
|
+
"localtimestamp"
|
|
3860
|
+
], f = [
|
|
3861
|
+
"create table",
|
|
3862
|
+
"insert into",
|
|
3863
|
+
"primary key",
|
|
3864
|
+
"foreign key",
|
|
3865
|
+
"not null",
|
|
3866
|
+
"alter table",
|
|
3867
|
+
"add constraint",
|
|
3868
|
+
"grouping sets",
|
|
3869
|
+
"on overflow",
|
|
3870
|
+
"character set",
|
|
3871
|
+
"respect nulls",
|
|
3872
|
+
"ignore nulls",
|
|
3873
|
+
"nulls first",
|
|
3874
|
+
"nulls last",
|
|
3875
|
+
"depth first",
|
|
3876
|
+
"breadth first"
|
|
3877
|
+
], N = p, h = [
|
|
3878
|
+
...o,
|
|
3879
|
+
...a
|
|
3880
|
+
].filter((y) => !p.includes(y)), g = {
|
|
3881
|
+
className: "variable",
|
|
3882
|
+
begin: /@[a-z0-9]+/
|
|
3883
|
+
}, A = {
|
|
3884
|
+
className: "operator",
|
|
3885
|
+
begin: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
|
|
3886
|
+
relevance: 0
|
|
3887
|
+
}, S = {
|
|
3888
|
+
begin: n.concat(/\b/, n.either(...N), /\s*\(/),
|
|
3889
|
+
relevance: 0,
|
|
3890
|
+
keywords: { built_in: N }
|
|
3891
|
+
};
|
|
3892
|
+
function x(y, {
|
|
3893
|
+
exceptions: R,
|
|
3894
|
+
when: L
|
|
3895
|
+
} = {}) {
|
|
3896
|
+
const D = L;
|
|
3897
|
+
return R = R || [], y.map((k) => k.match(/\|\d+$/) || R.includes(k) ? k : D(k) ? `${k}|0` : k);
|
|
3898
|
+
}
|
|
3899
|
+
return {
|
|
3900
|
+
name: "SQL",
|
|
3901
|
+
case_insensitive: !0,
|
|
3902
|
+
// does not include {} or HTML tags `</`
|
|
3903
|
+
illegal: /[{}]|<\//,
|
|
3904
|
+
keywords: {
|
|
3905
|
+
$pattern: /\b[\w\.]+/,
|
|
3906
|
+
keyword: x(h, { when: (y) => y.length < 3 }),
|
|
3907
|
+
literal: c,
|
|
3908
|
+
type: r,
|
|
3909
|
+
built_in: _
|
|
3910
|
+
},
|
|
3911
|
+
contains: [
|
|
3912
|
+
{
|
|
3913
|
+
begin: n.either(...f),
|
|
3914
|
+
relevance: 0,
|
|
3915
|
+
keywords: {
|
|
3916
|
+
$pattern: /[\w\.]+/,
|
|
3917
|
+
keyword: h.concat(f),
|
|
3918
|
+
literal: c,
|
|
3919
|
+
type: r
|
|
3920
|
+
}
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
className: "type",
|
|
3924
|
+
begin: n.either(...i)
|
|
3925
|
+
},
|
|
3926
|
+
S,
|
|
3927
|
+
g,
|
|
3928
|
+
s,
|
|
3929
|
+
l,
|
|
3930
|
+
e.C_NUMBER_MODE,
|
|
3931
|
+
e.C_BLOCK_COMMENT_MODE,
|
|
3932
|
+
t,
|
|
3933
|
+
A
|
|
3934
|
+
]
|
|
3935
|
+
};
|
|
3936
|
+
}
|
|
3937
|
+
G.registerLanguage("xml", Ht);
|
|
3938
|
+
G.registerLanguage("javascript", Wt);
|
|
3939
|
+
G.registerLanguage("json", qt);
|
|
3940
|
+
G.registerLanguage("yaml", Yt);
|
|
3941
|
+
G.registerLanguage("plaintext", Zt);
|
|
3942
|
+
G.registerLanguage("python", Qt);
|
|
3943
|
+
G.registerLanguage("java", Xt);
|
|
3944
|
+
G.registerLanguage("bash", Vt);
|
|
3945
|
+
G.registerLanguage("sql", jt);
|
|
3946
|
+
var m = /* @__PURE__ */ ((e) => (e.EQUAL = "equal", e.DELETE = "removed", e.ADD = "added", e.EMPTY = "empty", e))(m || {});
|
|
3947
|
+
const q = "<code-diff-modified>", Y = "</code-diff-modified>", Jt = q.replace("<", "<").replace(">", ">"), es = Y.replace("<", "<").replace(">", ">"), ae = (e) => e === void 0 ? m.EQUAL : e.added ? m.ADD : e.removed ? m.DELETE : m.EQUAL, Se = (e, n, t = "word") => typeof e > "u" ? n : typeof n > "u" ? e : (t === "char" ? Hn : Fn)(e, n).filter((l) => ae(l) !== m.DELETE).map(
|
|
3948
|
+
(l) => ae(l) === m.ADD ? `${q}${l.value}${Y}` : l.value
|
|
3949
|
+
).join(""), F = (e, n) => {
|
|
3950
|
+
if (!n.match(new RegExp(`(${q}|${Y})`, "g")))
|
|
3951
|
+
return G.highlight(n, { language: e }).value;
|
|
3952
|
+
let s = n;
|
|
3953
|
+
const l = n.replace(new RegExp(`(${q}|${Y})`, "g"), ""), c = document.createElement("div");
|
|
3954
|
+
c.innerHTML = G.highlight(l, { language: e }).value;
|
|
3955
|
+
let i = !1;
|
|
3956
|
+
const r = (a) => {
|
|
3957
|
+
a.childNodes.forEach((o) => {
|
|
3958
|
+
if (o.nodeType === Node.ELEMENT_NODE && r(o), o.nodeType === Node.TEXT_NODE) {
|
|
3959
|
+
if (!o.textContent)
|
|
3960
|
+
return;
|
|
3961
|
+
let p = o.textContent, _ = "";
|
|
3962
|
+
for (i && (_ = _ + q); p.length; ) {
|
|
3963
|
+
if (s.startsWith(q)) {
|
|
3964
|
+
s = s.slice(q.length), _ = _ + q, i = !0;
|
|
3965
|
+
continue;
|
|
3966
|
+
}
|
|
3967
|
+
if (s.startsWith(Y)) {
|
|
3968
|
+
s = s.slice(Y.length), _ = _ + Y, i = !1;
|
|
3969
|
+
continue;
|
|
3970
|
+
}
|
|
3971
|
+
const f = s.match(new RegExp(`(${q}|${Y})`)), N = f && f.index ? f.index : s.length, h = Math.min(N, p.length);
|
|
3972
|
+
_ = _ + s.substring(0, h), s = s.slice(h), p = p.slice(h);
|
|
3973
|
+
}
|
|
3974
|
+
i && (_ = _ + Y), o.textContent = _;
|
|
3975
|
+
}
|
|
3976
|
+
});
|
|
3977
|
+
};
|
|
3978
|
+
return r(c), c.innerHTML.replace(new RegExp(Jt, "g"), '<span class="x">').replace(new RegExp(es, "g"), "</span>");
|
|
3979
|
+
};
|
|
3980
|
+
function ns(e, n, t = "plaintext", s = "word", l = 10) {
|
|
3981
|
+
var N;
|
|
3982
|
+
const c = () => ({ type: m.EMPTY }), i = (h, g, A) => ({ type: h, num: g, code: A }), r = gn(e, n);
|
|
3983
|
+
let a = 0, o = 0, p = !1;
|
|
3984
|
+
const _ = [];
|
|
3985
|
+
for (let h = 0; h < r.length; h++) {
|
|
3986
|
+
if (p) {
|
|
3987
|
+
p = !1;
|
|
3988
|
+
continue;
|
|
3989
|
+
}
|
|
3990
|
+
const [g, A] = [r[h], r[h + 1]], [S, x] = [ae(g), ae(A)], y = g.value.replace(/\n$/, "").split(`
|
|
3991
|
+
`);
|
|
3992
|
+
if (A === void 0) {
|
|
3993
|
+
for (const L of y) {
|
|
3994
|
+
let D = c(), k = c();
|
|
3995
|
+
const H = F(t, L);
|
|
3996
|
+
S === m.EQUAL && (a++, o++, D = i(m.EQUAL, a, H), k = i(m.EQUAL, o, H)), S === m.DELETE && (a++, D = i(m.DELETE, a, H), k = c()), S === m.ADD && (o++, D = c(), k = i(m.ADD, o, H)), _.push({ left: D, right: k });
|
|
3997
|
+
}
|
|
3998
|
+
break;
|
|
3999
|
+
}
|
|
4000
|
+
if (S === m.EQUAL)
|
|
4001
|
+
for (const L of y) {
|
|
4002
|
+
a++, o++;
|
|
4003
|
+
const D = F(t, L);
|
|
4004
|
+
_.push({
|
|
4005
|
+
left: i(m.EQUAL, a, D),
|
|
4006
|
+
right: i(m.EQUAL, o, D)
|
|
4007
|
+
});
|
|
4008
|
+
}
|
|
4009
|
+
const R = A.value.replace(/\n$/, "").split(`
|
|
4010
|
+
`);
|
|
4011
|
+
if (S === m.DELETE) {
|
|
4012
|
+
if (x === m.EQUAL)
|
|
4013
|
+
for (const L of y)
|
|
4014
|
+
a++, _.push({
|
|
4015
|
+
left: i(m.DELETE, a, F(t, L)),
|
|
4016
|
+
right: c()
|
|
4017
|
+
});
|
|
4018
|
+
if (x === m.ADD) {
|
|
4019
|
+
p = !0;
|
|
4020
|
+
const L = Math.max(g.count, A.count);
|
|
4021
|
+
for (let D = 0; D < L; D++) {
|
|
4022
|
+
D < g.count && a++, D < A.count && o++;
|
|
4023
|
+
const [k, H] = [y[D], R[D]], z = y.length === R.length ? Se(H, k, s) : k, ne = y.length === R.length ? Se(k, H, s) : H, te = D < g.count ? i(m.DELETE, a, F(t, z)) : c(), oe = D < A.count ? i(m.ADD, o, F(t, ne)) : c();
|
|
4024
|
+
_.push({ left: te, right: oe });
|
|
4025
|
+
}
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
if (S === m.ADD)
|
|
4029
|
+
for (const L of y)
|
|
4030
|
+
o++, _.push({
|
|
4031
|
+
left: c(),
|
|
4032
|
+
right: i(m.ADD, o, F(t, L))
|
|
4033
|
+
});
|
|
4034
|
+
}
|
|
4035
|
+
if (e === n) {
|
|
4036
|
+
for (let h = 0; h < _.length; h++)
|
|
4037
|
+
_[h].fold = !1;
|
|
4038
|
+
return _;
|
|
4039
|
+
}
|
|
4040
|
+
for (let h = 0; h < _.length; h++) {
|
|
4041
|
+
const g = _[h];
|
|
4042
|
+
if (g.left.type === m.DELETE || g.right.type === m.ADD) {
|
|
4043
|
+
const [A, S] = [Math.max(h - l, 0), Math.min(h + l + 1, _.length)];
|
|
4044
|
+
for (let x = A; x < S; x++)
|
|
4045
|
+
_[x].fold = !1;
|
|
4046
|
+
}
|
|
4047
|
+
g.fold === void 0 && (g.fold = !0);
|
|
4048
|
+
}
|
|
4049
|
+
const f = [];
|
|
4050
|
+
for (let h = 0; h < _.length; h++) {
|
|
4051
|
+
const g = _[h];
|
|
4052
|
+
if (g.fold === !1) {
|
|
4053
|
+
f.push(g);
|
|
4054
|
+
continue;
|
|
4055
|
+
}
|
|
4056
|
+
g.fold === !0 && ((N = f[f.length - 1]) == null ? void 0 : N.fold) !== !0 && f.push(g);
|
|
4057
|
+
}
|
|
4058
|
+
return f;
|
|
4059
|
+
}
|
|
4060
|
+
function ts(e, n, t = "plaintext", s = "word", l = 2) {
|
|
4061
|
+
var _;
|
|
4062
|
+
const c = gn(e, n);
|
|
4063
|
+
let i = 0, r = 0, a = !1;
|
|
4064
|
+
const o = [];
|
|
4065
|
+
for (let f = 0; f < c.length; f++) {
|
|
4066
|
+
if (a) {
|
|
4067
|
+
a = !1;
|
|
4068
|
+
continue;
|
|
4069
|
+
}
|
|
4070
|
+
const [N, h] = [c[f], c[f + 1]], [g, A] = [ae(N), ae(h)], S = N.value.replace(/\n$/, "").split(`
|
|
4071
|
+
`);
|
|
4072
|
+
if (h === void 0) {
|
|
4073
|
+
for (const y of S) {
|
|
4074
|
+
g === m.EQUAL && (i++, r++), g === m.DELETE && i++, g === m.ADD && r++;
|
|
4075
|
+
const R = F(t, y);
|
|
4076
|
+
o.push({
|
|
4077
|
+
type: g,
|
|
4078
|
+
code: R,
|
|
4079
|
+
addNum: g === m.DELETE ? void 0 : r,
|
|
4080
|
+
delNum: g === m.ADD ? void 0 : i
|
|
4081
|
+
});
|
|
4082
|
+
}
|
|
4083
|
+
break;
|
|
4084
|
+
}
|
|
4085
|
+
if (g === m.EQUAL)
|
|
4086
|
+
for (const y of S) {
|
|
4087
|
+
i++, r++;
|
|
4088
|
+
const R = F(t, y);
|
|
4089
|
+
o.push({ type: m.EQUAL, code: R, delNum: i, addNum: r });
|
|
4090
|
+
}
|
|
4091
|
+
const x = h.value.replace(/\n$/, "").split(`
|
|
4092
|
+
`);
|
|
4093
|
+
if (g === m.DELETE)
|
|
4094
|
+
if (A === m.ADD && S.length === x.length) {
|
|
4095
|
+
for (let y = 0; y < S.length; y++) {
|
|
4096
|
+
const R = S[y], L = x[y];
|
|
4097
|
+
i++;
|
|
4098
|
+
const D = F(t, Se(L, R, s));
|
|
4099
|
+
o.push({ type: m.DELETE, code: D, delNum: i });
|
|
4100
|
+
}
|
|
4101
|
+
for (let y = 0; y < x.length; y++) {
|
|
4102
|
+
const R = S[y], L = x[y];
|
|
4103
|
+
r++;
|
|
4104
|
+
const D = F(t, Se(R, L, s));
|
|
4105
|
+
o.push({ type: m.ADD, code: D, addNum: r });
|
|
4106
|
+
}
|
|
4107
|
+
a = !0;
|
|
4108
|
+
} else
|
|
4109
|
+
for (const y of S) {
|
|
4110
|
+
i++;
|
|
4111
|
+
const R = F(t, y);
|
|
4112
|
+
o.push({ type: m.DELETE, code: R, delNum: i });
|
|
4113
|
+
}
|
|
4114
|
+
if (g === m.ADD)
|
|
4115
|
+
for (const y of S) {
|
|
4116
|
+
r++;
|
|
4117
|
+
const R = F(t, y);
|
|
4118
|
+
o.push({ type: m.ADD, code: R, addNum: r });
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4121
|
+
for (let f = 0; f < o.length; f++) {
|
|
4122
|
+
const N = o[f];
|
|
4123
|
+
if (N.type === m.DELETE || N.type === m.ADD) {
|
|
4124
|
+
const [h, g] = [Math.max(f - l, 0), Math.min(f + l + 1, o.length)];
|
|
4125
|
+
for (let A = h; A < g; A++)
|
|
4126
|
+
o[A].fold = !1;
|
|
4127
|
+
}
|
|
4128
|
+
N.fold === void 0 && (N.fold = !0);
|
|
4129
|
+
}
|
|
4130
|
+
if (e === n) {
|
|
4131
|
+
for (let f = 0; f < o.length; f++)
|
|
4132
|
+
o[f].fold = !1;
|
|
4133
|
+
return o;
|
|
4134
|
+
}
|
|
4135
|
+
const p = [];
|
|
4136
|
+
for (let f = 0; f < o.length; f++) {
|
|
4137
|
+
const N = o[f];
|
|
4138
|
+
if (N.fold === !1) {
|
|
4139
|
+
p.push(N);
|
|
4140
|
+
continue;
|
|
4141
|
+
}
|
|
4142
|
+
N.fold === !0 && (f === 0 || ((_ = p[p.length - 1]) == null ? void 0 : _.fold) !== !0) && p.push(N);
|
|
4143
|
+
}
|
|
4144
|
+
return p;
|
|
4145
|
+
}
|
|
4146
|
+
const Ke = {};
|
|
4147
|
+
Ke.props = {
|
|
4148
|
+
line: {
|
|
4149
|
+
key: "line",
|
|
4150
|
+
required: !0,
|
|
4151
|
+
type: null
|
|
4152
|
+
}
|
|
4153
|
+
};
|
|
4154
|
+
Ke.setup = (e, n) => ({
|
|
4155
|
+
DiffType: m,
|
|
4156
|
+
getCodeMarker: (s) => s === m.DELETE ? "-" : s === m.ADD ? "+" : ""
|
|
4157
|
+
});
|
|
4158
|
+
var ss = function() {
|
|
4159
|
+
var e = this, n = e.$createElement, t = e._self._c || n;
|
|
4160
|
+
return e.line.fold ? t("tr", [t("td", {
|
|
4161
|
+
staticClass: "blob-num blob-num-empty empty-cell"
|
|
4162
|
+
}, [e._v(" > ")]), t("td", {
|
|
4163
|
+
staticClass: "blob-num blob-num-empty empty-cell"
|
|
4164
|
+
}, [e._v(" > ")]), t("td", {
|
|
4165
|
+
staticClass: "blob-code blob-code-empty empty-cell",
|
|
4166
|
+
attrs: {
|
|
4167
|
+
align: "left"
|
|
4168
|
+
}
|
|
4169
|
+
}, [e._v(" ⋯ ")])]) : t("tr", [t("td", {
|
|
4170
|
+
staticClass: "blob-num",
|
|
4171
|
+
class: {
|
|
4172
|
+
"blob-num-deletion": e.line.type === e.DiffType.DELETE,
|
|
4173
|
+
"blob-num-addition": e.line.type === e.DiffType.ADD,
|
|
4174
|
+
"blob-num-context": e.line.type === e.DiffType.EQUAL
|
|
4175
|
+
}
|
|
4176
|
+
}, [e._v(" " + e._s(e.line.delNum) + " ")]), t("td", {
|
|
4177
|
+
staticClass: "blob-num",
|
|
4178
|
+
class: {
|
|
4179
|
+
"blob-num-deletion": e.line.type === e.DiffType.DELETE,
|
|
4180
|
+
"blob-num-addition": e.line.type === e.DiffType.ADD,
|
|
4181
|
+
"blob-num-context": e.line.type === e.DiffType.EQUAL
|
|
4182
|
+
}
|
|
4183
|
+
}, [e._v(" " + e._s(e.line.addNum) + " ")]), t("td", {
|
|
4184
|
+
staticClass: "blob-code",
|
|
4185
|
+
class: {
|
|
4186
|
+
"blob-code-deletion": e.line.type === e.DiffType.DELETE,
|
|
4187
|
+
"blob-code-addition": e.line.type === e.DiffType.ADD,
|
|
4188
|
+
"blob-code-context": e.line.type === e.DiffType.EQUAL
|
|
4189
|
+
}
|
|
4190
|
+
}, [t("span", {
|
|
4191
|
+
staticClass: "blob-code-inner blob-code-marker",
|
|
4192
|
+
attrs: {
|
|
4193
|
+
"data-code-marker": e.getCodeMarker(e.line.type)
|
|
4194
|
+
},
|
|
4195
|
+
domProps: {
|
|
4196
|
+
innerHTML: e._s(e.line.code)
|
|
4197
|
+
}
|
|
4198
|
+
})])]);
|
|
4199
|
+
}, rs = [];
|
|
4200
|
+
function _e(e, n, t, s, l, c, i, r) {
|
|
4201
|
+
var a = typeof e == "function" ? e.options : e;
|
|
4202
|
+
n && (a.render = n, a.staticRenderFns = t, a._compiled = !0), s && (a.functional = !0), c && (a._scopeId = "data-v-" + c);
|
|
4203
|
+
var o;
|
|
4204
|
+
if (i ? (o = function(f) {
|
|
4205
|
+
f = f || // cached call
|
|
4206
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
4207
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !f && typeof __VUE_SSR_CONTEXT__ < "u" && (f = __VUE_SSR_CONTEXT__), l && l.call(this, f), f && f._registeredComponents && f._registeredComponents.add(i);
|
|
4208
|
+
}, a._ssrRegister = o) : l && (o = r ? function() {
|
|
4209
|
+
l.call(
|
|
4210
|
+
this,
|
|
4211
|
+
(a.functional ? this.parent : this).$root.$options.shadowRoot
|
|
4212
|
+
);
|
|
4213
|
+
} : l), o)
|
|
4214
|
+
if (a.functional) {
|
|
4215
|
+
a._injectStyles = o;
|
|
4216
|
+
var p = a.render;
|
|
4217
|
+
a.render = function(N, h) {
|
|
4218
|
+
return o.call(h), p(N, h);
|
|
4219
|
+
};
|
|
4220
|
+
} else {
|
|
4221
|
+
var _ = a.beforeCreate;
|
|
4222
|
+
a.beforeCreate = _ ? [].concat(_, o) : [o];
|
|
4223
|
+
}
|
|
4224
|
+
return {
|
|
4225
|
+
exports: e,
|
|
4226
|
+
options: a
|
|
4227
|
+
};
|
|
4228
|
+
}
|
|
4229
|
+
const cn = {};
|
|
4230
|
+
var is = /* @__PURE__ */ _e(
|
|
4231
|
+
Ke,
|
|
4232
|
+
ss,
|
|
4233
|
+
rs,
|
|
4234
|
+
!1,
|
|
4235
|
+
as,
|
|
4236
|
+
null,
|
|
4237
|
+
null,
|
|
4238
|
+
null
|
|
4239
|
+
);
|
|
4240
|
+
function as(e) {
|
|
4241
|
+
for (let n in cn)
|
|
4242
|
+
this[n] = cn[n];
|
|
4243
|
+
}
|
|
4244
|
+
const os = /* @__PURE__ */ function() {
|
|
4245
|
+
return is.exports;
|
|
4246
|
+
}(), de = {};
|
|
4247
|
+
de.props = {
|
|
4248
|
+
diffChange: {
|
|
4249
|
+
key: "diffChange",
|
|
4250
|
+
required: !0,
|
|
4251
|
+
type: null
|
|
4252
|
+
}
|
|
4253
|
+
};
|
|
4254
|
+
de.setup = (e, n) => ({});
|
|
4255
|
+
de.components = Object.assign({
|
|
4256
|
+
UnifiedLine: os
|
|
4257
|
+
}, de.components);
|
|
4258
|
+
var cs = function() {
|
|
4259
|
+
var e = this, n = e.$createElement, t = e._self._c || n;
|
|
4260
|
+
return t("div", {
|
|
4261
|
+
staticClass: "file"
|
|
4262
|
+
}, [t("table", {
|
|
4263
|
+
staticClass: "diff-table"
|
|
4264
|
+
}, [t("tbody", e._l(e.diffChange, function(s, l) {
|
|
4265
|
+
return t("UnifiedLine", {
|
|
4266
|
+
key: l,
|
|
4267
|
+
attrs: {
|
|
4268
|
+
line: s
|
|
4269
|
+
}
|
|
4270
|
+
});
|
|
4271
|
+
}), 1)])]);
|
|
4272
|
+
}, ls = [];
|
|
4273
|
+
const ln = {};
|
|
4274
|
+
var us = /* @__PURE__ */ _e(
|
|
4275
|
+
de,
|
|
4276
|
+
cs,
|
|
4277
|
+
ls,
|
|
4278
|
+
!1,
|
|
4279
|
+
fs,
|
|
4280
|
+
null,
|
|
4281
|
+
null,
|
|
4282
|
+
null
|
|
4283
|
+
);
|
|
4284
|
+
function fs(e) {
|
|
4285
|
+
for (let n in ln)
|
|
4286
|
+
this[n] = ln[n];
|
|
4287
|
+
}
|
|
4288
|
+
const ds = /* @__PURE__ */ function() {
|
|
4289
|
+
return us.exports;
|
|
4290
|
+
}(), We = {};
|
|
4291
|
+
We.props = {
|
|
4292
|
+
splitLine: {
|
|
4293
|
+
key: "splitLine",
|
|
4294
|
+
required: !0,
|
|
4295
|
+
type: null
|
|
4296
|
+
}
|
|
4297
|
+
};
|
|
4298
|
+
We.setup = (e, n) => ({
|
|
4299
|
+
DiffType: m,
|
|
4300
|
+
getCodeMarker: (s) => s === m.DELETE ? "-" : s === m.ADD ? "+" : ""
|
|
4301
|
+
});
|
|
4302
|
+
var gs = function() {
|
|
4303
|
+
var e = this, n = e.$createElement, t = e._self._c || n;
|
|
4304
|
+
return e.splitLine.fold ? t("tr", [t("td", {
|
|
4305
|
+
staticClass: "blob-num blob-num-empty empty-cell",
|
|
4306
|
+
attrs: {
|
|
4307
|
+
colspan: "1"
|
|
4308
|
+
}
|
|
4309
|
+
}, [e._v(" > ")]), t("td", {
|
|
4310
|
+
staticClass: "blob-code blob-code-empty empty-cell",
|
|
4311
|
+
attrs: {
|
|
4312
|
+
colspan: "3",
|
|
4313
|
+
align: "left"
|
|
4314
|
+
}
|
|
4315
|
+
}, [e._v(" ⋯ ")])]) : t("tr", [e._l([e.splitLine.left, e.splitLine.right], function(s) {
|
|
4316
|
+
return [s.type === e.DiffType.EMPTY ? [t("td", {
|
|
4317
|
+
staticClass: "blob-num blob-num-empty empty-cell"
|
|
4318
|
+
}), t("td", {
|
|
4319
|
+
staticClass: "blob-code blob-code-empty empty-cell"
|
|
4320
|
+
})] : [t("td", {
|
|
4321
|
+
staticClass: "blob-num",
|
|
4322
|
+
class: {
|
|
4323
|
+
"blob-num-deletion": s.type === e.DiffType.DELETE,
|
|
4324
|
+
"blob-num-addition": s.type === e.DiffType.ADD,
|
|
4325
|
+
"blob-num-context": s.type === e.DiffType.EQUAL
|
|
4326
|
+
}
|
|
4327
|
+
}, [e._v(" " + e._s(s.num) + " ")]), t("td", {
|
|
4328
|
+
staticClass: "blob-code",
|
|
4329
|
+
class: {
|
|
4330
|
+
"blob-code-deletion": s.type === e.DiffType.DELETE,
|
|
4331
|
+
"blob-code-addition": s.type === e.DiffType.ADD,
|
|
4332
|
+
"blob-code-context": s.type === e.DiffType.EQUAL
|
|
4333
|
+
}
|
|
4334
|
+
}, [t("span", {
|
|
4335
|
+
staticClass: "blob-code-inner blob-code-marker",
|
|
4336
|
+
attrs: {
|
|
4337
|
+
"data-code-marker": e.getCodeMarker(s.type)
|
|
4338
|
+
},
|
|
4339
|
+
domProps: {
|
|
4340
|
+
innerHTML: e._s(s.code)
|
|
4341
|
+
}
|
|
4342
|
+
})])]];
|
|
4343
|
+
})], 2);
|
|
4344
|
+
}, ps = [];
|
|
4345
|
+
const un = {};
|
|
4346
|
+
var _s = /* @__PURE__ */ _e(
|
|
4347
|
+
We,
|
|
4348
|
+
gs,
|
|
4349
|
+
ps,
|
|
4350
|
+
!1,
|
|
4351
|
+
bs,
|
|
4352
|
+
null,
|
|
4353
|
+
null,
|
|
4354
|
+
null
|
|
4355
|
+
);
|
|
4356
|
+
function bs(e) {
|
|
4357
|
+
for (let n in un)
|
|
4358
|
+
this[n] = un[n];
|
|
4359
|
+
}
|
|
4360
|
+
const hs = /* @__PURE__ */ function() {
|
|
4361
|
+
return _s.exports;
|
|
4362
|
+
}(), ge = {};
|
|
4363
|
+
ge.props = {
|
|
4364
|
+
diffChange: {
|
|
4365
|
+
key: "diffChange",
|
|
4366
|
+
required: !0,
|
|
4367
|
+
type: null
|
|
4368
|
+
}
|
|
4369
|
+
};
|
|
4370
|
+
ge.setup = (e, n) => ({});
|
|
4371
|
+
ge.components = Object.assign({
|
|
4372
|
+
SplitLine: hs
|
|
4373
|
+
}, ge.components);
|
|
4374
|
+
var Es = function() {
|
|
4375
|
+
var e = this, n = e.$createElement, t = e._self._c || n;
|
|
4376
|
+
return t("div", {
|
|
4377
|
+
staticClass: "file"
|
|
4378
|
+
}, [t("table", {
|
|
4379
|
+
staticClass: "file-diff-split diff-table"
|
|
4380
|
+
}, [e._m(0), t("tbody", e._l(e.diffChange, function(s, l) {
|
|
4381
|
+
return t("SplitLine", {
|
|
4382
|
+
key: l,
|
|
4383
|
+
attrs: {
|
|
4384
|
+
"split-line": s
|
|
4385
|
+
}
|
|
4386
|
+
});
|
|
4387
|
+
}), 1)])]);
|
|
4388
|
+
}, ms = [function() {
|
|
4389
|
+
var e = this, n = e.$createElement, t = e._self._c || n;
|
|
4390
|
+
return t("colgroup", [t("col", {
|
|
4391
|
+
attrs: {
|
|
4392
|
+
width: "44"
|
|
4393
|
+
}
|
|
4394
|
+
}), t("col"), t("col", {
|
|
4395
|
+
attrs: {
|
|
4396
|
+
width: "44"
|
|
4397
|
+
}
|
|
4398
|
+
}), t("col")]);
|
|
4399
|
+
}];
|
|
4400
|
+
const fn = {};
|
|
4401
|
+
var ys = /* @__PURE__ */ _e(
|
|
4402
|
+
ge,
|
|
4403
|
+
Es,
|
|
4404
|
+
ms,
|
|
4405
|
+
!1,
|
|
4406
|
+
vs,
|
|
4407
|
+
null,
|
|
4408
|
+
null,
|
|
4409
|
+
null
|
|
4410
|
+
);
|
|
4411
|
+
function vs(e) {
|
|
4412
|
+
for (let n in fn)
|
|
4413
|
+
this[n] = fn[n];
|
|
4414
|
+
}
|
|
4415
|
+
const Ns = /* @__PURE__ */ function() {
|
|
4416
|
+
return ys.exports;
|
|
4417
|
+
}();
|
|
4418
|
+
const pe = {};
|
|
4419
|
+
pe.props = {
|
|
4420
|
+
newString: {
|
|
4421
|
+
key: "newString",
|
|
4422
|
+
required: !0,
|
|
4423
|
+
type: String
|
|
4424
|
+
},
|
|
4425
|
+
oldString: {
|
|
4426
|
+
key: "oldString",
|
|
4427
|
+
required: !0,
|
|
4428
|
+
type: String
|
|
4429
|
+
},
|
|
4430
|
+
language: {
|
|
4431
|
+
key: "language",
|
|
4432
|
+
required: !1,
|
|
4433
|
+
type: String,
|
|
4434
|
+
default: "plaintext"
|
|
4435
|
+
},
|
|
4436
|
+
context: {
|
|
4437
|
+
key: "context",
|
|
4438
|
+
required: !1,
|
|
4439
|
+
type: Number,
|
|
4440
|
+
default: 10
|
|
4441
|
+
},
|
|
4442
|
+
diffStyle: {
|
|
4443
|
+
key: "diffStyle",
|
|
4444
|
+
required: !1,
|
|
4445
|
+
type: String,
|
|
4446
|
+
default: "word"
|
|
4447
|
+
},
|
|
4448
|
+
outputFormat: {
|
|
4449
|
+
key: "outputFormat",
|
|
4450
|
+
required: !1,
|
|
4451
|
+
type: String,
|
|
4452
|
+
default: "line-by-line"
|
|
4453
|
+
},
|
|
4454
|
+
trim: {
|
|
4455
|
+
key: "trim",
|
|
4456
|
+
required: !1,
|
|
4457
|
+
type: Boolean,
|
|
4458
|
+
default: !1
|
|
4459
|
+
},
|
|
4460
|
+
noDiffLineFeed: {
|
|
4461
|
+
key: "noDiffLineFeed",
|
|
4462
|
+
required: !1,
|
|
4463
|
+
type: Boolean,
|
|
4464
|
+
default: !1
|
|
4465
|
+
}
|
|
4466
|
+
};
|
|
4467
|
+
pe.setup = (e, n) => {
|
|
4468
|
+
const t = e, s = ye(() => t.outputFormat === "line-by-line"), l = ye(() => {
|
|
4469
|
+
const r = t.trim ? t.oldString.trim() : t.oldString;
|
|
4470
|
+
return t.noDiffLineFeed ? r.replace(/(\r\n)/g, `
|
|
4471
|
+
`) : r;
|
|
4472
|
+
}), c = ye(() => {
|
|
4473
|
+
const r = t.trim ? t.newString.trim() : t.newString;
|
|
4474
|
+
return t.noDiffLineFeed ? r.replace(/(\r\n)/g, `
|
|
4475
|
+
`) : r;
|
|
4476
|
+
}), i = ye(() => s.value ? ts(l.value, c.value, t.language, t.diffStyle, t.context) : ns(l.value, c.value, t.language, t.diffStyle, t.context));
|
|
4477
|
+
return {
|
|
4478
|
+
isUnifiedViewer: s,
|
|
4479
|
+
diffChange: i
|
|
4480
|
+
};
|
|
4481
|
+
};
|
|
4482
|
+
pe.components = Object.assign({
|
|
4483
|
+
UnifiedViewer: ds,
|
|
4484
|
+
SplitViewer: Ns
|
|
4485
|
+
}, pe.components);
|
|
4486
|
+
var Ts = function() {
|
|
4487
|
+
var e = this, n = e.$createElement, t = e._self._c || n;
|
|
4488
|
+
return t("div", {
|
|
4489
|
+
staticClass: "code-diff-view"
|
|
4490
|
+
}, [e.isUnifiedViewer ? t("UnifiedViewer", {
|
|
4491
|
+
attrs: {
|
|
4492
|
+
"diff-change": e.diffChange
|
|
4493
|
+
}
|
|
4494
|
+
}) : t("SplitViewer", {
|
|
4495
|
+
attrs: {
|
|
4496
|
+
"diff-change": e.diffChange
|
|
4497
|
+
}
|
|
4498
|
+
})], 1);
|
|
4499
|
+
}, As = [];
|
|
4500
|
+
const dn = {};
|
|
4501
|
+
var ws = /* @__PURE__ */ _e(
|
|
4502
|
+
pe,
|
|
4503
|
+
Ts,
|
|
4504
|
+
As,
|
|
4505
|
+
!1,
|
|
4506
|
+
Ss,
|
|
4507
|
+
null,
|
|
4508
|
+
null,
|
|
4509
|
+
null
|
|
4510
|
+
);
|
|
4511
|
+
function Ss(e) {
|
|
4512
|
+
for (let n in dn)
|
|
4513
|
+
this[n] = dn[n];
|
|
4514
|
+
}
|
|
4515
|
+
const Ms = /* @__PURE__ */ function() {
|
|
4516
|
+
return ws.exports;
|
|
4517
|
+
}(), Rs = (e) => {
|
|
4518
|
+
e.component("CodeDiff", Ms);
|
|
4519
|
+
}, Ls = {
|
|
4520
|
+
install: Rs,
|
|
4521
|
+
hljs: G
|
|
4522
|
+
};
|
|
4523
|
+
export {
|
|
4524
|
+
Ms as CodeDiff,
|
|
4525
|
+
Ls as default
|
|
4526
|
+
};
|