diff --git a/.editorconfig b/.editorconfig index e6dd7e8..c8e783d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -29,14 +29,3 @@ ij_wrap_on_typing = false ij_any_wrap_long_lines = false ij_markdown_wrap_text_if_long = false ij_markdown_wrap_text_inside_blockquotes = false - -[*.js] -ij_any_space_before_for_left_brace = true -ij_any_space_before_for_parentheses = false -ij_any_space_before_if_left_brace = true -ij_any_space_before_if_parentheses = false -ij_any_spaces_within_braces = true -ij_typescript_spaces_within_imports = true -ij_javascript_spaces_within_imports = true -ij_typescript_spaces_within_object_literal_braces = true -ij_javascript_spaces_within_object_literal_braces = true diff --git a/.env b/.env deleted file mode 100644 index bf78096..0000000 --- a/.env +++ /dev/null @@ -1,6 +0,0 @@ -MAIN_LOG=debug -FILE_LOG=error - -RUST_BACKTRACE=full -RUST_LIB_BACKTRACE=1 -RUST_SPANTRACE=0 diff --git a/.github/workflows/publish-tutorial.yml b/.github/workflows/publish-tutorial.yml deleted file mode 100644 index e8dec42..0000000 --- a/.github/workflows/publish-tutorial.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Publish tutorial -on: - push: - branches: - - master -jobs: - publish-tutorial: - runs-on: ubuntu-22.04 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - steps: - - id: checkout - name: Checkout - uses: actions/checkout@v3 - - id: setup-rust - name: Setup Rust - uses: ATiltedTree/setup-rust@v1 - with: - rust-version: stable - # Caching for tutorial stepper application - - id: cache-stepper - name: Cache stepper - uses: actions/cache@v3 - with: - path: tutorial/stepper/target - key: ${{ runner.os }}-stepper-${{ hashFiles('tutorial/stepper/Cargo.lock') }} - restore-keys: ${{ runner.os }}-stepper- - # Run stepper to verify that tutorial code works, and to generate diffs. - - id: run-stepper - name: Run stepper - run: | - cd tutorial/stepper - cargo run -- --debug - - id: setup-mdbook - name: Setup mdBook - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: '0.4.34' - - id: install-cargo-binstall - name: Install cargo-binstall - uses: taiki-e/install-action@v2 - with: - tool: cargo-binstall - # Copy files for hashing in the next step, as `hashFiles` only works inside the workspace, not the home directory. - - id: copy-files-for-hashing - name: Copy files for hashing into workspace - run: | - cp ~/.cargo/.crates.toml .crates.toml.hash - cp ~/.cargo/.crates2.json .crates2.json.hash - # Caching for cargo binaries, mainly for speeding up `install-mdbook-processors`. - - id: cache-cargo-binaries - name: Cache Cargo binaries - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - ~/.cargo/.crates.toml - ~/.cargo/.crates2.json - key: ${{ runner.os }}-cargo-${{ hashFiles('.crates.toml.hash', '.crates2.json.hash') }} - restore-keys: ${{ runner.os }}-cargo- - - id: install-mdbook-preprocessors - name: Install mdBook preprocessors - run: cargo binstall --no-confirm --no-symlinks mdbook-admonish mdbook-external-links - # Caching for tutorial mdbook-diff2html application - - id: cache-mdbook-diff2html - name: Cache mdbook-diff2html - uses: actions/cache@v3 - with: - path: tutorial/mdbook-diff2html/target - key: ${{ runner.os }}-mdbook-diff2html-${{ hashFiles('tutorial/mdbook-diff2html/Cargo.lock') }} - restore-keys: ${{ runner.os }}-mdbook-diff2html- - - id: install-mdbook-diff2html-preprocessor - name: Install mdbook-diff2html preprocessors - run: cargo install --path tutorial/mdbook-diff2html - - id: build - name: Build tutorial mdBook - run: | - cd tutorial - mdbook build - - id: deploy - name: Deploy to GitHub pages - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/master' }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./tutorial/book diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 53% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index f8fec1b..9127cbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Build +name: Test on: push: branches: @@ -7,7 +7,7 @@ on: branches: - master jobs: - build: + test: strategy: fail-fast: false matrix: @@ -26,19 +26,9 @@ jobs: name: Cache Cargo uses: actions/cache@v3 with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - tutorial/stepper/target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - id: build-pie - name: Build PIE + path: target + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - id: test + name: Test run: cargo test - - id: run-tutorial-stepper - name: Run tutorial stepper - run: | - cd tutorial/stepper - cargo run -- --debug diff --git a/README.md b/README.md index df1aef0..caac659 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# PIE & Build your own Programmatic Incremental Build System +# PIE: a Programmatic Incremental Build System in Rust -Rust implementation of [PIE](https://github.com/metaborg/pie), a programmatic incremental build system, along with a tutorial explaining how to implement it, so you can understand and build your own programmatic incremental build system. -Live hosted version of the tutorial at: +PIE is a Programmatic Incremental Build System, a hybrid incremental build system and incremental computation system. +With PIE, you _program_ your build scripts in Rust against the PIE API. +Then, PIE will correctly and incrementally execute your build script! + +PIE is currently under development and has not been published to crates.io yet, but it has decent test coverage and is ready for experimental use. +A better README explaining the library is in the works. + +If you want to learn more about Programmatic Incremental Build Systems, check out this programming tutorial: . +It explains the concepts behind Programmatic Incremental Build Systems through implementation and experimentation. diff --git a/tutorial/.gitignore b/tutorial/.gitignore deleted file mode 100644 index b8789c6..0000000 --- a/tutorial/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/book -/src/gen diff --git a/tutorial/README.md b/tutorial/README.md deleted file mode 100644 index 4f6566f..0000000 --- a/tutorial/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# Build your own Programmatic Incremental Build System - -A tutorial on building your own programmatic incremental build system, aiming to teach the concepts of PIE. -Live hosted version at: - -## Requirements - -Install mdBook and several preprocessors: - -```shell -cargo install mdbook mdbook-admonish mdbook-external-links -cargo install --path mdbook-diff2html -``` - -If you have [`cargo install-update`](https://github.com/nabijaczleweli/cargo-update) installed, you can instead install and/or update the external binaries with: - -```shell -cargo install-update mdbook mdbook-admonish mdbook-external-links -``` - -## Building - -To test all the code fragments and generate outputs in `gen` which the tutorial uses, first run: - -```shell -cd stepper -cargo run -``` - -Then, to build the tutorial once, run: - -```shell -mdbook build -``` - -Or to interactively build, run: - -```shell -mdbook serve -``` - -## Generate source code - -To generate all source code into `stepper/dst`, run: - -```shell -cd stepper -cargo run -- step-all -d dst --skip-cargo --skip-outputs -``` - -## Stack & Structure - -The book is built with [mdBook](https://rust-lang.github.io/mdBook/). -We use the following external mdBook preprocessors: - -- [mdbook-admonish](https://github.com/tommilligan/mdbook-admonish) -- [mdbook-external-links](https://github.com/jonahgoldwastaken/mdbook-external-links) - -Structure: - -- `book.toml`: main mdBook configuration file. -- `src`: book source code. - - `src/SUMMARY.md`: main mdBook file with the table of contents for the book. - - `src/gen`: generated diffs and cargo outputs for the book. Part of `src` for change detection. - - `src/*`: markdown files and code (diff) fragments of the book. -- `theme`: customization of the default theme -- `mdbook-admonish.css`: CSS for the `mdbook-admonish` preprocessor. Can be updated by running `mdbook-admonish install`. -- `stepper`: command-line application (in Rust) that checks all source code (additions, insertions, diffs) by stepping over them in order and building them with cargo, ensuring that the code in the book is actually valid. It also generates diffs between source code fragments and produces outputs (such as cargo stdout) and stores them in `src/gen`. - - `stepper/src/app.rs`: stepper instructions. Modify this to modify what/how the source code fragments of the book are checked. -- `mdbook-diff2html`: mdBook preprocessor that renders diffs with [Diff2Html](https://github.com/rtfpessoa/diff2html) -- `diff2html-ui-base.min.js`: Diff2Html browser-side implementation -- `diff2html.min.css`: Diff2Html CSS (customized, see below) - -### Diff2Html - -Modifications to get it working: - -- Initialize the default mdBook [theme](https://rust-lang.github.io/mdBook/format/theme/index.html) into `theme`. -- Replace highlight.js with the newest version, [11.8.0](https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js) at the time of writing. - - Place that file in `theme/highlight.js`. - - I did not replace the highlight.js theme (which would go in the `theme/highlight.css` file), as it seems to be working. - - See [this page](https://cdnjs.com/libraries/highlight.js) for version specific downloads. -- Install Diff2Html JS and CSS files - - [Download diff2html-ui-base.min.js](https://cdn.jsdelivr.net/npm/diff2html@3.4.42/bundles/js/diff2html-ui-base.min.js) into `src/diff2html-ui-base-.min.js`. - - [Download diff2html.min.css](https://cdn.jsdelivr.net/npm/diff2html@3.4.42/bundles/css/diff2html.min.css) into `src/diff2html.min.css`. - - Added those to custom JS and CSS files in `book.toml`. -- Styling modifications - - Remove things that we don't need to override: favicon, fonts. - - Copy `ayu-highlight.css` into `theme/ayu-highlight.css`. - - Modify files to change and fix styling. Changes are denoted with `CHANGE`. - - Note that we're modifying some generated files, so updating will be difficult. diff --git a/tutorial/book.toml b/tutorial/book.toml deleted file mode 100644 index 9e1a122..0000000 --- a/tutorial/book.toml +++ /dev/null @@ -1,38 +0,0 @@ -[book] -authors = ["Gabriel Konat"] -language = "en" -multilingual = false -src = "src" -title = "Build your own Programmatic Incremental Build System" - -[build] -create-missing = false - -[output.html] -preferred-dark-theme = "ayu" -additional-js = ["./diff2html-ui-base.min.js"] -additional-css = ["./diff2html.min.css", "./mdbook-admonish.css"] -git-repository-url = "https://github.com/Gohla/pie/" -edit-url-template = "https://github.com/Gohla/pie/edit/master/tutorial/{path}" - -[output.html.playground] -copy-js = false -runnable = false - -# Run all preprocessors after "links" so that `{{ #include }}` first gets processed. - -[preprocessor.diff2html] -renderers = ["html"] -# Run after "external-links" because it inserts markup into raw HTML produced by diff2html, breaking it. -after = ["links", "external-links"] - -[preprocessor.admonish] -renderers = ["html"] -after = ["links"] -assets_version = "3.0.0" # do not edit: managed by `mdbook-admonish install` -command = "mdbook-admonish" - -[preprocessor.external-links] -renderers = ["html"] -# Run after "admonish" so that links inside it get properly processed. -after = ["links", "admonish"] diff --git a/tutorial/diff2html-ui-base.min.js b/tutorial/diff2html-ui-base.min.js deleted file mode 100644 index 42ebb1a..0000000 --- a/tutorial/diff2html-ui-base.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,(()=>{return e={696:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertChangesToDMP=function(e){for(var t,n,i=[],r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertChangesToXML=function(e){for(var t=[],n=0;n"):i.removed&&t.push(""),t.push(i.value.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")),i.added?t.push(""):i.removed&&t.push("")}return t.join("")}},976:(e,t,n)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.diffArrays=function(e,t,n){return r.diff(e,t,n)},t.arrayDiff=void 0;var r=new(((i=n(913))&&i.__esModule?i:{default:i}).default);t.arrayDiff=r,r.tokenize=function(e){return e.slice()},r.join=r.removeEmpty=function(e){return e}},913:(e,t)=>{"use strict";function n(){}function i(e,t,n,i,r){for(var s=0,l=t.length,a=0,o=0;se.length?n:e})),c.value=e.join(f)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(o+=c.count)}}var u=t[l-1];return l>1&&"string"==typeof u.value&&(u.added||u.removed)&&e.equals("",u.value)&&(t[l-2].value+=u.value,t.pop()),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var s=this;function l(e){return r?(setTimeout((function(){r(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,o=e.length,c=1,d=a+o;n.maxEditLength&&(d=Math.min(d,n.maxEditLength));var f=[{newPos:-1,components:[]}],u=this.extractCommon(f[0],t,e,0);if(f[0].newPos+1>=a&&u+1>=o)return l([{value:this.join(t),count:t.length}]);function p(){for(var n=-1*c;n<=c;n+=2){var r=void 0,d=f[n-1],u=f[n+1],p=(u?u.newPos:0)-n;d&&(f[n-1]=void 0);var h=d&&d.newPos+1=a&&p+1>=o)return l(i(s,r.components,t,e,s.useLongestToken));f[n]=r}else f[n]=void 0}var b;c++}if(r)!function e(){setTimeout((function(){if(c>d)return r();p()||e()}),0)}();else for(;c<=d;){var h=p();if(h)return h}},pushComponent:function(e,t,n){var i=e[e.length-1];i&&i.added===t&&i.removed===n?e[e.length-1]={count:i.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,i){for(var r=t.length,s=n.length,l=e.newPos,a=l-i,o=0;l+1{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.diffChars=function(e,t,n){return r.diff(e,t,n)},t.characterDiff=void 0;var r=new(((i=n(913))&&i.__esModule?i:{default:i}).default);t.characterDiff=r},852:(e,t,n)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.diffCss=function(e,t,n){return r.diff(e,t,n)},t.cssDiff=void 0;var r=new(((i=n(913))&&i.__esModule?i:{default:i}).default);t.cssDiff=r,r.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)}},276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffJson=function(e,t,n){return o.diff(e,t,n)},t.canonicalize=c,t.jsonDiff=void 0;var i,r=(i=n(913))&&i.__esModule?i:{default:i},s=n(187);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var a=Object.prototype.toString,o=new r.default;function c(e,t,n,i,r){var s,o;for(t=t||[],n=n||[],i&&(e=i(r,e)),s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffLines=function(e,t,n){return l.diff(e,t,n)},t.diffTrimmedLines=function(e,t,n){var i=(0,s.generateOptions)(n,{ignoreWhitespace:!0});return l.diff(e,t,i)},t.lineDiff=void 0;var i,r=(i=n(913))&&i.__esModule?i:{default:i},s=n(9),l=new r.default;t.lineDiff=l,l.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.diffSentences=function(e,t,n){return r.diff(e,t,n)},t.sentenceDiff=void 0;var r=new(((i=n(913))&&i.__esModule?i:{default:i}).default);t.sentenceDiff=r,r.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)}},303:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffWords=function(e,t,n){return n=(0,s.generateOptions)(n,{ignoreWhitespace:!0}),o.diff(e,t,n)},t.diffWordsWithSpace=function(e,t,n){return o.diff(e,t,n)},t.wordDiff=void 0;var i,r=(i=n(913))&&i.__esModule?i:{default:i},s=n(9),l=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,a=/\S/,o=new r.default;t.wordDiff=o,o.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!a.test(e)&&!a.test(t)},o.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Diff",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"diffChars",{enumerable:!0,get:function(){return s.diffChars}}),Object.defineProperty(t,"diffWords",{enumerable:!0,get:function(){return l.diffWords}}),Object.defineProperty(t,"diffWordsWithSpace",{enumerable:!0,get:function(){return l.diffWordsWithSpace}}),Object.defineProperty(t,"diffLines",{enumerable:!0,get:function(){return a.diffLines}}),Object.defineProperty(t,"diffTrimmedLines",{enumerable:!0,get:function(){return a.diffTrimmedLines}}),Object.defineProperty(t,"diffSentences",{enumerable:!0,get:function(){return o.diffSentences}}),Object.defineProperty(t,"diffCss",{enumerable:!0,get:function(){return c.diffCss}}),Object.defineProperty(t,"diffJson",{enumerable:!0,get:function(){return d.diffJson}}),Object.defineProperty(t,"canonicalize",{enumerable:!0,get:function(){return d.canonicalize}}),Object.defineProperty(t,"diffArrays",{enumerable:!0,get:function(){return f.diffArrays}}),Object.defineProperty(t,"applyPatch",{enumerable:!0,get:function(){return u.applyPatch}}),Object.defineProperty(t,"applyPatches",{enumerable:!0,get:function(){return u.applyPatches}}),Object.defineProperty(t,"parsePatch",{enumerable:!0,get:function(){return p.parsePatch}}),Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return h.merge}}),Object.defineProperty(t,"structuredPatch",{enumerable:!0,get:function(){return g.structuredPatch}}),Object.defineProperty(t,"createTwoFilesPatch",{enumerable:!0,get:function(){return g.createTwoFilesPatch}}),Object.defineProperty(t,"createPatch",{enumerable:!0,get:function(){return g.createPatch}}),Object.defineProperty(t,"convertChangesToDMP",{enumerable:!0,get:function(){return b.convertChangesToDMP}}),Object.defineProperty(t,"convertChangesToXML",{enumerable:!0,get:function(){return m.convertChangesToXML}});var i,r=(i=n(913))&&i.__esModule?i:{default:i},s=n(630),l=n(303),a=n(187),o=n(146),c=n(852),d=n(276),f=n(976),u=n(690),p=n(719),h=n(51),g=n(286),b=n(696),m=n(826)},690:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyPatch=l,t.applyPatches=function(e,t){"string"==typeof e&&(e=(0,r.parsePatch)(e));var n=0;!function i(){var r=e[n++];if(!r)return t.complete();t.loadFile(r,(function(e,n){if(e)return t.complete(e);var s=l(n,r,t);t.patched(r,s,(function(e){if(e)return t.complete(e);i()}))}))}()};var i,r=n(719),s=(i=n(495))&&i.__esModule?i:{default:i};function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t&&(t=(0,r.parsePatch)(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}var i,l,a=e.split(/\r\n|[\n\v\f\r\x85]/),o=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],c=t.hunks,d=n.compareLine||function(e,t,n,i){return t===i},f=0,u=n.fuzzFactor||0,p=0,h=0;function g(e,t){for(var n=0;n0?i[0]:" ",s=i.length>0?i.substr(1):i;if(" "===r||"-"===r){if(!d(t+1,a[t],r,s)&&++f>u)return!1;t++}}return!0}for(var b=0;b0?T[0]:" ",k=T.length>0?T.substr(1):T,N=S.linedelimiters[C];if(" "===_)O++;else if("-"===_)a.splice(O,1),o.splice(O,1);else if("+"===_)a.splice(O,0,k),o.splice(O,0,N),O++;else if("\\"===_){var E=S.lines[C-1]?S.lines[C-1][0]:null;"+"===E?i=!0:"-"===E&&(l=!0)}}}if(i)for(;!a[a.length-1];)a.pop(),o.pop();else l&&(a.push(""),o.push("\n"));for(var P=0;P{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.structuredPatch=l,t.formatPatch=a,t.createTwoFilesPatch=o,t.createPatch=function(e,t,n,i,r,s){return o(e,e,t,n,i,r,s)};var i=n(187);function r(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?v(a.lines.slice(-o.context)):[],f-=p.length,u-=p.length)}(l=p).push.apply(l,r(i.map((function(e){return(t.added?"+":"-")+e})))),t.added?g+=i.length:h+=i.length}else{if(f)if(i.length<=2*o.context&&e=c.length-2&&i.length<=o.context){var x=/\n$/.test(n),j=/\n$/.test(s),L=0==i.length&&p.length>w.oldLines;!x&&L&&n.length>0&&p.splice(w.oldLines,0,"\\ No newline at end of file"),(x||L)&&j||p.push("\\ No newline at end of file")}d.push(w),f=0,u=0,p=[]}h+=i.length,g+=i.length}},m=0;m{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcLineCount=o,t.merge=function(e,t,n){e=c(e,n),t=c(t,n);var i={};(e.index||t.index)&&(i.index=e.index||t.index),(e.newFileName||t.newFileName)&&(d(e)?d(t)?(i.oldFileName=f(i,e.oldFileName,t.oldFileName),i.newFileName=f(i,e.newFileName,t.newFileName),i.oldHeader=f(i,e.oldHeader,t.oldHeader),i.newHeader=f(i,e.newHeader,t.newHeader)):(i.oldFileName=e.oldFileName,i.newFileName=e.newFileName,i.oldHeader=e.oldHeader,i.newHeader=e.newHeader):(i.oldFileName=t.oldFileName||e.oldFileName,i.newFileName=t.newFileName||e.newFileName,i.oldHeader=t.oldHeader||e.oldHeader,i.newHeader=t.newHeader||e.newHeader)),i.hunks=[];for(var r=0,s=0,l=0,a=0;re.length)&&(t=e.length);for(var n=0,i=new Array(t);n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePatch=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),i=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],r=[],s=0;function l(){var e={};for(r.push(e);s{"use strict";function n(e,t){if(t.length>e.length)return!1;for(var n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var i=!0,r=!1,s=!1,l=1;return function a(){if(i&&!s){if(r?l++:i=!1,e+l<=n)return l;s=!0}if(!r)return s||(i=!0),t<=e-l?-l++:(r=!0,a())}}},9:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateOptions=function(e,t){if("function"==typeof e)t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}},397:(e,t)=>{!function(e){var t=/\S/,n=/\"/g,i=/\n/g,r=/\r/g,s=/\\/g,l=/\u2028/,a=/\u2029/;function o(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function c(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var i=1,r=e.length;i":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(n,i){var r,s=n.length,l=0,a=null,d=null,f="",u=[],p=!1,h=0,g=0,b="{{",m="}}";function v(){f.length>0&&(u.push({tag:"_t",text:new String(f)}),f="")}function y(n,i){if(v(),n&&function(){for(var n=!0,i=g;i"==r.tag&&(r.indent=u[s].text.toString()),u.splice(s,1));else i||u.push({tag:"\n"});p=!1,g=u.length}function w(e,t){var n="="+m,i=e.indexOf(n,t),r=o(e.substring(e.indexOf("=",t)+1,i)).split(" ");return b=r[0],m=r[r.length-1],i+n.length-1}for(i&&(i=i.split(" "),b=i[0],m=i[1]),h=0;h0;){if(o=t.shift(),s&&"<"==s.tag&&!(o.tag in d))throw new Error("Illegal content in < super tag.");if(e.tags[o.tag]<=e.tags.$||u(o,r))i.push(o),o.nodes=f(t,o.tag,i,r);else{if("/"==o.tag){if(0===i.length)throw new Error("Closing tag without opener: /"+o.n);if(a=i.pop(),o.n!=a.n&&!p(o.n,a.n,r))throw new Error("Nesting error: "+a.n+" vs. "+o.n);return a.end=o.i,l}"\n"==o.tag&&(o.last=0==t.length||"\n"==t[0].tag)}l.push(o)}if(i.length>0)throw new Error("missing closing tag: "+i.pop().n);return l}function u(e,t){for(var n=0,i=t.length;n":v,"<":function(t,n){var i={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,i);var r=n.partials[v(t,n)];r.subs=i.subs,r.partials=i.partials},$:function(t,n){var i={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,i),n.subs[t.n]=i.code,n.inPartial||(n.code+='t.sub("'+b(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=w('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+m(e.n)+'("'+b(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=w('"'+b(e.text)+'"')},"{":y,"&":y},e.walk=function(t,n){for(var i,r=0,s=t.length;r{var i=n(397);i.Template=n(882).Template,i.template=i.Template,e.exports=i},882:(e,t)=>{!function(e){function t(e,t,n){var i;return t&&"object"==typeof t&&(void 0!==t[e]?i=t[e]:n&&t.get&&"function"==typeof t.get&&(i=t.get(e))),i}e.Template=function(e,t,n,i){e=e||{},this.r=e.code||this.r,this.c=n,this.options=i||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,n){return""},v:function(e){return e=o(e),a.test(e)?e.replace(n,"&").replace(i,"<").replace(r,">").replace(s,"'").replace(l,"""):e},t:o,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var n=this.partials[e],i=t[n.name];if(n.instance&&n.base==i)return n.instance;if("string"==typeof i){if(!this.c)throw new Error("No compiler available.");i=this.c.compile(i,this.options)}if(!i)return null;if(this.partials[e].base=i,n.subs){for(key in t.stackText||(t.stackText={}),n.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);i=function(e,t,n,i,r,s){function l(){}function a(){}var o;l.prototype=e,a.prototype=e.subs;var c=new l;for(o in c.subs=new a,c.subsText={},c.buf="",i=i||{},c.stackSubs=i,c.subsText=s,t)i[o]||(i[o]=t[o]);for(o in i)c.subs[o]=i[o];for(o in r=r||{},c.stackPartials=r,n)r[o]||(r[o]=n[o]);for(o in r)c.partials[o]=r[o];return c}(i,n.subs,n.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=i,i},rp:function(e,t,n,i){var r=this.ep(e,n);return r?r.ri(t,n,i):""},rs:function(e,t,n){var i=e[e.length-1];if(c(i))for(var r=0;r=0;o--)if(void 0!==(s=t(e,n[o],a))){l=!0;break}return l?(r||"function"!=typeof s||(s=this.mv(s,n,i)),s):!r&&""},ls:function(e,t,n,i,r){var s=this.options.delimiters;return this.options.delimiters=r,this.b(this.ct(o(e.call(t,i)),t,n)),this.options.delimiters=s,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,i,r,s,l){var a,o=t[t.length-1],c=e.call(o);return"function"==typeof c?!!i||(a=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,o,n,a.substring(r,s),l)):c},mv:function(e,t,n){var i=t[t.length-1],r=e.call(i);return"function"==typeof r?this.ct(o(r.call(i)),i,n):r},sub:function(e,t,n,i){var r=this.subs[e];r&&(this.activeSub=e,r(t,n,this,i),this.activeSub=!1)}};var n=/&/g,i=//g,s=/\'/g,l=/\"/g,a=/[&<>\"\']/;function o(e){return String(null==e?"":e)}var c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(t)},468:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=n(699),r=n(593);function s(e,t){const n=e.split(".");return n.length>1?n[n.length-1]:t}function l(e,t){return t.reduce(((t,n)=>t||e.startsWith(n)),!1)}const a=["a/","b/","i/","w/","c/","o/"];function o(e,t,n){const i=void 0!==n?[...a,n]:a,s=t?new RegExp(`^${(0,r.escapeForRegExp)(t)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,l=""]=s.exec(e)||[],o=i.find((e=>0===l.indexOf(e)));return(o?l.slice(o.length):l).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}t.parse=function(e,t={}){const n=[];let r=null,a=null,c=null,d=null,f=null,u=null,p=null;const h="--- ",g="+++ ",b="@@",m=/^old mode (\d{6})/,v=/^new mode (\d{6})/,y=/^deleted file mode (\d{6})/,w=/^new file mode (\d{6})/,x=/^copy from "?(.+)"?/,j=/^copy to "?(.+)"?/,L=/^rename from "?(.+)"?/,S=/^rename to "?(.+)"?/,O=/^similarity index (\d+)%/,C=/^dissimilarity index (\d+)%/,T=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,_=/^Binary files (.*) and (.*) differ/,k=/^GIT binary patch/,N=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,E=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,P=/^new file mode (\d{6})/,M=/^deleted file mode (\d{6}),(\d{6})/,H=e.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,"\n").split("\n");function D(){null!==a&&null!==r&&(r.blocks.push(a),a=null)}function F(){null!==r&&(r.oldName||null===u||(r.oldName=u),r.newName||null===p||(r.newName=p),r.newName&&(n.push(r),r=null)),u=null,p=null}function I(){D(),F(),r={blocks:[],deletedLines:0,addedLines:0}}function A(e){let t;D(),null!==r&&((t=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(e))?(r.isCombined=!1,c=parseInt(t[1],10),f=parseInt(t[2],10)):(t=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(e))?(r.isCombined=!0,c=parseInt(t[1],10),d=parseInt(t[2],10),f=parseInt(t[3],10)):(e.startsWith(b)&&console.error("Failed to parse lines, starting in 0!"),c=0,f=0,r.isCombined=!1)),a={lines:[],oldStartLine:c,oldStartLine2:d,newStartLine:f,header:e}}return H.forEach(((e,d)=>{if(!e||e.startsWith("*"))return;let D;const F=H[d-1],q=H[d+1],z=H[d+2];if(e.startsWith("diff --git")||e.startsWith("diff --combined")){if(I(),(D=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(e))&&(u=o(D[1],void 0,t.dstPrefix),p=o(D[2],void 0,t.srcPrefix)),null===r)throw new Error("Where is my file !!!");return void(r.isGitDiff=!0)}if(e.startsWith("Binary files")&&!(null==r?void 0:r.isGitDiff)){if(I(),(D=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(e))&&(u=o(D[1],void 0,t.dstPrefix),p=o(D[2],void 0,t.srcPrefix)),null===r)throw new Error("Where is my file !!!");return void(r.isBinary=!0)}if((!r||!r.isGitDiff&&r&&e.startsWith(h)&&q.startsWith(g)&&z.startsWith(b))&&I(),null==r?void 0:r.isTooBig)return;if(r&&("number"==typeof t.diffMaxChanges&&r.addedLines+r.deletedLines>t.diffMaxChanges||"number"==typeof t.diffMaxLineLength&&e.length>t.diffMaxLineLength))return r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],a=null,void A("function"==typeof t.diffTooBigMessage?t.diffTooBigMessage(n.length):"Diff too big to be displayed");if(e.startsWith(h)&&q.startsWith(g)||e.startsWith(g)&&F.startsWith(h)){if(r&&!r.oldName&&e.startsWith("--- ")&&(D=function(e,t){return o(e,"---",t)}(e,t.srcPrefix)))return r.oldName=D,void(r.language=s(r.oldName,r.language));if(r&&!r.newName&&e.startsWith("+++ ")&&(D=function(e,t){return o(e,"+++",t)}(e,t.dstPrefix)))return r.newName=D,void(r.language=s(r.newName,r.language))}if(r&&(e.startsWith(b)||r.isGitDiff&&r.oldName&&r.newName&&!a))return void A(e);if(a&&(e.startsWith("+")||e.startsWith("-")||e.startsWith(" ")))return void function(e){if(null===r||null===a||null===c||null===f)return;const t={content:e},n=r.isCombined?["+ "," +","++"]:["+"],s=r.isCombined?["- "," -","--"]:["-"];l(e,n)?(r.addedLines++,t.type=i.LineType.INSERT,t.oldNumber=void 0,t.newNumber=f++):l(e,s)?(r.deletedLines++,t.type=i.LineType.DELETE,t.oldNumber=c++,t.newNumber=void 0):(t.type=i.LineType.CONTEXT,t.oldNumber=c++,t.newNumber=f++),a.lines.push(t)}(e);const W=!function(e,t){let n=t;for(;n'),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(i.rp("'),i.b(i.v(i.f("fileName",e,t,0))),i.b(""),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(' '),i.b(i.v(i.f("addedLines",e,t,0))),i.b(""),i.b("\n"+n),i.b(' '),i.b(i.v(i.f("deletedLines",e,t,0))),i.b(""),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b(""),i.fl()},partials:{"'),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b(' Files changed ('),i.b(i.v(i.f("filesNumber",e,t,0))),i.b(")"),i.b("\n"+n),i.b(' hide'),i.b("\n"+n),i.b(' show'),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b('
    '),i.b("\n"+n),i.b(" "),i.b(i.t(i.f("files",e,t,0))),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b(""),i.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-block-header"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b(""),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b('
'),i.s(i.f("blockHeader",e,t,1),e,t,0,156,173,"{{ }}")&&(i.rs(e,t,(function(e,t,n){n.b(n.t(n.f("blockHeader",e,t,0)))})),e.pop()),i.s(i.f("blockHeader",e,t,1),e,t,1,0,0,"")||i.b(" "),i.b("
"),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b(""),i.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-empty-diff"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b(""),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b(" File without changes"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b(""),i.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-file-path"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b(''),i.b("\n"+n),i.b(i.rp("'),i.b(i.v(i.f("fileDiffName",e,t,0))),i.b(""),i.b("\n"+n),i.b(i.rp(""),i.b("\n"+n),i.b('"),i.fl()},partials:{""),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(" "),i.b(i.t(i.f("lineNumber",e,t,0))),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.s(i.f("prefix",e,t,1),e,t,0,162,238,"{{ }}")&&(i.rs(e,t,(function(e,t,i){i.b(' '),i.b(i.t(i.f("prefix",e,t,0))),i.b(""),i.b("\n"+n)})),e.pop()),i.s(i.f("prefix",e,t,1),e,t,1,0,0,"")||(i.b('  '),i.b("\n"+n)),i.s(i.f("content",e,t,1),e,t,0,371,445,"{{ }}")&&(i.rs(e,t,(function(e,t,i){i.b(' '),i.b(i.t(i.f("content",e,t,0))),i.b(""),i.b("\n"+n)})),e.pop()),i.s(i.f("content",e,t,1),e,t,1,0,0,"")||(i.b('
'),i.b("\n"+n)),i.b("
"),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b(""),i.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-wrapper"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('
'),i.b("\n"+n),i.b(" "),i.b(i.t(i.f("content",e,t,0))),i.b("\n"+n),i.b("
"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-added"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-changed"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-deleted"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-renamed"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["line-by-line-file-diff"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('
'),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b(" "),i.b(i.t(i.f("filePath",e,t,0))),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(" "),i.b(i.t(i.f("diffs",e,t,0))),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["line-by-line-numbers"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('
'),i.b(i.v(i.f("oldNumber",e,t,0))),i.b("
"),i.b("\n"+n),i.b('
'),i.b(i.v(i.f("newNumber",e,t,0))),i.b("
"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["side-by-side-file-diff"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('
'),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b(" "),i.b(i.t(i.f("filePath",e,t,0))),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(" "),i.b(i.t(i.d("diffs.left",e,t,0))),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b('
'),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(' '),i.b("\n"+n),i.b(" "),i.b(i.t(i.d("diffs.right",e,t,0))),i.b("\n"+n),i.b(" "),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.b("\n"+n),i.b("
"),i.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-added"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('ADDED'),i.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-changed"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('CHANGED'),i.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-deleted"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('DELETED'),i.fl()},partials:{},subs:{}}),t.defaultTemplates["tag-file-renamed"]=new l.Template({code:function(e,t,n){var i=this;return i.b(n=n||""),i.b('RENAMED'),i.fl()},partials:{},subs:{}})},834:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.html=t.parse=t.defaultDiff2HtmlConfig=void 0;const a=s(n(468)),o=s(n(479)),c=s(n(378)),d=s(n(170)),f=n(699),u=l(n(63));t.defaultDiff2HtmlConfig=Object.assign(Object.assign(Object.assign({},c.defaultLineByLineRendererConfig),d.defaultSideBySideRendererConfig),{outputFormat:f.OutputFormatType.LINE_BY_LINE,drawFileList:!0}),t.parse=function(e,n={}){return a.parse(e,Object.assign(Object.assign({},t.defaultDiff2HtmlConfig),n))},t.html=function(e,n={}){const i=Object.assign(Object.assign({},t.defaultDiff2HtmlConfig),n),r="string"==typeof e?a.parse(e,i):e,s=new u.default(i);return(i.drawFileList?o.render(r,s):"")+("side-by-side"===i.outputFormat?new d.default(s,i).render(r):new c.default(s,i).render(r))}},479:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.render=void 0;const l=s(n(741)),a="file-summary";t.render=function(e,t){const n=e.map((e=>t.render(a,"line",{fileHtmlId:l.getHtmlId(e),oldName:e.oldName,newName:e.newName,fileName:l.filenameDiff(e),deletedLines:"-"+e.deletedLines,addedLines:"+"+e.addedLines},{fileIcon:t.template("icon",l.getFileIcon(e))}))).join("\n");return t.render(a,"wrapper",{filesNumber:e.length,files:n})}},63:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const l=s(n(485)),a=n(979);t.default=class{constructor({compiledTemplates:e={},rawTemplates:t={}}){const n=Object.entries(t).reduce(((e,[t,n])=>{const i=l.compile(n,{asString:!1});return Object.assign(Object.assign({},e),{[t]:i})}),{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},a.defaultTemplates),e),n)}static compile(e){return l.compile(e,{asString:!1})}render(e,t,n,i,r){const s=this.templateKey(e,t);try{return this.preCompiledTemplates[s].render(n,i,r)}catch(e){throw new Error(`Could not find template to render '${s}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}}},378:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLineByLineRendererConfig=void 0;const l=s(n(483)),a=s(n(741)),o=n(699);t.defaultLineByLineRendererConfig=Object.assign(Object.assign({},a.defaultRenderConfig),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});const c="generic",d="line-by-line";t.default=class{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},t.defaultLineByLineRendererConfig),n)}render(e){const t=e.map((e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)})).join("\n");return this.hoganUtils.render(c,"wrapper",{content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template(d,"file-diff"),i=this.hoganUtils.template(c,"file-path"),r=this.hoganUtils.template("icon","file"),s=this.hoganUtils.template("tag",a.getFileIcon(e));return n.render({file:e,fileHtmlId:a.getHtmlId(e),diffs:t,filePath:i.render({fileDiffName:a.filenameDiff(e)},{fileIcon:r,fileTag:s})})}generateEmptyDiff(){return this.hoganUtils.render(c,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:a.CSSLineClass})}generateFileHtml(e){const t=l.newMatcherFn(l.newDistanceFn((t=>a.deconstructLine(t.content,e.isCombined).content)));return e.blocks.map((n=>{let i=this.hoganUtils.render(c,"block-header",{CSSLineClass:a.CSSLineClass,blockHeader:e.isTooBig?n.header:a.escapeForHtml(n.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(n).forEach((([n,r,s])=>{if(r.length&&s.length&&!n.length)this.applyRematchMatching(r,s,t).map((([t,n])=>{const{left:r,right:s}=this.processChangedLines(e,e.isCombined,t,n);i+=r,i+=s}));else if(n.length)n.forEach((t=>{const{prefix:n,content:r}=a.deconstructLine(t.content,e.isCombined);i+=this.generateSingleLineHtml(e,{type:a.CSSLineClass.CONTEXT,prefix:n,content:r,oldNumber:t.oldNumber,newNumber:t.newNumber})}));else if(r.length||s.length){const{left:t,right:n}=this.processChangedLines(e,e.isCombined,r,s);i+=t,i+=n}else console.error("Unknown state reached while processing groups of lines",n,r,s)})),i})).join("\n")}applyLineGroupping(e){const t=[];let n=[],i=[];for(let r=0;r0)&&(t.push([[],n,i]),n=[],i=[]),s.type===o.LineType.CONTEXT?t.push([[s],[],[]]):s.type===o.LineType.INSERT&&0===n.length?t.push([[],[],[s]]):s.type===o.LineType.INSERT&&n.length>0?i.push(s):s.type===o.LineType.DELETE&&n.push(s)}return(n.length||i.length)&&(t.push([[],n,i]),n=[],i=[]),t}applyRematchMatching(e,t,n){const i=e.length*t.length,r=Math.max.apply(null,[0].concat(e.concat(t).map((e=>e.content.length))));return i{"use strict";function n(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;const n=[];let i,r;for(i=0;i<=t.length;i++)n[i]=[i];for(r=0;r<=e.length;r++)n[0][r]=r;for(i=1;i<=t.length;i++)for(r=1;r<=e.length;r++)t.charAt(i-1)===e.charAt(r-1)?n[i][r]=n[i-1][r-1]:n[i][r]=Math.min(n[i-1][r-1]+1,Math.min(n[i][r-1]+1,n[i-1][r]+1));return n[t.length][e.length]}Object.defineProperty(t,"__esModule",{value:!0}),t.newMatcherFn=t.newDistanceFn=t.levenshtein=void 0,t.levenshtein=n,t.newDistanceFn=function(e){return(t,i)=>{const r=e(t).trim(),s=e(i).trim();return n(r,s)/(r.length+s.length)}},t.newMatcherFn=function(e){return function t(n,i,r=0,s=new Map){const l=function(t,n,i=new Map){let r,s=1/0;for(let l=0;l0||l.indexB>0)&&(v=g.concat(v)),(n.length>f||i.length>u)&&(v=v.concat(m)),v}}},741:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.diffHighlight=t.getFileIcon=t.getHtmlId=t.filenameDiff=t.deconstructLine=t.escapeForHtml=t.toCSSClass=t.defaultRenderConfig=t.CSSLineClass=void 0;const l=s(n(785)),a=n(593),o=s(n(483)),c=n(699);t.CSSLineClass={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},t.defaultRenderConfig={matching:c.LineMatchingType.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:c.DiffStyleType.WORD};const d="/",f=o.newDistanceFn((e=>e.value)),u=o.newMatcherFn(f);function p(e){return-1!==e.indexOf("dev/null")}function h(e){return e.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}function g(e){return e.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function b(e,t,n=!0){const i=function(e){return e?2:1}(t);return{prefix:e.substring(0,i),content:n?g(e.substring(i)):e.substring(i)}}function m(e){const t=(0,a.unifyPath)(e.oldName),n=(0,a.unifyPath)(e.newName);if(t===n||p(t)||p(n))return p(n)?t:n;{const e=[],i=[],r=t.split(d),s=n.split(d);let l=0,a=r.length-1,o=s.length-1;for(;ll&&o>l&&r[a]===s[o];)i.unshift(s[o]),a-=1,o-=1;const c=e.join(d),f=i.join(d),u=r.slice(l,a+1).join(d),p=s.slice(l,o+1).join(d);return c.length&&f.length?c+d+"{"+u+" → "+p+"}"+d+f:c.length?c+d+"{"+u+" → "+p+"}":f.length?"{"+u+" → "+p+"}"+d+f:t+" → "+n}}t.toCSSClass=function(e){switch(e){case c.LineType.CONTEXT:return t.CSSLineClass.CONTEXT;case c.LineType.INSERT:return t.CSSLineClass.INSERTS;case c.LineType.DELETE:return t.CSSLineClass.DELETES}},t.escapeForHtml=g,t.deconstructLine=b,t.filenameDiff=m,t.getHtmlId=function(e){return`d2h-${(0,a.hashCode)(m(e)).toString().slice(-6)}`},t.getFileIcon=function(e){let t="file-changed";return e.isRename||e.isCopy?t="file-renamed":e.isNew?t="file-added":e.isDeleted?t="file-deleted":e.newName!==e.oldName&&(t="file-renamed"),t},t.diffHighlight=function(e,n,i,r={}){const{matching:s,maxLineLengthHighlight:a,matchWordsThreshold:o,diffStyle:c}=Object.assign(Object.assign({},t.defaultRenderConfig),r),d=b(e,i,!1),p=b(n,i,!1);if(d.content.length>a||p.content.length>a)return{oldLine:{prefix:d.prefix,content:g(d.content)},newLine:{prefix:p.prefix,content:g(p.content)}};const m="char"===c?l.diffChars(d.content,p.content):l.diffWordsWithSpace(d.content,p.content),v=[];if("word"===c&&"words"===s){const e=m.filter((e=>e.removed)),t=m.filter((e=>e.added));u(t,e).forEach((e=>{1===e[0].length&&1===e[1].length&&f(e[0][0],e[1][0]){const n=t.added?"ins":t.removed?"del":null,i=v.indexOf(t)>-1?' class="d2h-change"':"",r=g(t.value);return null!==n?`${e}<${n}${i}>${r}`:`${e}${r}`}),"");return{oldLine:{prefix:d.prefix,content:(w=y,w.replace(/(]*>((.|\n)*?)<\/ins>)/g,""))},newLine:{prefix:p.prefix,content:h(y)}};var w}},170:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultSideBySideRendererConfig=void 0;const l=s(n(483)),a=s(n(741)),o=n(699);t.defaultSideBySideRendererConfig=Object.assign(Object.assign({},a.defaultRenderConfig),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});const c="generic";t.default=class{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},t.defaultSideBySideRendererConfig),n)}render(e){const t=e.map((e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)})).join("\n");return this.hoganUtils.render(c,"wrapper",{content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template("side-by-side","file-diff"),i=this.hoganUtils.template(c,"file-path"),r=this.hoganUtils.template("icon","file"),s=this.hoganUtils.template("tag",a.getFileIcon(e));return n.render({file:e,fileHtmlId:a.getHtmlId(e),diffs:t,filePath:i.render({fileDiffName:a.filenameDiff(e)},{fileIcon:r,fileTag:s})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(c,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:a.CSSLineClass})}}generateFileHtml(e){const t=l.newMatcherFn(l.newDistanceFn((t=>a.deconstructLine(t.content,e.isCombined).content)));return e.blocks.map((n=>{const i={left:this.makeHeaderHtml(n.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach((([n,r,s])=>{if(r.length&&s.length&&!n.length)this.applyRematchMatching(r,s,t).map((([t,n])=>{const{left:r,right:s}=this.processChangedLines(e.isCombined,t,n);i.left+=r,i.right+=s}));else if(n.length)n.forEach((t=>{const{prefix:n,content:r}=a.deconstructLine(t.content,e.isCombined),{left:s,right:l}=this.generateLineHtml({type:a.CSSLineClass.CONTEXT,prefix:n,content:r,number:t.oldNumber},{type:a.CSSLineClass.CONTEXT,prefix:n,content:r,number:t.newNumber});i.left+=s,i.right+=l}));else if(r.length||s.length){const{left:t,right:n}=this.processChangedLines(e.isCombined,r,s);i.left+=t,i.right+=n}else console.error("Unknown state reached while processing groups of lines",n,r,s)})),i})).reduce(((e,t)=>({left:e.left+t.left,right:e.right+t.right})),{left:"",right:""})}applyLineGroupping(e){const t=[];let n=[],i=[];for(let r=0;r0)&&(t.push([[],n,i]),n=[],i=[]),s.type===o.LineType.CONTEXT?t.push([[s],[],[]]):s.type===o.LineType.INSERT&&0===n.length?t.push([[],[],[s]]):s.type===o.LineType.INSERT&&n.length>0?i.push(s):s.type===o.LineType.DELETE&&n.push(s)}return(n.length||i.length)&&(t.push([[],n,i]),n=[],i=[]),t}applyRematchMatching(e,t,n){const i=e.length*t.length,r=Math.max.apply(null,[0].concat(e.concat(t).map((e=>e.content.length))));return i{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiffStyleType=t.LineMatchingType=t.OutputFormatType=t.LineType=void 0,function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"}(n||(t.LineType=n={})),t.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},t.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"},t.DiffStyleType={WORD:"word",CHAR:"char"}},169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Diff2HtmlUI=t.defaultDiff2HtmlUIConfig=void 0;const i=n(529),r=n(834);t.defaultDiff2HtmlUIConfig=Object.assign(Object.assign({},r.defaultDiff2HtmlConfig),{synchronisedScroll:!0,highlight:!0,fileListToggle:!0,fileListStartVisible:!1,highlightLanguages:new Map,smartSelection:!0,fileContentToggle:!0,stickyFileHeaders:!0}),t.Diff2HtmlUI=class{constructor(e,n,i={},s){this.hljs=null,this.currentSelectionColumnId=-1,this.config=Object.assign(Object.assign({},t.defaultDiff2HtmlUIConfig),i),this.diffHtml=void 0!==n?(0,r.html)(n,this.config):e.innerHTML,this.targetElement=e,void 0!==s&&(this.hljs=s)}draw(){this.targetElement.innerHTML=this.diffHtml,this.config.synchronisedScroll&&this.synchronisedScroll(),this.config.highlight&&this.highlightCode(),this.config.fileListToggle&&this.fileListToggle(this.config.fileListStartVisible),this.config.fileContentToggle&&this.fileContentToggle(),this.config.stickyFileHeaders&&this.stickyFileHeaders()}synchronisedScroll(){this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((e=>{const[t,n]=Array().slice.call(e.querySelectorAll(".d2h-file-side-diff"));if(void 0===t||void 0===n)return;const i=e=>{null!==e&&null!==e.target&&(e.target===t?(n.scrollTop=t.scrollTop,n.scrollLeft=t.scrollLeft):(t.scrollTop=n.scrollTop,t.scrollLeft=n.scrollLeft))};t.addEventListener("scroll",i),n.addEventListener("scroll",i)}))}fileListToggle(e){const t=this.targetElement.querySelector(".d2h-show"),n=this.targetElement.querySelector(".d2h-hide"),i=this.targetElement.querySelector(".d2h-file-list");if(null===t||null===n||null===i)return;const r=()=>{t.style.display="none",n.style.display="inline",i.style.display="block"},s=()=>{t.style.display="inline",n.style.display="none",i.style.display="none"};t.addEventListener("click",(()=>r())),n.addEventListener("click",(()=>s()));const l=this.getHashTag();"files-summary-show"===l?r():"files-summary-hide"===l?s():e?r():s()}fileContentToggle(){this.targetElement.querySelectorAll(".d2h-file-collapse").forEach((e=>{e.style.display="flex";const t=t=>{var n;const i=null===(n=e.closest(".d2h-file-wrapper"))||void 0===n?void 0:n.querySelector(t);null!=i&&(e.classList.toggle("d2h-selected"),i.classList.toggle("d2h-d-none"))};e.addEventListener("click",(n=>(n=>{e!==n.target&&(t(".d2h-file-diff"),t(".d2h-files-diff"))})(n)))}))}highlightCode(){const e=this.hljs;if(null===e)throw new Error("Missing a `highlight.js` implementation. Please provide one when instantiating Diff2HtmlUI.");this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((t=>{const n=t.getAttribute("data-lang");this.config.highlightLanguages instanceof Map||(this.config.highlightLanguages=new Map(Object.entries(this.config.highlightLanguages)));let r=n&&this.config.highlightLanguages.has(n)?this.config.highlightLanguages.get(n):n?(0,i.getLanguage)(n):"plaintext";void 0===e.getLanguage(r)&&(r="plaintext"),t.querySelectorAll(".d2h-code-line-ctn").forEach((t=>{const n=t.textContent,s=t.parentNode;if(null===n||null===s||!this.isElement(s))return;const l=(0,i.closeTags)(e.highlight(n,{language:r,ignoreIllegals:!0})),a=(0,i.nodeStream)(t);if(a.length){const e=document.createElementNS("http://www.w3.org/1999/xhtml","div");e.innerHTML=l.value,l.value=(0,i.mergeStreams)(a,(0,i.nodeStream)(e),n)}t.classList.add("hljs"),l.language&&t.classList.add(l.language),t.innerHTML=l.value}))}))}stickyFileHeaders(){this.targetElement.querySelectorAll(".d2h-file-header").forEach((e=>{e.classList.add("d2h-sticky-header")}))}smartSelection(){console.warn("Smart selection is now enabled by default with CSS. No need to call this method anymore.")}getHashTag(){const e=document.URL,t=e.indexOf("#");let n=null;return-1!==t&&(n=e.substr(t+1)),n}isElement(e){return null!==e&&void 0!==(null==e?void 0:e.classList)}}},529:(e,t)=>{"use strict";function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function i(e){return e.nodeName.toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.getLanguage=t.closeTags=t.mergeStreams=t.nodeStream=void 0,t.nodeStream=function(e){const t=[],n=(e,r)=>{for(let s=e.firstChild;s;s=s.nextSibling)3===s.nodeType&&null!==s.nodeValue?r+=s.nodeValue.length:1===s.nodeType&&(t.push({event:"start",offset:r,node:s}),r=n(s,r),i(s).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:s}));return r};return n(e,0),t},t.mergeStreams=function(e,t,r){let s=0,l="";const a=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset`${e.nodeName}="${n(e.value).replace(/"/g,""")}"`)).join(" ")}>`}function d(e){l+=""}function f(e){("start"===e.event?c:d)(e.node)}for(;e.length||t.length;){let t=o();if(l+=n(r.substring(s,t[0].offset)),s=t[0].offset,t===e){a.reverse().forEach(d);do{f(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===s);a.reverse().forEach(c)}else"start"===t[0].event?a.push(t[0].node):a.pop(),f(t.splice(0,1)[0])}return l+n(r.substr(s))},t.closeTags=function(e){const t=new Array;return e.value=e.value.split("\n").map((e=>{const n=t.map((e=>``)).join(""),i=e.matchAll(/(|<\/span>)/g);return Array.from(i).forEach((e=>{""===e[0]?t.shift():t.unshift(e[2])})),n+e+"".repeat(t.length)})).join("\n"),e};const r={"1c":"1c",abnf:"abnf",accesslog:"accesslog",as:"actionscript",adb:"ada",ada:"ada",ads:"ada",angelscript:"angelscript",apache:"apache",applescript:"applescript",scpt:"applescript",arcade:"arcade",cpp:"cpp",hpp:"cpp",arduino:"arduino",ino:"arduino",armasm:"armasm",arm:"armasm",xml:"xml",html:"xml",xhtml:"xml",rss:"xml",atom:"xml",xjb:"xml",xsd:"xml",xsl:"xml",plist:"xml",svg:"xml",asciidoc:"asciidoc",adoc:"asciidoc",asc:"asciidoc",aspectj:"aspectj",ahk:"autohotkey",ahkl:"autohotkey",au3:"autoit",avrasm:"avrasm",awk:"awk",axapta:"axapta","x++":"axapta",bash:"bash",sh:"bash",zsh:"bash",b:"basic",bnf:"bnf",bf:"brainfuck",c:"c",h:"c",cats:"c",idc:"c",cal:"cal",capnproto:"capnproto",capnp:"capnproto",ceylon:"ceylon",clean:"clean",clj:"clojure",boot:"clojure",cl2:"clojure",cljc:"clojure",cljs:"clojure","cljs.hl":"clojure",cljscm:"clojure",cljx:"clojure",hic:"clojure","clojure-repl":"clojure-repl",cmake:"cmake","cmake.in":"cmake",coffee:"coffeescript",_coffee:"coffeescript",cake:"coffeescript",cjsx:"coffeescript",iced:"coffeescript",cson:"coffeescript",coq:"coq",cos:"cos",cls:"cos",crmsh:"crmsh",crm:"crmsh",pcmk:"crmsh",cr:"crystal",cs:"csharp",csx:"csharp",csp:"csp",css:"css",d:"d",di:"d",md:"markdown",markdown:"markdown",mdown:"markdown",mdwn:"markdown",mkd:"markdown",mkdn:"markdown",mkdown:"markdown",ronn:"markdown",workbook:"markdown",dart:"dart",dpr:"delphi",dfm:"delphi",pas:"delphi",pascal:"delphi",diff:"diff",patch:"diff",django:"django",jinja:"django",dns:"dns",zone:"dns",bind:"dns",dockerfile:"dockerfile",docker:"dockerfile",dos:"dos",bat:"dos",cmd:"dos",dsconfig:"dsconfig",dts:"dts",dust:"dust",dst:"dust",ebnf:"ebnf",ex:"elixir",exs:"elixir",elm:"elm",rb:"ruby",builder:"ruby",eye:"ruby",gemspec:"ruby",god:"ruby",jbuilder:"ruby",mspec:"ruby",pluginspec:"ruby",podspec:"ruby",rabl:"ruby",rake:"ruby",rbuild:"ruby",rbw:"ruby",rbx:"ruby",ru:"ruby",ruby:"ruby",spec:"ruby",thor:"ruby",watchr:"ruby",erb:"erb","erlang-repl":"erlang-repl",erl:"erlang","app.src":"erlang",escript:"erlang",hrl:"erlang",xrl:"erlang",yrl:"erlang",excel:"excel",xls:"excel",xlsx:"excel",fix:"fix",flix:"flix",f90:"fortran",f:"fortran",f03:"fortran",f08:"fortran",f77:"fortran",f95:"fortran",for:"fortran",fpp:"fortran",fs:"fsharp",fsx:"fsharp",gams:"gams",gms:"gams",gauss:"gauss",gss:"gauss",gcode:"gcode",nc:"gcode",gherkin:"gherkin",glsl:"glsl",fp:"glsl",frag:"glsl",frg:"glsl",fsh:"glsl",fshader:"glsl",geo:"glsl",geom:"glsl",glslv:"glsl",gshader:"glsl",shader:"glsl",tesc:"glsl",tese:"glsl",vert:"glsl",vrx:"glsl",vsh:"glsl",vshader:"glsl",gml:"gml",go:"go",bal:"go",golo:"golo",gololang:"golo",gradle:"gradle",groovy:"groovy",grt:"groovy",gtpl:"groovy",gvy:"groovy",haml:"haml","haml.deface":"haml",handlebars:"handlebars",hbs:"handlebars","html.hbs":"handlebars","html.handlebars":"handlebars",hs:"haskell",hsc:"haskell",idr:"haskell",purs:"haskell",hx:"haxe",hxsl:"haxe",hsp:"hsp",htmlbars:"htmlbars",http:"http",https:"http",hy:"hy",inform7:"inform7",i7:"inform7",ini:"ini",toml:"ini",cfg:"ini",prefs:"ini",irpf90:"irpf90",isbl:"isbl",java:"java",jsp:"java",js:"javascript",jsx:"javascript",_js:"javascript",bones:"javascript",es:"javascript",es6:"javascript",gs:"javascript",jake:"javascript",jsb:"javascript",jscad:"javascript",jsfl:"javascript",jsm:"javascript",jss:"javascript",mjs:"javascript",njs:"javascript",pac:"javascript",sjs:"javascript",ssjs:"javascript",xsjs:"javascript",xsjslib:"javascript",cfc:"javascript","jboss-cli":"jboss-cli",json:"json",avsc:"json",geojson:"json",gltf:"json","JSON-tmLanguage":"json",jsonl:"json",tfstate:"json","tfstate.backup":"json",topojson:"json",webapp:"json",webmanifest:"json",jl:"julia","julia-repl":"julia-repl",kt:"kotlin",ktm:"kotlin",kts:"kotlin",lasso:"lasso",lassoscript:"lasso",tex:"latex",ldif:"ldif",leaf:"leaf",less:"less",lisp:"lisp",factor:"lisp",livecodeserver:"livecodeserver",ls:"livescript",_ls:"livescript",llvm:"llvm",lsl:"lsl",lua:"lua",nse:"lua",p8:"lua",pd_lua:"lua",rbxs:"lua",wlua:"lua",mak:"makefile",make:"makefile",mk:"makefile",mkfile:"makefile",mathematica:"mathematica",mma:"mathematica",wl:"mathematica",matlab:"matlab",maxima:"maxima",mel:"mel",mercury:"mercury",mipsasm:"mipsasm",miz:"mizar",voc:"mizar",al:"perl",cgi:"perl",fcgi:"perl",perl:"perl",ph:"perl",plx:"perl",pl:"perl",pm:"perl",psgi:"perl",t:"perl",mojolicious:"mojolicious",monkey:"monkey",monkey2:"monkey",moonscript:"moonscript",moon:"moonscript",n1ql:"n1ql",nginxconf:"nginx",nim:"nim",nimrod:"nim",nix:"nix",nsi:"nsis",nsh:"nsis",m:"objectivec",objc:"objectivec",mm:"objectivec","obj-c":"objectivec","obj-c++":"objectivec","objective-c++":"objectivec",fun:"ocaml",sig:"ocaml",ml:"ocaml",mli:"ocaml",eliom:"ocaml",eliomi:"ocaml",ml4:"ocaml",mll:"ocaml",mly:"ocaml",openscad:"openscad",oxygene:"oxygene",parser3:"parser3",pf:"pf","pf.conf":"pf",pgsql:"pgsql",postgres:"pgsql",postgresql:"pgsql",php:"php",aw:"php",ctp:"php",inc:"php",php3:"php",php4:"php",php5:"php",phps:"php",phpt:"php","php-template":"php-template",plaintext:"plaintext",txt:"plaintext",text:"plaintext",pony:"pony",ps:"powershell",ps1:"powershell",psd1:"powershell",psm1:"powershell",pde:"processing",profile:"profile",pro:"prolog",prolog:"prolog",yap:"prolog",properties:"properties",proto:"protobuf",puppet:"puppet",pp:"puppet",purebasic:"purebasic",py:"python",bzl:"python",gyp:"python",gypi:"python",lmi:"python",py3:"python",pyde:"python",pyi:"python",pyp:"python",pyt:"python",pyw:"python",rpy:"python",tac:"python",wsgi:"python",xpy:"python","python-repl":"python-repl",pycon:"python-repl",q:"q",k:"q",kdb:"q",qml:"qml",r:"r",rd:"r",rsx:"r",reasonml:"reasonml",re:"reasonml",rib:"rib",roboconf:"roboconf",graph:"roboconf",instances:"roboconf",routeros:"routeros",rsl:"rsl",ruleslanguage:"ruleslanguage",rs:"rust","rs.in":"rust",sas:"sas",scala:"scala",kojo:"scala",sbt:"scala",sc:"scala",scm:"scheme",sch:"scheme",sld:"scheme",sls:"scheme",sps:"scheme",ss:"scheme",rkt:"scheme",scilab:"scilab",scss:"scss",shell:"shell",smali:"smali",st:"smalltalk",sml:"sml",sqf:"sqf",sql:"sql",cql:"sql",ddl:"sql",mysql:"sql",prc:"sql",tab:"sql",udf:"sql",viw:"sql",stan:"stan",stanfuncs:"stan",stata:"stata",step21:"step21",step:"step21",stp:"step21",styl:"stylus",subunit:"subunit",swift:"swift",taggerscript:"taggerscript",yml:"yaml",mir:"yaml",reek:"yaml",rviz:"yaml","sublime-syntax":"yaml",syntax:"yaml",yaml:"yaml","yaml-tmlanguage":"yaml","yml.mysql":"yaml",tap:"tap",tcl:"tcl",adp:"tcl",tm:"tcl",thrift:"thrift",tp:"tp",twig:"twig",craftcms:"twig",ts:"typescript",tsx:"typescript",vala:"vala",vbnet:"vbnet",vb:"vbnet",vbscript:"vbscript",vbs:"vbscript","vbscript-html":"vbscript-html",v:"verilog",veo:"verilog",vhdl:"vhdl",vhd:"vhdl",vhf:"vhdl",vhi:"vhdl",vho:"vhdl",vhs:"vhdl",vht:"vhdl",vhw:"vhdl",vim:"vim",x86asm:"x86asm",xl:"xl",xquery:"xquery",xpath:"xquery",xq:"xquery",zephir:"zephir",zep:"zephir"};t.getLanguage=function(e){var t;return null!==(t=r[e])&&void 0!==t?t:"plaintext"}},593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashCode=t.unifyPath=t.escapeForRegExp=void 0;const n=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");t.escapeForRegExp=function(e){return e.replace(n,"\\$&")},t.unifyPath=function(e){return e?e.replace(/\\/g,"/"):e},t.hashCode=function(e){let t,n,i,r=0;for(t=0,i=e.length;t